Path time for intersection?

I would like to get the path time(s) for a segment at which it intersects with another segment. GSPathSegment.intersectionPoints_() returns a list of points. Currently, I need to use a function that calculates (approximates) the path time of the segment at which that point is. Is there a more straightforward method? Thanks!

The intersection code results in the actual point. And if there are more intersections, the time is not really helpful (as soon as you split the first time, the next intersection time is not useful any more.

What exactly are you trying to do?

I am trying to calculate a new segment based on the split. More specifically, I want to cut a segment at a specific x or y coordinate (for example, cut a segment at the baseline intersection).

To compute the t value, there are some c functions. Those can be used from python but are a bit tricky to get to. On API you can use this:

segments = NSMutableArray.new()
segments.append(curveSegment, lineSegment)
GSPathOperator.addIntersections_(segments)

I can’t find any documentation for GSPathOperator. Searching for it in the method reporter reveals one single available method: processFont_withArguments_().

In any case, I get: NameError: name 'GSPathOperator' is not defined.

Hi Sebastian.
It seems like you need to import it first. Try something like this:
from GlyphsApp import GSPathOperator

I tried that of course, but the import doesn’t work.

Sorry, in python it is called “GSPathFinder”.