Threshold of extendPath argument

Hello, I am trying to use GSLayer.connectPathsWithNode_andNode_extendPath_(), for the following case:


However, this results in:

If I put them like this:

it works:

Any reason this is so? Can I control this somehow? That would be very useful. I know I could also use the method without the extendPath argument and then make the corner from the two resulting nodes, but that seems a bit clunky. Any ideas? Thanks!

So the difference between your 2 starting situations (img 1 & 3) is only that the bottom node is further to the right?

Exactly.

What are your parameters in this method? Do you have a True for extendPath?

I tried True, as well as numbers, everything (except for 0/False) yields the same result.

It takes a BOOL there, hence only True/False or 1/0 work. But unfortunately I cannot answer the rest of your questions.

It might be that you need to use lower level functions to determine the intersection and elongate the segments.

  1. find the functions in GSGeometrieHelper.h.
  2. figure out how to load them into python:
bundle = NSBundle.bundleForClass_(GSFont)
objc.loadBundleFunctions(bundle, globals(), [("GSIntersectLineLineUnlimited", '{CGPoint=dd}{CGPoint=dd}{CGPoint=dd}{CGPoint=dd}{CGPoint=dd}')])

(GSIntersectLineLineUnlimited gives intersections even if outside of the segment; There are similar functions for most combinations of segment types)

  1. use the result to adjust the segments.
1 Like

Nice, thanks. I’ve found a different method now, but just out of curiosity, is this only for line segments?

As I said, there are more of those methods for curve-line and curve-curve.