Get nodes of curve segment

I know I can get a straight segment’s GSNodes from GSPathSegment.objects(), but I can’t do the same with a curve segment. That only returns the start and end node, but not the offcurve nodes.

I can use GSPathSegment.pointAtIndex_() to get points, but I would like the actual nodes.

The segments sometime store the original node. But don’t rely on it. If you need to keep the reference to nodes, why not use them directly (list of nodes instead of a segment)?

The segment are useful for bigger, “destructive” operations like remove overlap. For smaller operations like transformations, I would use the nodes.

What are you trying to do?

In my case, I need to transform each segment separately, based on whether it’s a curve or a line segment. These segments need to be transformed indepently from each other, and in the end I need to re-calculate their intersections (I’m not at that stage yet). Segments are very useful to quickly split up a path into line/curve parts. Getting their offcurve nodes would be immensely useful.

You should get to them with some path.nodes.index(oncurve).