import rhinoscriptsyntax as rs import random as ran import fantastic_stairs_lib as fs reload(fs) # delete everything, start from scratch rs.DeleteObjects(rs.AllObjects()) whereto = [0,5,5] angle = 15 ''' (box1, line1) = fs.make_box_wline([0,0,0], 1.2, 1.2, 0.2, 1) (box2, line2) = fs.make_box_wline(whereto, 1.2, 1.2, 0.2, 1) rs.RotateObjects([box2, line2], whereto, angle, [0,0,1]) curve = fs.blend_curves(line1, line2,1) (st_crv, tothgt) = fs.curve_to_stairline(curve) len_c = rs.CurveLength(st_crv) (steps,th) = fs.calculate_steps_height(tothgt) An=0 tt = (len_c-An)/steps if tt>0.32: tt=fs.tt P =steps/2 P = 4 pod_l=fs.calculate_podlen(len_c, tt, steps, P, An) print "stair values (length, tread height, tread depth, steps", len_c, th, tt, steps fs.make_curved_podeststair(st_crv, steps=steps,th=th, tt=tt, pod_l=pod_l, P=P, An=An, DC=steps+1, s_width=1.2) ''' #spirale with columns curve = fs.make_random_spiral(30,40,20) len_c= rs.CurveLength(curve) An=0 P=4 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 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.2) i = i+1 len_fromstart += P*fs.tt+fs.pod_l + fs.tt rs.EnableRedraw(True)