SCarewe
(Sebastian Carewe)
February 27, 2025, 10:39am
1
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!
Mark
(Mark Frömberg aka Mark2Mark)
February 27, 2025, 2:06pm
2
So the difference between your 2 starting situations (img 1 & 3) is only that the bottom node is further to the right?
Mark
(Mark Frömberg aka Mark2Mark)
February 27, 2025, 2:14pm
4
What are your parameters in this method? Do you have a True
for extendPath
?
SCarewe
(Sebastian Carewe)
February 27, 2025, 2:18pm
5
I tried True, as well as numbers, everything (except for 0/False) yields the same result.
Mark
(Mark Frömberg aka Mark2Mark)
February 27, 2025, 2:23pm
6
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.
find the functions in GSGeometrieHelper.h.
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)
use the result to adjust the segments.
1 Like
SCarewe
(Sebastian Carewe)
February 27, 2025, 3:07pm
8
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.