How to stick path segments together?

Third new topic today, sorry, but I’m almost there. I’m stuck on one last thing, though:


Is there an efficient way of connecting these two paths at the intersection? And what about cases like this:

Here, I would like to connect them at the point as shown in the background. Of course, what I can do is connect the two paths and then run the “make Corner” method on the path, which is what I would do manually. Can somebody help me with a more programmatically elegant approach, though? Thanks!

GSPathSegment *s1 …
GSPathSegment *s …
NSPoint connectionPoint;
BOOL result = [s1 connectWithSegment:s2 force:YES miterLimit:2 newPoint:&connectionPoint];
``

Thanks, any way I can have that in my Python filter? :sweat_smile:

I saw that method, but couldn’t figure out what “newPoint” had to be (or how to calculate it).

Just put None for newPoint.