Array along Curve
1
n = 61;
2
3
p = Point.ByCoordinates({-1000, -750, -200, -150}, 0, {0, 250, 400, 450});
4
ns = Surface.ByRevolve(NurbsCurve.ByControlPoints(p, 2),
5
Point.Origin(), Vector.ZAxis(), 0, 360);
6
il = ns.GetIsoline(1, {0, 0.075, 0.15, 0.2, 0.35, 0.5, 0.65, 0.8, 1});
7
8
il1 = List.DropItems(il,3);
9
pn1 = il1<1>.PointAtParameter((0..1..#n)<2>);
10
il2 = List.TakeItems(il,3);
11
pn2 = il2<1>.PointAtParameter((0..1..#(n*2)-1)<2>);
12
13
ln1 = Line.ByStartPointEndPoint(pn1[4],pn1[5]);
14
pn3 = pn1[0..4];
15
pn4 = List.ShiftIndices(pn1[1..4]<1>,1);
16
pn5 = List.ShiftIndices(pn1[1..4]<1>,-1);
17
ln2 = List.DropItems(Line.ByStartPointEndPoint(pn3,pn4)<1>,1);
18
ln3 = List.DropItems(Line.ByStartPointEndPoint(pn3,pn5)<1>,-1);
19
pn6 = List.DropItems(List.Sublists(pn1[0],0..3,3),-1);
20
pn7 = List.TakeEveryNthItem(List.ShiftIndices(pn2[2],-3),6,1);
21
ln4 = Line.ByStartPointEndPoint(pn6,pn7);
22
pn8 = List.TakeEveryNthItem(pn2[1],6,1);
23
pn9 = List.ShiftIndices(pn8,-1);
24
ln5 = List.DropItems(Line.ByStartPointEndPoint(pn7,pn8),-1);
25
ln6 = List.DropItems(Line.ByStartPointEndPoint(pn7,pn9),-1);
26
p10 = List.TakeEveryNthItem(pn2[0],6,1);
27
ln7 = Line.ByStartPointEndPoint(pn8,p10);
28
29
{il1,ln1,ln2,ln3,ln4,ln5,ln6,ln7};
Copied!
CurvePointsGrouping.dyn
17KB
Text
Copy link