Project curves onto breps loses tree structure

I thought I more or less understood trees up to this point, but I can’t wrap my head around this. I have tree of 8 surfaces (Surfaces), a tree of 8 vectors normal to each surface at a certain point (Surface normals), and a tree of 8 collections of curves (Curves) that need to be projected onto each surface. So the first branch of Curves needs to be projected onto the first branch of Surfaces in the direction of the first branch of Surface normals, same with the second branch, etc.

Now, the geometry looks perfect in Rhino—the curves are all exactly where they need to be. But the tree structure is completely screwed up with one branch for each projected curve. If I try to unflatten it or match it to the structure of the Curves tree, I get back to the structure of the original Curves tree with 8 branches, but the curves in each tree are no longer associated to the corresponding surface onto which they were projected.

Is there something fundamental that I am missing about trees or curve → brep projection?

Attached is the grasshopper file with internalized geometry: (67.6 KB)

Not really possible to troubleshoot from your screen capture. Please post a grasshopper file with internalized geometry.


Will do, thank you Kevin

OK Kevin, I’ve posted the script. Thank you for pointing that out!

The Shift Paths component will restore your DataTree structure, but what is the reason for the naming of your DataTree paths?

What is easier to follow?

This: (66.2 KB)

Or this: (67.6 KB)


1 Like

Kevin, thank you so much. I had been trying to find a utility to rename the branches on my tree but never ran across that Renumber tool from Treesloth. You are a lifesaver. I am going to clean up all of my trees now :slight_smile:

You don’t need Treesloth to do this. Here are three ways to renumber / match branches: (79.4 KB)

1 Like

Awesome! Thank you, Martin.