algorithmic modeling for Rhino
The problem with Line|Line intersections is that they treat all lines as infinite objects. You need to use MultipleCurve intersections, which is pretty slow. Basically it intersects each curve with every subsequent curve, so for 5000 lines you end up performing ~ (5000 * 4999)/2 = 12497500 intersections. This takes a good 20 seconds on my machine.
Once you have a set of all the curve indices involved in intersections, you can cull based on those indices:
and the file...
And here's a custom c# script that takes only 4 seconds.
Hello David,
Thank you for your prompt reply. The script works great.
Regards,
Bogdan
There are other ways to speed this up, primarily by putting lines into spatial boxes so you can quickly reject the majority of them without performing any intersections. That'll take a lot of coding however.
I agree that there is always room for improvement. I actually thought about using, not boxes but circles, in an attempt to define some spatial borders. However, it didn’t get me too far since I’m still a novice in Grasshopper. I will most probably come back to issues like the one I have asked help for and try to fine tune it, once my project starts to take shape and I accumulate some experience. At the moment I need a basic structure that runs my task.
Thank you for your suggestion David.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by