Polyline to PolyArc
Convert a series of lines to a series of tangential arcs
1
def lnToAr(pl:var[]..[], of:double)
2
{
3
pc1 = List.FirstItem(pl.Curves());
4
//First Arc
5
ac1 = List.FirstItem(pc1);
6
ac2 = ac1.Offset(of).PointAtParameter(0.5);
7
ar1 = Arc.ByThreePoints(ac1.StartPoint,ac2,ac1.EndPoint);
8
ac3 = List.RestOfItems(pc1);
9
10
ar5 = [Imperative]
11
{
12
cnt = 1;
13
pc2 = [ar1];
14
15
for (cr in ac3)
16
{
17
pc2[cnt] = Arc.ByStartPointEndPointStartTangent(cr.StartPoint,cr.EndPoint,ar1.TangentAtParameter(1));
18
ar1 = pc2[cnt];
19
cnt = cnt + 1;
20
}
21
return pc2;
22
}
23
return ar5;
Copied!
Last modified 6mo ago
Copy link