import rhinoscriptsyntax as rs import random as ran import flipped_classroom_lib as fc #reload(fc) rs.DeleteObjects(rs.AllObjects()) rs.EnableRedraw(False) length=10 thick=0.5 height=12 door_width = 2 door_height = 5 box=fc.make_box((thick/2,-length/2,0),xsize=length,ysize=thick,zsize=height) for i in range(4): rs.RotateObject(box,(0,0,0),90*i,copy=True) door=fc.make_box((length/2-door_width/2,-thick/2,0),xsize=door_width, ysize=thick, zsize=door_height) result=rs.BooleanDifference(box, door) for i in range(4): rs.RotateObject(result,(0,0,0),90*i,copy=True) crv=rs.AddRectangle((-length/2,-length/2,0),length,length) crv2=rs.OffsetCurve(crv,(20,0,0),1.5) pt=rs.DivideCurve(crv2,23*4) i=0 exclude_indices = {5, 6, 7, 16, 17, 18, 28, 29, 30, 39, 40, 41, 51, 52, 53, 62, 63, 64, 74, 75, 76, 85, 86, 87} for i, p in enumerate(pt): if i not in exclude_indices: x, y, _ = p fc.make_box((x, y, height-2), 0.15, 0.15, 1.5) # Box auf z=10 setzen i=i+1 include_indices = {8, 9, 10, 11, 12, 13, 14, 15, 31, 32, 33, 34, 35, 36, 37, 38, 54, 55, 56, 57, 58, 59, 60, 61, 77, 78, 79, 80, 81, 82, 83, 84} for i, p in enumerate(pt): if i in include_indices: x, y, _ = p fc.make_box((x, y, height-4), 0.15, 0.15, 1.5) # Box auf z=8 setzen i=i+1