Overlapping field lines, minimum distance between elements

Hi there,

I’m trying to create ‘extruded’ version of Tyler Hobbs flow lines drawings that could be built from some kind of sheet material like MDF/ metal, etc…


1b

Tyler gives very detailed description of how to do it but it’s all done with coding. Flow Fields — Tyler Hobbs

https://tylerxhobbs.com/essays/2020/flow-fields

As I’m not familiar with Phyton I was trying to achieve similar effect with grasshopper components.

I’ve managed to replace long curvy flow lines with short rectangles (20mm long by 4mm thick) which can be extruded in Z direction but there are few other issues I need to resolve:

  1. Overlapping of elements – as I’m planning to laser cut the flaps from plywood or plexiglass I can’t have any overlapping elements.
  2. Is there a way of specifying min distance between two elements so that it’s possible to laser cut the holes.

  1. 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) …

Thanks in advance for all your help.

fields_min distance.3dm (35.3 KB)

Thank you so much - I’ll play with it over the next few days. Hopefully with your script I’ll be able to get the result I was after.

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 …


Before

After

3 Likes

I would also like to use @laurent_delrieu’s script to remove the lines that are too close to each other, from a set of Principal Stress Lines that are obtained with the Karamba plugin (3.7.13: Line Results on Shells - Karamba3D 2.2.0).

Could you please share with me the Grasshopper script you created @laurent_delrieu? I can’t see it in this thread. I would use it for a university assignment.

In advance, thanks for your attention!

@laurent_delrieu what is the last picture in your previous post ^ ?
Seems like a sort of telescope… ?

Yes it is

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?

Thanks for sharing!

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

1 Like

Hello
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

I will publish this component in a plugin

2 Likes