Input/Output Code – Kalil Mella

democode.PNG

</pre>
<pre>import rhinoscriptsyntax as rs
def makeAFoundation(x0,y0,z0,ydiv,zdiv,dis):
 """make a foundation box geometry
 input parameters:
 1.x0, number
 2.x0, number
 3.zo, number
 4.ydiv, number
 5.zdiv, number
 6.dis, number
 output None
 Author: Kalil Mella
 Date: Feb. 5 2016
 """
 #initial parameters
 xdis=x0+dis
 ydis=xdis/ydiv
 zdis=xdis/zdiv
 # bottom 4 corner points
 p0=(x0,y0,z0)
 p1=(xdis,y0,z0)
 p2=(xdis,ydis,z0)
 p3= (x0,ydis,z0)
 # top 4 corner points
 p4=(x0,y0,zdis)
 p5=(xdis,y0,zdis)
 p6=(xdis,ydis,zdis)
 p7=(x0,ydis,zdis)

 corners = p0,p1,p2,p3,p4,p5,p6,p7
 boxID = rs.AddBox(corners)

 output = p4,p5,p6,p7
 return output

def makeacolumn0(input1):
 x0=input1[0]
 y0=input1[1]
 z0=input1[2]

 dis=1
 xdis= x0 + dis
 ydis= y0 + dis
 zdis= 12
 # bottom 4 corner points
 p0=(x0,y0,z0)
 p1=(xdis,y0,z0)
 p2=(xdis,ydis,z0)
 p3= (x0,ydis,z0)
 # top 4 corner points
 p4=(x0,y0,zdis)
 p5=(xdis,y0,zdis)
 p6=(xdis,ydis,zdis)
 p7=(x0,ydis,zdis)

 corners = p0,p1,p2,p3,p4,p5,p6,p7
 boxID = rs.AddBox(corners)
 output = p4,p5,p6,p7
 return output
def makeacolumn1(input1):
 x0=input1[0]
 y0=input1[1]
 z0=input1[2]

 dis=1
 xdis= x0 - dis
 ydis= y0 + dis
 zdis= 12
 # bottom 4 corner points
 p0=(x0,y0,z0)
 p1=(xdis,y0,z0)
 p2=(xdis,ydis,z0)
 p3= (x0,ydis,z0)
 # top 4 corner points
 p4=(x0,y0,zdis)
 p5=(xdis,y0,zdis)
 p6=(xdis,ydis,zdis)
 p7=(x0,ydis,zdis)

 corners = p0,p1,p2,p3,p4,p5,p6,p7
 boxID = rs.AddBox(corners)
 output = p4,p5,p6,p7
 return output
def makeacolumn2(input1):
 x0=input1[0]
 y0=input1[1]
 z0=input1[2]

 dis=1
 xdis= x0 - dis
 ydis= y0 - dis
 zdis= 12
 # bottom 4 corner points
 p0=(x0,y0,z0)
 p1=(xdis,y0,z0)
 p2=(xdis,ydis,z0)
 p3= (x0,ydis,z0)
 # top 4 corner points
 p4=(x0,y0,zdis)
 p5=(xdis,y0,zdis)
 p6=(xdis,ydis,zdis)
 p7=(x0,ydis,zdis)

 corners = p0,p1,p2,p3,p4,p5,p6,p7
 boxID = rs.AddBox(corners)
 output = p4,p5,p6,p7
 return output
def makeacolumn3(input1):
 x0=input1[0]
 y0=input1[1]
 z0=input1[2]

 dis=1
 xdis= x0 + dis
 ydis= y0 - dis
 zdis= 12
 # bottom 4 corner points
 p0=(x0,y0,z0)
 p1=(xdis,y0,z0)
 p2=(xdis,ydis,z0)
 p3= (x0,ydis,z0)
 # top 4 corner points
 p4=(x0,y0,zdis)
 p5=(xdis,y0,zdis)
 p6=(xdis,ydis,zdis)
 p7=(x0,ydis,zdis)

 corners = p0,p1,p2,p3,p4,p5,p6,p7
 boxID = rs.AddBox(corners)
 output = p4,p5,p6,p7
 return output
def makeColumns(input1):
 p0=input1[0]
 p1=input1[1]
 p2=input1[2]
 p3=input1[3]
 makeacolumn0(p0)
 makeacolumn1(p1)
 makeacolumn2(p2)
 makeacolumn3(p3)
def makeaRoof():
 x1=19
 x2=4
 y1=2
 y2=9.5
 z1=12.5
 z2=z1+8.5
 z3=z2-6.5
 
 # bottom 4 corner points
 p4=(x1,y1,12)
 p5=(x1,y2,12)
 p6=(x2,y2,12)
 p7=(x2,y1,12)
 # top 4 corner points
 p8=(x1,y1,z1)
 p9=(x1,y2,z1)
 p10=(x2,y2,z3)
 p11=(x2,y1,z2)

 corners = p4,p5,p6,p7,p8,p9,p10,p11
 boxID = rs.AddBox(corners)
 
def makeawall0():
 x1=19
 x2=4
 y1=8.5
 y2=9.5
 z1=4.75
 z2=12
 
 # bottom 4 corner points
 p4=(x1,y1,z1)
 p5=(x1,y2,z1)
 p6=(x2,y2,z1)
 p7=(x2,y1,z1)
 # top 4 corner points
 p8=(x1,y1,z2)
 p9=(x1,y2,z2)
 p10=(x2,y2,z2)
 p11=(x2,y1,z2)

 corners = p4,p5,p6,p7,p8,p9,p10,p11
 boxID = rs.AddBox(corners)
 
def makeWalls():
 pass
def makeaHouse():
 op1=makeAFoundation(4,2,0,2,4,15)
 print op1
 op2=makeColumns(op1)
 print op2
 makeaRoof()
 makeWalls()
makeaHouse()</pre>
<pre>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s