Curves on multiple surfaces using Grasshopper



Hello all,

I’m trying to create curves on multiple surfaces using Grasshopper, but the “Curve on surface” component in Grasshopper doesn’t work as I expected. UV points are organized to work on grafted surfaces as shown in the screenshot, but Curve on surface component generates most of curves in the last surface instead of distributing them on multiple surfaces appropriately.

The current result is like this image.

The result I’m expecting is similar to the image below.

Would there be ways to resolve this issue or alternative ways?
Thank you in advance!


(David Rutten) #2

Yup, the first set of UV points is matched up with the first surface. The second set of UV points is matched up with the second surface. The third set is matched up with the third surface, and from there the third surface gets re-used since there is no fourth surface.

You will have to repeat your surfaces as many times as you want to draw curves on them. You can either use the Repeat Data component with a value of 5, or do some algebra if the number of repeats is variable. Other possible approaches involve using the Longest List component, which is designed for this kind of problem, but it’s going to involve some juggling because you’re actually comparing lists of lists, which makes it more complex.

Let’s go for Repeat. Currently your three surfaces are stored in a data tree of three branches, like so \{\{A\},\{B\}, \{C\}\}. When you run this data tree through a repeat=5 component, you’ll end up with the following structure: \{\{\underbrace{A,A,A,A,A}_5\},\{\underbrace{B,B,B,B,B}_5\}, \{\underbrace{C,C,C,C,C}_5\}\}.

This is only halfway there, you have to make sure that your surface tree has the same layout as your uv-coordinate tree. In this particular case, you can just graft the surface tree, which results in \{\{A\},\{A\},\{A\},\{A\},\{A\},\{B\},\{B\},\{B\},\{B\},\{B\},\{C\},\{C\},\{C\},\{C\},\{C\}\}


David, thank you very much for your quick response!
I thought I knew enough about the data tree problems, but I was wrong…it’s great I learned another trick today.
I was thinking about looping the process using Anemone without knowing the use of Repeat data for this kind of case.