Cycloid Curves with Rhino Python

Studied earlier in Grasshopper here, creating a cycloid-like curve actually mimics the physical process of rotating disks on a path. Below is a test in Rhino Python.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Drawing Cycloid-like Curves
# 07.08.2017 www.designcoding.net - Tugrul Yazar
import rhinoscriptsyntax as rs
curv = rs.GetObject("Select curve")
qual = rs.GetInteger("Quality",100)
radi = rs.GetReal("a radius",4)
radi2 = rs.GetReal("Circle radius",4)
cua = rs.OffsetCurve(curv,[1,1,0],radi2)
cevre = 2 * 3.1415 * radi
mimi = []
for i in range(0,qual):
    ming = i / qual
    momo = rs.CurveParameter(cua,ming)
    deto = rs.EvaluateCurve(cua,momo)
    geto = rs.AddCircle(deto,radi2)
    angle = (360 * momo) / cevre
    gogo = rs.RotateObject(geto,deto,angle)
    mimi.append(rs.CurveStartPoint(gogo))
    rs.DeleteObject(geto)
rs.AddInterpCurve(mimi)
rs.DeleteObject(cua)

 

«
»