What is the best way to find intersection coordinates of two paths via Glyphs?
Or is there something like layer.intersectionsBetweenPoints() but for path?
Upd:
I’ve found path.bezierPath.intersectionWithLine_lineStart_lineEnd_() , but what arguments are required?
This is not officially documented but you can get good hints by looking at the headers in /Applications/Glyphs.app/Contents/Frameworks/GlyphsCore.framework/Versions/A/Headers. I usually open the whole folder in my text editor and do a multi-file search for the method or class in question.
In this case the file NSBezierPath-OAExtensions.h contains the definition (in ObjectiveC):
With the current build in functions, your first idea is probably the best. You can make a new layer, put a copy of both paths in it and run newLayer.intersectionsBetweenPoints().
Hi @GeorgSeifert, is this still the case? The function intersectionsBetweenPoints requires three parameters, the first two of which are the coordinates of a measurement line. As far as I have understood the OP, he wants to find the intersections between two paths, which may contain curves - is there a built-in function to do this?
I seem to have solved this myself; there is a function in NSBezierPath that does exactly this: p1.bezierPath.intersectWithPath_(p2.bezierPath)
where p1 and p2 are of type GSPath.
Perhaps this info helps someone else.