I was wondering, how do I divide polyline segments that are longer than distance X? What I want is to specify distance X and add points along the segments at distance X.
I need this to operate on a file with about 30.000 curves of which 3500 segments need to be subdivided. But, with the script I have now, I can add the points that I need, but I don’t really know how I can maintain the order of the points list if I use the existing points and subdivision points to create a new polyline.
This script creates the subdivided segments and non-subdivided segments separately, outputting single lines for each. I am still puzzling how I could improve it to recreate the original curves with the subdivided polylines. Divide Long segments_Joined.gh (48.8 KB)
E: Note that I cannot just join the segments as this will ruin the Graph for the Graph analysis.
E2: I am almost there, updated the script. The issue is that I run into double small segments when joining. The short curves don’t seem to be dispatched properly. Don’t have time to work on this today, so I’ll leave it here as is.
You don’t need to segregate the long and short curves - using the DivLength component anything under the threshold will just remain undivided, so all curves can be processed the same, making life simple (apart from getting the tree depths right):