Organizing data lists / Targeting a group of curves contained in each voxel-box

Hello :))
Time for me to seek some help…
I am trying to lower the resolution of a big number (about 5000 ) of polylines coming out of Processing… in order to compute other operations more easily and faster.

For this, I made a ONE big bounding box for all the curves, that I subdivided into a 3d voxel grid using Crystallon Plugin (I can control the size of those voxels to control the output resolution…).

My idea is to break the polylines into subsegments, evaluate the center points, and check if those segments are inside the voxels.

The aim, is to target each group of segments contained inside each voxel, and operate the Average Curve component from Pufferfish plugin… This way I move from a bunch of segments in each voxel to only one single line in each voxel…

I am stuck in organizing the data trees to make each voxel match only with the segments inside… Can anyone help with this ?

Please have a look on both the attached Rhino and Grasshopper files… In the GH file, I have deleted the part where I try to match the trees… make the script less polluted and easy to read.
2020_02_23_Help.3dm (3.6 MB) 2020_02_23_Help.gh (39.7 KB)
If I am not clear, kindly let me know I will rephrase…

If you have also a way smarter/faster idea, I would love to hear it…
Thanks in advance for your help.

Problem Solved !
For those interested or with similar issue in the future, kindly have a look on the attached GH file…
Reminder : Crystallon and Pufferfish are used …
If someone still has a faster way to avoid computing time due to this method… very much appreciated !

Cheers to you…2020_02_24_Help_SOLVED.gh (41.7 KB)

1 Like

Some feedback…
Applying the script on a 2800 curves, it took 40 min to compute !
The PointInBrep Component needed 28 min… seems it is the one using time the most, despite its parallel computing… Im running on an 2,9Ghz i9 cpu, 32 go ram, 4go gpu…

I sped some things up, see how it works on your 2800 curves.

  1. Used Pufferfish Twisted Box Array (it is pretty optimized)

  2. Used Pufferfish Twisted Box Centers instead of the Volume component (again optimized)
    2

  3. Convert Twisted Boxes to Mesh and use Mesh Inclusion instead on going to Breps and Point in Brep.

2020_02_24_Help_SOLVED_MP.gh (20.6 KB)

1 Like

Thanks Mike ! Indeed the solution completed in 12 min !
Cheers to you :slight_smile:

1 Like