import rhinoscriptsyntax as rs import random as ran import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) import fantastic_stairs_lib as fs reload(fs) # delete everything and start from scratch rs.DeleteObjects(rs.AllObjects()) rs.EnableRedraw(False) # function to create a clover form p_num = 18 radius = 14 angle = 40 translation = [0, 0, 0] curve = fs.make_clover_nsc(p_num=p_num, radius=radius, angle=angle, translation=translation) # function to create stairs len_c = rs.CurveLength(curve) An = 0 P = 8 mods = (len_c - An) / (P * fs.tt + fs.pod_l + fs.tt) steps = int(mods * P) + 1 fs.make_curved_podeststair(curve, steps=steps, pod_l=fs.pod_l, DC=steps + 1, P=P, An=An) # function to create pipes i = 1 len_fromstart = An + P * fs.tt + fs.pod_l / 2 while len_fromstart <= len_c: point = rs.CurveArcLengthPoint(curve, len_fromstart) m_l = rs.AddLine(point, [point[0], point[1], i * P * fs.th - fs.thick]) rs.AddPipe(m_l, 0, 0.6) i += 1 len_fromstart += P * fs.tt + fs.pod_l + fs.tt # delete curve rs.DeleteObject(curve) rs.EnableRedraw(True)