C
C#2w ago
alexrees94

Connecting Lines in 3D space

Hey, I'm fairly a newbie to coding in general and first time asking for help on a forum so hopefully its a decent enough explanation. I have a list of Lines, and there will always be two outer vertical lines, which I can get easily enough. I'm now trying to create two lists of the upper lines and the lower lines. As shown in the images in blue/red. Any ideas on how I can best achieve this?
No description
No description
2 Replies
JRamos
JRamos2w ago
A slow solution is simply storing all of the endpoints of the line segment in a collection, then starting from the top of one, find non vertical lines with an endpoint within 0.0001 of the top, then removing that line from the collection, then continuing until you reach the other vertical lines top. Do it efficiently with an octree or similar spatial collection.
alexrees94
alexrees942w ago
Thank you! got it working
Want results from more Discord servers?
Add your server