import rhinoscriptsyntax as rs import random as ran import fantastic_stairs_lib as fs rs.DeleteObjects(rs.AllObjects()) rs.EnableRedraw(False) #####2 Podeste mit Linien kreiren und drehen##### whereto = [0,5,7] angle = 40 (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]) """ #####2 Linien von den Podesten verbinden --> eckig##### pts1 = rs.CurvePoints(line1) pts2 = rs.CurvePoints(line2) rs.AddLine(pts1[1],pts2[1]) """ #####2 Linien von den Podesten verbinden --> rund##### curve = fs.blend_curves(line1, line2, 2) (st_crv, tothgt) = fs.curve_to_stairline(curve) #####stufen ausrechnen##### len_c = rs.CurveLength(st_crv) """ ###variante 1### steps = int(len_c / fs.tt) tt = len_c/steps th = tothgt/steps ###variante 2### steps = int(tothgt/fs.th) th = tothgt/steps tt = len_c/steps print "stair values (length, tread height, tread depth, steps", len_c, th, tt, steps """ (steps,th) = fs.calculate_steps_height(tothgt) An = 2 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) fs.make_curved_podeststair(st_crv, steps=steps, th=th, tt=tt, P=P, An=An, DC=steps+1, s_width=1.2, pod_l=pod_l)