Design Sript contest (3)

The challenge is to reproduce this in design script
I have a few more coming
Have fun

Not sure if it’s possible to do this one with design script because you need to have persistent storage. It can sorta be done with some python tho :slight_smile:

3 Likes

risingTan

a = Dictionary.ValueAtKey(DateTime.Components(d), "second")-1;

x = Math.Tan(280..440..#60);
y = (0..Math.PiTimes2..#60)/5;
yy1 = List.Flatten(List.Transpose([List.OfRepeatedItem(0,60-(1..60)),List.TakeItems(y,(1..60))])<1>,-1);
pt1 = Point.ByCoordinates(x,yy1<1>);
nc1 = NurbsCurve.ByPoints(pt1,1);
nc2 = List.LastItem(nc1).Translate(Vector.YAxis(),List.LastItem(yy1));
nc3 = List.GetItemAtIndex(nc2,a).Translate(Vector.YAxis(),(0..#4..1.3));
nc4 = List.GetItemAtIndex([nc1,nc2]<1>,a);

//Visualization
ln1 = Line.ByStartPointEndPoint(nc1[0].StartPoint,nc1[0].EndPoint);
ln2 = Line.ByStartPointDirectionLength(Point.ByCoordinates(0,-2.5),Vector.YAxis(),9);
pt2 = List.GetItemAtIndex(List.Reverse(pt1<1>),a);
pt3 = List.GetItemAtIndex(pt2,List.IndexOf(Math.Round(pt2.Y,3),0.0));
ln3 = Line.ByStartPointEndPoint(Point.ByCoordinates(0,-1),Point.ByCoordinates(pt3.X)).ExtendStart(1);
ci1 = Circle.ByCenterPointRadius(Point.ByCoordinates(0,-1),1);
ci2 = Circle.ByCenterPointRadius([ln3.StartPoint,ln3.EndPoint],0.1).Patch();
ln4 = ln3.ExtendStart(10);

//Color
cl1 = GeometryColor.ByGeometryColor(ci1,Color.ByARGB(255,0,0,255));
cl2 = GeometryColor.ByGeometryColor(ci2,Color.ByARGB(255,255,0,0));
cl3 = GeometryColor.ByGeometryColor(ln4,Color.ByARGB(255,0,255,0));
cl4 = GeometryColor.ByGeometryColor([ln1,ln2],Color.ByARGB(255,0,255,255));

5 Likes

Great solution, Vikram! Generate all the points in advance and take what you need at each step :slight_smile:

4 Likes