# Grasshopper --> Dynamo, Array geometry along the curve

Hi there!
I am a complete rookie to Dynamo and I have been trying to start learning according to what I know in Grasshopper.
I’m working on a model which I have already previously done in Grasshopper and trying to mimic it in Dynamo.

I seem to have a problem figuring out how to array geometry along the curve, in grasshopper I normally use Cross Reference and Rotate(geometry) functions when there is more than one line. How do you do this in Dynamo?

Cheers!

Try Geometry.Rotate.

@sandra.petkute Your task mostly involves list management of the points on the curves.
See if this helps …
CurvePointsGrouping.dyn (17.2 KB)

2 Likes

That was just for building my initial geometry. The important node is Geometry.Rotate. You should be able to take your “V” curves and rotating them about the center of your geometry the appropriate number of times.

Since you already have all the points needed for your additional “V” curves, you can do what Vikram seems to be suggesting and manage your list of points to draw new curves - something like getting every other point from the upper curve and connecting it to every point on the bottom curve (with a little more list management.)

If you can post your graph I can take a look at it.

I still think it’s easiest to rotate your geometry. You just need the initial list of geometry to copy and either the degrees of rotation or the number of copies you’ll need created.

But you can also build the geometry from your list of points. It’s not so bad once you get the “math” right. (It’s mostly counting really.)

EDIT: You might have to do a little bit of cleanup for duplicate geometries. The warnings are from a null value because I counted backwards in this case; it would have been a duplicate anyway so it’s fine and the script still runs, just an fyi.

Hi Guys!

Thank you so much for your responses, it definitely helped to solve the task and to get a better idea about how list managing works. I ended up applying @Vikram_Subbaiah method and it worked just fine!

By the way, is it not too much to ask, could please give me an idea how to divide a surface into grid similar to the model I have in Grasshopper?

1 Like

This could help to get started on “how to divide a surface into grid”:
http://dynamobim.org/forums/topic/divided-surface-by-intersection/

1 Like

@sandra.petkute This could serve as a guide …
Not the most efficient. There is scope for improvement

n = 61;

p = Point.ByCoordinates({-1000, -750, -200, -150}, 0, {0, 250, 400, 450});
ns = Surface.ByRevolve(NurbsCurve.ByControlPoints(p, 2),
Point.Origin(), Vector.ZAxis(), 0, 360);
il = ns.GetIsoline(1, {0, 0.075, 0.15, 0.2, 0.35, 0.5, 0.65, 0.8, 1});

il1 = List.DropItems(il,3);
pn1 = il1<1>.PointAtParameter((0..1..#n)<2>);
il2 = List.TakeItems(il,3);
pn2 = il2<1>.PointAtParameter((0..1..#(n*2)-1)<2>);

ln1 = Line.ByStartPointEndPoint(pn1[4],pn1[5]);
pn3 = pn1[0..4];
pn4 = List.ShiftIndices(pn1[1..4]<1>,1);
pn5 = List.ShiftIndices(pn1[1..4]<1>,-1);
ln2 = List.DropItems(Line.ByStartPointEndPoint(pn3,pn4)<1>,1);
ln3 = List.DropItems(Line.ByStartPointEndPoint(pn3,pn5)<1>,-1);
pn6 = List.DropItems(List.Sublists(pn1[0],0..3,3),-1);
pn7 = List.TakeEveryNthItem(List.ShiftIndices(pn2[2],-3),6,1);
ln4 = Line.ByStartPointEndPoint(pn6,pn7);
pn8 = List.TakeEveryNthItem(pn2[1],6,1);
pn9 = List.ShiftIndices(pn8,-1);
ln5 = List.DropItems(Line.ByStartPointEndPoint(pn7,pn8),-1);
ln6 = List.DropItems(Line.ByStartPointEndPoint(pn7,pn9),-1);
p10 = List.TakeEveryNthItem(pn2[0],6,1);
ln7 = Line.ByStartPointEndPoint(pn8,p10);

{il1,ln1,ln2,ln3,ln4,ln5,ln6,ln7};
1 Like