I’ve just recently started using Grasshopper and I’m learning as I go.
I’m currently working on a script that distributes cylinders along a curve and scales their height based on their distance from a reference plane. This setup works perfectly.
Now I’d like to replace the cylinder with a bamboo stalk I modeled in Rhino, which I reference using a Geometry component. I want to keep the same behavior:
• The height of each bamboo should match the distance between the curve and the plane
• Bamboos should be placed along the curve
• Each bamboo should be scaled in height accordingly, just like the cylinders
I’ve tried using Scale NU, Bounding Box, Distance, etc., but it’s not behaving the way I expected.
I’m attaching:
• A screenshot of the version that works.
What’s the correct way to make this substitution while preserving the scaling logic?
I apoligize, i may have misunderstood the previous message. I’m now attaching the Grasshopper file related to the image i posted earlier. 2.gh (13.7 KB)
when Surface and Curve are Not in parallel planes : should the bamboos still be normal to the surface or to the curve or still in z…
would you still ask for the distance in z or for the closest point?..
Unfortunately I can’t open your file — I think it was created with a newer version of Rhino than mine (I’m using Rhino 7).
Actually, the distances will vary, because my idea is to manually rotate the plane in Rhino. That way, the bamboo heights will change depending on how I move the plane along the Z axis.
I’ve been able to make this work using a simple cylinder created directly in Grasshopper. But when I try to use a more complex geometry — like a bamboo stalk modeled in Rhino — it no longer works, since the cylinder and the Rhino geometry don’t have the same kind of inputs. That’s where I’m stuck.
I tried your script and I’m attaching a picture of the result: the plane behaves exactly as I intended.
However, my issue is that along the curve, instead of my bamboo stalks, there are cylinders. I’m probably doing something wrong.
The white group creates the bamboo by revolving a curve.
A plane is used instead of a surface. This creates a slight difference because Project to Planeuses the plane’s Z vector instead of “normal” Z.
The GH file is much smaller. It’s still relatively slow to render (not seen in the profiler) because of the detail in the bamboo geometry, which is completely lost at this scale. The original bamboo geometry was a “Closed Brep” with thickness, so was worse.