Python: Detecting whether a node or segment of a path is inside the glyph

Hi all,
I am writing a script to check paths in a glyph and would like to be able to tell whether the current node or segment is inside the filled portion of the glyph (e.g. an opened corner). Is there an inbuilt function to do this?

I could find anything in the forum and although some similar problems were solved by using GSPathPen (e.g. here and here), these suggestions are several years old and I couldn’t get them working on Glyphs 3; the pen didn’t remove the overlap regions and isn’t non-destructive.

Thanks in advance for any help!

What do you mean by “inside the filled portion”. Do you mean a node that would be removed by remove overlap?

One option would be to remove overlap and check if the result has a not at that position.

Thanks, Georg. I did think of doing this on a duplicate of the path, but wasn’t sure if this might also affect the other nodes in the glyph, making the comparison of before and after more difficult. Isn’t there a built-in Glyphs function to return a boolean given a coordinate?

There is no build in API.

I was thinking about this again: Remove overlap should not affect the other nodes as long as you do it path by path instead of removing overlap for the entire layer at once.