Trammel of Archemedes
Trammel of Archemedes
1
a = Math.Ceiling(Dictionary.ValueAtKey(DateTime.Components(d), "second")*0.58);
2
3
ps1 = 3;
4
xx1 = -5..5..#30;
5
yy1 = Math.Sqrt(ps1*ps1-Math.Pow(xx1,2));
6
sg1 = List.FilterByBoolMask(Math.Sign(xx1),yy1>0)["in"];
7
xx2 = Math.Round(List.FilterByBoolMask(xx1,yy1>0)["in"],6);
8
yy2 = Math.Round(List.FilterByBoolMask(yy1,yy1>0)["in"],6)*sg1;
9
10
pv1 = Point.ByCoordinates(xx2);
11
pv2 = Point.ByCoordinates(0,yy2);
12
ln1 = List.Flatten(Line.ByStartPointEndPoint(pv1,[pv2,List.Reverse(pv2)]<1>),-1);
13
an1 = ln1.ExtendEnd(3).EndPoint.AsVector().AngleAboutAxis(Vector.XAxis(),Vector.ZAxis());
14
ln2 = List.SortByKey(ln1,an1)["sortedList"];
15
ln3 = List.GetItemAtIndex(ln2,a);
16
17
//Solids
18
cl1 = Circle.ByCenterPointRadius(ln3.StartPoint,0.07).ExtrudeAsSolid(Vector.ZAxis(),0.125);
19
cl2 = Circle.ByCenterPointRadius(ln3.EndPoint,0.07).ExtrudeAsSolid(Vector.ZAxis(),0.125);
20
cl3 = Circle.ByCenterPointRadius(ln3.ExtendEnd(4.15).EndPoint,0.1).ExtrudeAsSolid(Vector.ZAxis(),0.15);
21
ln4 = PolyCurve.ByThickeningCurveNormal(ln3.ExtendEnd(4.5).ExtendStart(0.15),0.5,Vector.ZAxis()).ExtrudeAsSolid(Vector.ZAxis(),0.05);
22
rt1 = Rectangle.ByWidthLength(0.75,0.5).Translate(Vector.XAxis(),ln3.StartPoint.X).ExtrudeAsSolid(Vector.ZAxis(),-0.2);
23
rt2 = Rectangle.ByWidthLength(0.5,0.75).Translate(Vector.YAxis(),ln3.EndPoint.Y).ExtrudeAsSolid(Vector.ZAxis(),-0.2);
24
rt3 = Rectangle.ByWidthLength(3,3).Translate([1.75,1.75,-1.75,-1.75],[1.75,-1.75,-1.75,1.75],-0.1).ExtrudeAsSolid(Vector.ZAxis(),-0.1);
25
rt4 = Solid.ByUnion(List.Flatten([rt3,Rectangle.ByWidthLength(6.5,6.5).Translate(0,0,-0.2).ExtrudeAsSolid(Vector.ZAxis(),-0.3)],-1));
26
27
//Color
28
cr1 = GeometryColor.ByGeometryColor(ln4,Color.ByARGB(255,204,102,0));
29
cr2 = GeometryColor.ByGeometryColor([rt1,rt2],Color.ByARGB(255,255,255,0));
30
cr3 = GeometryColor.ByGeometryColor(rt4,Color.ByARGB(255,255,255,200));
31
cr4 = GeometryColor.ByGeometryColor([cl1,cl2,cl3],Color.ByARGB(255,0,255,200));
Copied!
archemedesTrammel.zip
3KB
Binary
Last modified 9mo ago
Copy link