Functions 02.18.16 – David Aldana

 

import rhinoscriptsyntax as rs

def makeAFoundation(x0, y0, z0, ydiv, zdiv, dis):
“””make a foundation box geometry
input parameters:
1. x0,number
2. y0,number
3. z0,number
4. ydiv,number
5. zdiv,number
6.dis,number, the base x distance
output:None
Author: David
Date: Feb. 5, 2016
“””

#initial parameters
xdis = x0 + 20
ydiv = 2
zdiv = 4
ydis = xdis/ydiv
zdis = xdis/zdiv – 3

#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):
#extract point coordinates
x0 = input1[0]
y0 = input1[1]
z0 = input1[2]
#set core parameters
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):
#extract point coordinates
x0 = input1[0]
y0 = input1[1]
z0 = input1[2]
#set core parameters
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):
#extract point coordinates
x0 = input1[0]
y0 = input1[1]
z0 = input1[2]
#set core parameters
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):
#extract point coordinates
x0 = input1[0]
y0 = input1[1]
z0 = input1[2]
#set core parameters
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():
#initial parameters
x1 = 24
x2 = 4
y1 = 12
y2 = 2
z1 = 12
z2 = 14
#bottom 4 corner points
p0 = x1, y1, z1
p1 = x2, y1, z1
p2 = x2, y2, z1
p3 = x1, y2, z1

#top 4 corner points
p4 = x1, y1, z2
p5 = x2, y1, z2
p6 = x2, y2, z2
p7 = x1, y2, z2
corners = p0, p1, p2, p3, p4, p5, p6, p7
boxID = rs.AddBox(corners)
output = p4,p5,p6,p7
return output

def makeaWindow():
#initial parameters
x1 = 5
x2 = 23
y1 = 2.25
y2 = 2.70
z1 = 3
z2 = 12
#bottom 4 corner points
p0 = x1, y1, z1
p1 = x2, y1, z1
p2 = x2, y2, z1
p3 = x1, y2, z1

#top 4 corner points
p4 = x1, y1, z2
p5 = x2, y1, z2
p6 = x2, y2, z2
p7 = x1, y2, z2
corners = p0, p1, p2, p3, p4, p5, p6, p7
boxID = rs.AddBox(corners)
output = p4,p5,p6,p7
return output

def makeaWindow1():
#initial parameters
x3 = 23.70
x4 = 23.20
y3 = 3
y4 = 11
z3 = 3
z4 = 12
#bottom 4 corner points
p0 = x3, y3, z3
p1 = x4, y3, z3
p2 = x4, y4, z3
p3 = x3, y3, z3

#top 4 corner points
p4 = x3, y3, z4
p5 = x4, y3, z4
p6 = x4, y4, z4
p7 = x3, y4, z4
corners = p0, p1, p2, p3, p4, p5, p6, p7
boxID = rs.AddBox(corners)
output = p4,p5,p6,p7
return output
def makeWindows():
makeaWindow()
makeaWindow()
makeaWindow()
makeaWindow()

def makeaHouse():
op1 = makeAFoundation(4,2,0, 2, 4, 15)
print op1
makeColumns(op1)
makeARoof()
makeWindows()
makeaHouse()

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