I have a 3d matrix of points that I am using to make polylines. Some of these branches need to be modified, but working with data trees can get complicated quite quickly. Because of the way that the points were made, some points end up in a list together that shouldn’t be together. My plan is to iteratively go through the branches, and iteratively go through the points in each branch, to measure the distance to their neighbors (based on index) and see if they are too far apart from eachother to sensibly be in the same list.
The end goal is to have each branch be its own independent polyline. Each polyline should not intersect a polyline from another branch. Which, I guess maybe I could just flatten all the data, then find any intersection points, and try to cull out lines. But this would also be complicated b/c the part of line needing to be culled would vary where it occurs. I also would like to get better at working with data trees.
lines bw curves03.gh (258.4 KB)
This is an example of a properly split tree branch(only achievable because I used the TreeBranch component to select 1 branch, then iterate through it as a list)
However, I haven’t been able to use the DataTree class effectively in Python. I tried first, iterating through branches, then through the lists, and trying to export indexes of half the list to be used in a TreeSplit mask. I couldn’t get this to work.
Of course, as stated previously, I can split an individual list if I first isolate it with the TreeBranch component: