#DM2 - hue11 - PARCO DORA, TURINO - final submission #Gruppe Hirschberg 3 #Raphael Wieser - Stand: 16.03.2025 ############################################################################### #general setup ############################################################################### import rhinoscriptsyntax as rs import random as ran import fantastic_stairs_lib as fs import flipped_classroom_lib as fc rs.DeleteObjects(rs.AllObjects()) rs.EnableRedraw(0) #disables the live view of the code execution ############################################################################### #INPUT RASTER ############################################################################### A=3 #numberofcolumns in x-direction #testet up to 5 #A needs to be a minimum of 2 B=10 #numberofcolumns in y-direction #testet up to 10 rastery=15 #spacebetween columns in x rasterx=35 #spacebetween columns in y ############################################################################### #INPUT COLUMN ############################################################################### xcol = 2 #length column in x ycol = 0.4 #length column in y zcol = 17 #hlength column in z tsheet = 0.04 #thickness of columns steel sheets hbase = tsheet*2 #thickness of columns sbaseplate #numberofbulks #have to be full numbers xbulk=2 #number of bulk metal sheets in x-direction #PROVISORIUM #bulk=zcol/0.4 #number of bulk metal sheets in z-direction ############################################################################### #INPUT PRIMARY TRUSS & ROOFING ############################################################################### spann=rasterx trusstype=2 #trusstype "1" or "2" #type 1 - rectangular truss #type 2 - truss with triangular top fieldsx=6 #subdivisions of truss - need to be multiple of 2 fieldsy=4 #numberoftrusses in y-direction #testedupto5 factor_h=1.5 #only for type 2 - factor for heightening the middle of the truss beamx=0.4 #max width of beam part beamz=0.4 #max thickness of beam part coveringz=0.15 #thickness of roof covering ############################################################################### #INPUT SECONDARY TRUSS & ROOFING ############################################################################### spann2=rastery fieldsx2=4 #subdivisions of truss #ATTENTION! need to be multiple of 2 beamx2=0.3 #max width of beam part beamz2=0.2 #max thickness of beam part hmin2=spann2/fieldsx*1.5 ############################################################################### #INPUT FOUNDATIONPLATE ############################################################################### h_fdtplate=0.5 h_fdtreinf=1.5 ############################################################################### #TRUSS DERIVED VALUES hmin=spann/12 #minimumheight of truss if fieldsx%2==0: xdiv=fieldsx #divide by even number in x-direction else: print "ERROR please insert a number divideable by 2 as fieldsx)" exit() hmin=round(hmin,1) #round up to 1 decimal print "A", A, "rasterx", rasterx, "m" print "B", B, "rastery", rastery, "m" print "spann", spann #DEBUG print "hmin", hmin print "trusstype", trusstype ############################################################################### #PROGRAMM EXECUTION ############################################################################### ##################################################################### #CREATE COLUMNS ##################################################################### #define functions def make_box(insertion=[0,0,0], xsize=10, ysize=10, zsize=10): #by giving default values in the bracket when definening the func instead of #lower down you can only give the first value when executing the func #setup corners list corners = [ [0,0,0],[xsize,0,0],[xsize,ysize,0],[0,ysize,0], [0,0,zsize],[xsize,0,zsize],[xsize,ysize,zsize],[0,ysize,zsize] ] box=rs.AddBox(corners) rs.MoveObject(box, (-xsize/2,-ysize/2,0)) #moves object to center of insert point rs.MoveObject(box, insertion) return box ##################################################################### l_column=[] #create empty list #generate vertical sheetmetal #mainsheetvertical +x cord1=[(-xcol/2),0,hbase] side1=make_box(cord1, xsize=tsheet, ysize=ycol, zsize=zcol) l_column.append(side1) #mainsheetvertical -x cord2=[(+xcol/2),0,(hbase)] side2=make_box(cord2, xsize=tsheet, ysize=ycol, zsize=zcol) l_column.append(side2) #generate vertical bulks for i in range(xbulk): cord3=[-xcol/2+xcol/xbulk*i,0,hbase] mid1=make_box(cord3, xsize=tsheet/2, ysize=ycol-(ycol*2/10), zsize=zcol) l_column.append(mid1) #generate vertical centersheet cord4=[0,0,(hbase)] cent1=make_box(cord4,xsize=xcol, ysize=tsheet, zsize=zcol) l_column.append(cent1) #generate horizontal sheetmetal #generate baseplate basepl=make_box(xsize=xcol+xcol*2/10, ysize=ycol+ycol*2/10, zsize=hbase) l_column.append(basepl) #generate horizontal bulk for i in range(zcol*2-1): stepheight=zcol/(zcol*2) cord4=[0, 0, hbase+stepheight*(1+i)] bulk=make_box(cord4, xsize=xcol-tsheet, ysize=ycol, zsize=tsheet) l_column.append(bulk) #generate topplate cord5=[0,0,(hbase+zcol)] toppl=make_box(cord5,xsize=xcol+tsheet, ysize=ycol, zsize=tsheet) l_column.append(toppl) column1=rs.BooleanUnion(l_column,True) #copy columns columnrowy=[] for i in range(A): columnrowy.append( rs.CopyObject(column1,(rasterx*i,0,0)) ) for i in range(B): rs.CopyObject(columnrowy,(0,rastery*i,0)) ##################################################################### #CREATE TRUSSES ##################################################################### #setup vectors for rotating objects vecx=rs.VectorAdd((0,0,0),(1,0,0)) vecy=rs.VectorAdd((0,0,0),(0,1,0)) vecz=rs.VectorAdd((0,0,0),(0,0,1)) #################################################################### TYPE2 if trusstype==1: ### GEOMETRY INPUT### quad = [[0,0,0],[spann,0,0],[spann,0,hmin],[0,0,hmin]] P0,P1,P2,P3 = rs.AddPoints(quad) L0=rs.AddLine(P0,P1) L1=rs.AddLine(P1,P2) L2=rs.AddLine(P3,P2) L3=rs.AddLine(P0,P3) ##################################################################### #define functions def make_beam(dimy, dimz, path,insertion = (0,0,0),rotation=0,axis=None): beamoutline=rs.AddPolyline( ([0,0,0], [0,dimy,0], [0,dimy,dimz], [0,0,dimz],[0,0,0])) rs.MoveObject(beamoutline,insertion) rs.MoveObject(beamoutline,(0,-dimy/2,-dimz/2)) beam=rs.ExtrudeCurve(beamoutline,path) rs.CapPlanarHoles(beam) rs.RotateObject(beam,insertion,rotation,axis) rs.DeleteObject(beamoutline) return(beam) #end def make_vbeam(dimy, dimz, path,insertion = (0,0,0),rotation=0,axis1=-vecy,axis2=-vecz): beamoutline=rs.AddPolyline( ([0,0,0], [0,dimy,0], [0,dimy,dimz], [0,0,dimz],[0,0,0])) rs.MoveObject(beamoutline,insertion) rs.MoveObject(beamoutline,(0,-dimy/2,-dimz/2)) rs.RotateObject(beamoutline,insertion,rotation,axis1) rs.RotateObject(beamoutline,insertion,rotation,axis2) beam=rs.ExtrudeCurve(beamoutline,path) rs.CapPlanarHoles(beam) rs.DeleteObject(beamoutline) return(beam) #end ##################################################################### l_truss=[] #create empty list #create truss untergurt = make_beam(beamx,beamz/2,L0,P0) l_truss.append(untergurt) obergurt = make_beam(beamx,beamz,L2,P3) l_truss.append(obergurt) #createoutermost vertical vertikalgurt=make_vbeam(beamx/2,beamx, L3, P0, 90,) l_truss.append(vertikalgurt) rs.MoveObject(vertikalgurt,(beamx/2/2,0,0)) vertikalgurt=make_vbeam(beamx/2,beamx, L3, P1, 90,) l_truss.append(vertikalgurt) rs.MoveObject(vertikalgurt,(-beamx/2/2,0,0)) #create other verticals for i in range(xdiv-1): vertikalgurt=make_vbeam(beamx/4,beamx, L3, P0, 90,) l_truss.append(vertikalgurt) #rs.MoveObject(vertikalgurt,(beamx/4,0)) vdist=spann/xdiv rs.MoveObject(vertikalgurt,(vdist+vdist*i,0,0)) # ##create diagonals # diagonals=[] #create empty list for diagonals #for i in range(xdiv): # Upoints=rs.DivideCurve(L0,xdiv) # Opoints=rs.DivideCurve(L2,xdiv) # pipeline=diagonalline=rs.AddLine(Upoints[i],Opoints[i+1]) # pipe=rs.AddPipe(pipeline,0,beamz/10,cap=1) # rs.MoveObject(pipe,(0,-beamz/20,0)) # diagonals.append(pipe) #create diagonals diagonals=[] #create empty list for diagonals Upoints=rs.DivideCurve(L0,xdiv) Opoints=rs.DivideCurve(L2,xdiv) i=0 while i