Hello everyone,
I am currently working on the construction of a geometry, a very simple one in comparison with what one would often see on the forum, but since I am using Rhino and Grasshopper for the very first time I am struggling to do what I have in mind. Which is why I am asking you for help.
For context, I’m building a Grasshopper routine to transpose a geological profile (a set of 4 curves representing soil layer interfaces) onto ~40 “offset lines” running parallel to the structure to be built, each representing a cross-section where I need the geology. The “station 0” of the geological profile is taken as the reference point with respect to which the thickness of a soil layer is determined (ex. the thickness of the clayey layer is 5 m at 15 m from the station 0 → this thickness is to be transposed to the “offset lines”).
What I have is the following:
- I have a mesh representing the topography of the site;
- I have the set of lines parallel to the axis of the structure spread across the site;
- And I have the reference geological profile.
The “workflow” in Grashopper for a single offset line is the following:
- To draw the natural ground curve for the line by projecting its control points onto the topography mesh.
- To determine the z-coordinate of each soil layer at the distances associated with the control points of the line. Ex. If the second control point of the line is at 5 meters with respect to its own “station 0” (its first control point), we go and take the z-coordinate of each soil layer at 5 meters from the “station 0” of the geological profile. In order to do this, I created multiple planes that I intersected with the geological curves. The resulting z-coordinate of the intersection is what allows to calculate the thickness of each soil layer.
- Finally comes the intersection (PCX component in the image above) and there is where I think it gets tricky. When I set only one curve, the script works as expected. When I set multiple offsetlines, I don’t really understand what it is doing but it is not the right thing: it doesn’t apply the same instructions to each offset line (project onto mesh → calculate intersections with geological profile based on distances from the station 0, etc). While trying to solve this, I got into the notion of data tree and branches and I have tried to tweak the “graft” and “flatten” option of the inputs/outputs of each component but I can’t get to make the script work for multiple lines.
Could you please help me to solve the problem or point towards documentation on data trees? A simplified version of my Rhino file is attached to this topic, as well as the grasshopper script.
grasshopper_routine.gh (20.3 KB)
geometria_ayuda_forum.3dm (2.5 MB)
Thank you,
Juan Esteban.





