import rhinoscriptsyntax as rs import random as ran import fantastic_stairs_code_neu as fs #cleanup and start from scratch rs.DeleteObjects(rs.AllObjects()) rs.EnableRedraw(False) pavillon_hgt=3.5 thick_p=0.5 #make staircase with columns (spiral) curve = fs.make_clover(5,5,70) len_c = rs.CurveLength(curve) An=1 P=15 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) i = 1 length_fromstart = An + P*fs.tt + fs.pod_l/2 while (length_fromstart <= len_c): point = rs.CurveArcLengthPoint(curve,length_fromstart) #add point for m_l = rs.AddLine(point, [point[0],point[1],i*P*fs.th-fs.thick]) #add line for column rs.AddPipe(m_l,0,0.2) #add column if i%3 and (i*P*fs.th-fs.thick, fs.pod_l,4,fs.thick)>2: pvl=[] #list for pavillon parts box1=fs.make_box([point[0],point[1],i*P*fs.th-fs.thick],fs.pod_l,4,fs.thick) #floor pavillon pvl.append(box1) pvl.append(rs.CopyObject(box1,[0,0,pavillon_hgt+fs.thick])) #roof pavillon box2=fs.make_box([point[0],point[1]-2+thick_p/2,i*P*fs.th],fs.pod_l,thick_p,pavillon_hgt) #first wall pavillon pvl.append(box2) pvl.append(rs.CopyObject(box2,[0,4-thick_p,0])) #second wall pavillon param=rs.CurveClosestPoint(curve,point) normal=rs.CurveTangent(curve,param) #find tangent of point angle=rs.Angle([0,0,0],normal)[0] #find angle of tangent rs.RotateObjects(pvl,[point[0],point[1],i*P*fs.th-fs.thick],angle, [0,0,1]) #rotate pavillon so it fits the curve i = i + 1 #increase i length_fromstart += P*fs.tt + fs.pod_l + fs.tt #increment length #cleanup rs.Command("_SelCrv _Enter") crvs=rs.SelectedObjects() rs.DeleteObjects(crvs) rs.EnableRedraw(True)