Grasshopper Array Geometry or closed curve along 2 curves

Shape Array on 2 lines.3dm (55.5 KB)
Shape Array on 2 lines.gh (17.1 KB)


Hello there,

I am new to grasshopper, I was trying to array a geometry or curve along 2 curves, one is flat and the other is wavy, I was able to create lines or pipes alone the 2 curves but whenever I try to use a geometry or a curve or even a curve created in grasshopper the array goes all over the place.

I am sure there is something I am doing wrong so please help me solve this issue and learn from it.

Figure 1. is the lines along 2 curves
Figure 2 . is my miserable attempt to use geometry to closed curve.

PS, I tried to use method 1 with my curve and results were a mess

Thank you

if you hover the mouse arrow over an input, it will give you info about what kind of data that input expects to collect

image

here, the N input wants an integer number that represents the number of elements you want to distribute along the curve: by connecting there a curve instead of an integer number, the component takes the length of the curve as input value, which is in this case is 829, and tries to distribute 829 of your base geometry along the curve C

the other thing is about curve direction: it looks like your curve start point is on the opposite side than your geometry, by flipping the curve you get a better result


Shape Array on 2 lines_Re.gh (6.8 KB)

1 Like

Thanks you Inno, that was really clear, I understand now the basic logic.

One last question If I may bother you, is there is any way to array a geometry using 2 paths ?, now you can notice that the geometry is correctly arrayed from the top but the bottom is offset and going in an irregular manner?

Thank you so much for the quick and helpful replay

Kind Regards

the reason why that happens is the following:

in a Curve Array the Geometry input is arrayed along a number (N) of perpendicular frames (planes) generated along the curve (C), using the very first frame (plane) as reference position of the Geometry

in this case the Geometry is diagonal to the refence plane, so it will stay diagonal also for all the other ones :slight_smile:

what I would do to simplify things, is to generate the Curve Array using the bottom curve:

if you also want 1-D scaling effect in such a way the head of the Geometry always lands on the top curve, there are almost infinite ways you can get there, this is one among the many (and not necessarily the best one):


Shape Array on 2 lines_ReRe.gh (15.7 KB)

here from each division point on the bottom curve we generate a vertical line and find its intersection point with the top curve:

this way we end up with lines which represent the “height” of our geometry:

and use this list of different lengths to scale down each single Geometry in the array:


Shape Array on 2 lines_ReReRe.gh (18.4 KB)


why didn’t we just use “divide curve” on both curves, like in your first example, instead of generating vertical lines and intersecting them with the top curve? :slight_smile:

because the top curve is not planar, which means it has different length than the bottom one, so its division points would not create “perfect vertical” lines: first and last lines would for sure be perfect vertical, everything else might not :+1:

1 Like

Thank you for the detailed explanation, It was exactly what am looking for, I have to study your notes a bit as I got lost in some nodes, but its pretty clear :slight_smile:

Thank you again