Multiple curve intersections

Hello,
I am still waiting for this great feature to be introduced to Geometry Nodes. Meanwhile, I gave it a try and experimented with achieving something similar. The ray intersection engine is from here. I am still struggling a bit with the 3D distance ID pairing, so I’m not sure if it is working 100% yet.

3D intersection distance:
multi intersection

There is some experimental optimization when you have more curves but still need to use multi intersection among all (group ID 0).

Since no repeat zone is used, the performance is not too bad.

file:
curve intersection-08.blend (4.2 MB)

newer version based on triangle height computation (performance wise is slightly faster, precision seems to be the same)
curve intersection-10.zip (577.9 KB)

4 Likes

Cool ! It’s pretty useful to do that and not that easy to figure out !
I think Higgsas has something similar in their node kit …
Well done and thanks for sharing !

1 Like

Yes it is similar to higgsas one, just since here is no repeat zone, it should be a lot faster, not sure how reliable it is in all tasks, but it seems to work ok so far…;/ Tried to avoid using sin/cos functions as well hope it will bring more precision

1 Like

:exploding_head:
I just opened the file :slight_smile: Then I started to look into how it works… then I closed the file…

Anyway, awesome stuff ! Well done again !

1 Like

The noodles are maybe a bit messy, but the theory is simple (you probably know this method). Instead of the repeat zone I am duplicating the elements. You can imagine it as each duplicate is “one repeat zone iteration”. For this task I have ID, usually on spline domain, but you can have more splines in one ID. Each point from the ID you need to compare (compute if intersect and where) with all others. So it is quite expansion ID*ID points. Its like a boom and all is computed at once. The memory is the limit. Repeat zone is slooow, but saves the memory. You can see the simple preview from different task here What I like on this method is the preview, when you move all duplicates by its duplicate ID, in comparison with repeat zone you easily see what is going on and all values at once. Just the setup is a bit headache;)

1 Like

Hum thanks a lot !! It’s still a bit foggy but I’m starting to understand ! You mean, if you have 5 edges, you kinda generate 5*5 edges to test them all against each other ?

Well, generally this isn’t the kind of problems where I shine the most. I managed to do some kind of quick and dirty intersection algorithm once but it’s really more a hack than anything. I’m getting better at math even if I started my art career really far from them. However when things get complex like here I generally loose my patience and everything else :slight_smile:

I am on the same boat, no math or programming background at all, just discovered GN 1.5 yr ago, its addiction and lots of time I am trying to do something with the tool I do not understand well;) This method is maybe something like a proximity node where you have ID and it compares all at once X*X it is just well optimized (at least I hope it is like that).

PS: first DI (duplicate id) I compare first point to all others, second DI do the same for second point etc… After all I keep the points that intersect only set their positions to the new intersecting value and connect them back to the original curve points. Then I can run points to curves with use of the original group ID. Weighting the spline parameter length + intersecting distance for points that intersect. Something similar is possible even with another method (no points to curves), using the accumalte field subdivide curve and amount of cuts, but the setup is more complicated and performance a bit worse;/

1 Like