Copy link to clipboard
Copied
I wanted to see if anyone has work with a script to check how many times one path intersects with another. I have a script that places a couple of straight paths and I want to branch based on the number of intersections.
For instance this would return "2"
and this 4
There are cases depending on the count that I will either want to remove path or move the path, but I having figured out how to evaluate the intersections via script.
Thanks!
Jason
Copy link to clipboard
Copied
I can offer you this option.
Create an empty layer. Set the foreground color to 128.
Stroke the first path with a 1px pencil set to Screen mode.
Do the same stroke with the second path.
Leave only this layer visible.
In the histogram, the number of pixels with a brightness of 192 will be the answer.
PS. I don't have a ready script. But maybe someone will do it. )
Copy link to clipboard
Copied
Thanks for the idea. I ended up doing something real similar by stroking both paths in their own layer, creating and intesection selection, then pasting the intersecting pixels in a third layer and counting the pixels with the histogram.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now