Why does removing nodes by script have a different effect on shapes than removing nodes manually?

I’m working on an auto italic script with some curve compensation. Basically automating the Briem method. Part of what it does after slanting a layer is add extremes and remove previously angled nodes, so that there are no handles at angles. What I’ve noticed is that the shape of the path is different depending on whether I remove on-curve nodes programmatically or by hand. The resulting off-curve/handle nodes after doing it programmatically are worse - removing nodes by hand is more reliable at maintaining the shape of the path - any idea why this is? I have been using path.removeNodeCheckKeepShape_(node) - is there a different method I should be using?

Try removeNodeCheckKeepShape_normalizeHandles_(node, True)

1 Like

Aha, perfect - thanks Florian!

I have been meaning to ask this for a while; would it be possible to implement this for when multiple nodes are removed at once?

I’m always annoyed when I need to remove multiple nodes at once. If I select multiple nodes and remove them, the shape is not retained, only if I remove them one by one. Is there a reason for this?

1 Like

I don’t quite follow, is that a response to my comment?

My suggestion is simply to use the method Florian mentioned, also for deleting multiple nodes – this is already what Rainer’s “Magic Remover” does, which makes a lot of sense in my eyes.

It appears somewhat inconsistent to use “keep shape” for single-node selection, but then omitting it when multiple nodes are selected. But I’m happy to hear about any specific reason why this might be better.

The result may need some editing afterwards, and depending on the point constellation, may not be what you want, especially with small segments. So it makes a little more sense to implement the shapekeeping for minute editing only, rather than the other way around at least.

For implementing it generally, we need to invest a combo key for the Delete key. Opt and Cmd are gone already.

For now, nothing keeps you from using Magic Remover, no?

The annoying thing is that it then removes that node in all masters, which I don’t necessarily want.