It’s probably too much, but I was thinking that maybe it would also be possible to have various flap lengths depending on curvature. Say whenever there is a sharp turn and shorter flaps would be needed, we could have 20-40mm flaps (blue ones), than red ones and for longer straight lines flaps could go up to 70-100mm in length (yellow ones) …
No problem it could also be useful for me. I have a new version with oversampling, because by default I transform each curve to a polyline with points every “distance by offset”, with oversampling it become a polyline with points every “(distance by offset)/oversampling”. It could be also possible to have 2 distance depending on the direction between 2 curves, parallel or perpendicular …
This seems really useful for physical fabrication and I like the way it creates a more even density of lines throughout the composition.
I made my own attempt using an Anemone loop- it takes an individual curve, shatters into segments 2x length of minimum threshold, then checks segment midpoint distance to all other curves (this is the biggest bottleneck in my script). If the distance to closest curve is less than minimum threshold, then the segment is culled.
Although my method does not deal with self-intersecting curves, I’m happy with the results - but not the speed. The loop processed 1000 curves in approx. 5 minutes. As far as I can tell either reducing the total number of curves or increasing the minimum threshold (thus shattering the individual curve into fewer segments to check against) will speed up proximity check.
Any pointers on how I can achieve the same results faster without sacrificing accuracy?
you can try: a) testing for collision with the ‘collision’ component, b) only test for distance for the current tree branch, plus the 2 next to it; that way will really cut down on number of comparisons to do
I discretize the curve with points. If you say D is the minimum distance between curves. I put points on curve every D/5. I use various way to treat point Proximity, I didn’t find a best for all situation. I use Rtree, Dictionary and also a simple grid to fasten the point detection.
You’ll fin on discourse many Rtree examples.
You’ll find example of dictionary there