I’m currently facing a challenge that seems straightforward but is proving tricky for me. I have a curve that I’ve divided into points. These points are then copied upward along the Z-axis by a fixed distance, creating 4 levels, and are also moved horizontally along the Y-axis by a variable distance.
I would like to adjust the levels as follows:
Branches 0-11 should have 6 levels,
Branches 12-21 should have 5 levels,
The remaining branches should stay at 4 levels.
I attempted to handle this with a Python component, but it only shifts the points upward, and the transitions are noticeable when I use these points to create boxes.
What would be the best approach to achieve this? Should I create 6 levels initially and then eliminate points where necessary, or start with 4 levels and add points as needed? Alternatively, is there a more efficient method to accomplish this?
As @maje90 mentioned, please share your file with geometry internalized so we can see whats going on.
Sounds like you may want to split your list at the desired branches then copy the partitioned list upward along the Z axis the desired number of times.
import Rhino.Geometry as rg
from Grasshopper import DataTree
from Grasshopper.Kernel.Data import GH_Path
Inputs
points_tree = points_tree # Data tree of points
height1 = height1 # Height for the first 14 branches
height2 = height2 # Height for the next 10 branches
height_increment = height_increment # Increment height for other points
Debugging print to check the value of height_increment
Perhaps I am overcomplicating the matter. Maybe the solution could be to select multiple branches in the data tree: branches 0-11, 12-21, 22-end, and split the tree into 3 separate chunks and remove points from them. Alternatively, managing the count separately (up to 6, 5, or 4 levels) might work. I found this thread:Selecting multiple branches in a datatree. - Grasshopper