Catenary
1
p1 = Point.ByCoordinates(7,8,25).Translate(Vector.YAxis(),0..50..10);
2
p2 = Point.ByCoordinates(50,-5,20).Translate(Vector.YAxis(),0..50..10);
3
a = 10..50..#6;
4
l=Line.ByStartPointEndPoint(p1,p2);
5
x=(-l.Length/2)..(l.Length/2)..0.1;
6
z=a*Math.Cosh(x/a);
7
p3=Point.ByCoordinates(x,0,z);
8
p4=p3.Translate(Vector.ZAxis(),-List.FirstItem(p3<1>).Z);
9
10
or=l.PointAtParameter(0.5);
11
vx=Vector.ByTwoPoints(or,l.PointAtParameter(1));
12
vy=Vector.ByTwoPoints(or,or.Translate(Vector.YAxis(),1));
13
cs=CoordinateSystem.ByOriginVectors(or,vx,vy);
14
p5=p4.Transform(cs);
15
ct=NurbsCurve.ByPoints(p5);
16
[p1,p2,ct];
Copied!
Last modified 1yr ago
Copy link