Trouble moving spheres along 'z' axis to top of pipes at all different heights - Sorting issue? Help pls!

Hey all,

I am trying to make several hundred unique trees (actual trees, not the data trees) in rhino for a model of Cornell from a tree survey. I have the trunk heights (line), the base point (points), the trunk diameter (curve, circle), and the canopy diameter (curve, circle). I have made a script that creates the spheres for the canopy, and the trunks (pipe component). Because the trees base are not all at the correct height relative to the terrain and I need them to peirce through the terrain a bit, I did meshclosestpoint and moved the bottom point down 2m and then made the pipe from that bottom point and the top point of the trunk height curve.

My issue is that I now need to move all the spheres so that they sit on top of the trunks, and for the life of me I cannot figure out how

to move them the correct distance. They all move a diff distance. Here are some sc and I have attached my gh script and model. I think it is a data sorting issue? But I am not sure. I am no (9.7 KB)

thx in advance!

your geometry pipelines wont work on anyone else’s computer. you have to internalize the data before uploading your file.


If you open it with the rhino file it should work no?

Sorry, I was trying to upload the rhino file and it did not work, here is a drive link:

Access Denied - it asks for me to request access with my email. change the settings on the drive sharing, or just internalize the data we need into the .gh document and we wouldn’t need the rhino file at all.

Hi, here you go: (129.5 KB)

Hey, I assume you wanted the spheres to be sat “in” the top of the pipes, cupped in there like this:

You did not internalize your mesh, so i ignored that part, but should be easy for you to add back in. Here’s the file: (131.2 KB)

There is probably a mathematical way to do this with the radius of the pipes and the spheres but I did it the easy way.

Thanks so much! This is exactly what I need. Now, the only issue is that the spheres are not the correct diameters. See the picture here (this is what I get now, the spheres are not the correct diameter, see the circle below them)

I need the spheres to be this diameter, see this picture:

Not sure why they are not the right diameter?

Thanks again!

You’re right, turns out the original lists of objects (the lines that make the pipes, and the circles that make the spheres) were not in the same order. You just have to sort them the same way first before you do the other operations and then the radii will match up. (209.1 KB)

Thank you so much! I will now go through this and try to understand how it all works, but it is perfect :slight_smile:

1 Like