How can I setback a second floor with "push"?

465
2
Jump to solution
10-18-2018 12:26 PM
lorinroser
New Contributor

How can I setback a second floor with "push"?

0 Kudos
1 Solution

Accepted Solutions
KristianMortensen1
New Contributor III

Hello Lorin. 

If I understand you correctly you want to create a building that "steps back", the best way I have found to do that is to create the bottom floor shape, and then move that one up with the "t" function so the code would look something like this: 

attr siy = 0 // floor counter
attr sty = 3 //Number of floors
attr floorHeight = 3 //Floor height
attr setbackDist = 1 //setback distance

@startrule
A01 --> //This code creates a loop that adds new floors until the "sty" is reached.
case siy < sty : A02(siy,sty) set(siy,siy+1) t(0,floorHeight,0) A01
else: A02(siy,sty)

A02(siy,sty) --> //This code takes the top floor and makes it the roof
case siy == sty : setback(setbackDist*siy-1) {front : NIL | remainder : Roof00}
else: A03(siy,sty)

A03(siy,sty) --> //This code creates the setbact of each floor, siy is the floor number where siy = 0 is the bottom floor, and siy = sty is the roof
setback(setbackDist*siy) {front : Balcony(siy,sty) | remainder : A04(siy,sty)}

A04(siy,sty) --> // here is each floor extruded to create a volume.
extrude(floorHeight)
comp(f) {side: Facade | bottom : Floor00}

Balcony(siy,sty) --> //this is the balcony area
setback(setbackDist*siy-1) {front :NIL | remainder: color(1,0,0)Balcony01}

This is maybe not the best code for doing it, but it will get the job done, you can always play around with it to see if you can make it better  

View solution in original post

2 Replies
lorinroser
New Contributor

I want to extrude a first floor then create a footprint with the front setback, extude again and place the second extrusion on top of the first

0 Kudos
KristianMortensen1
New Contributor III

Hello Lorin. 

If I understand you correctly you want to create a building that "steps back", the best way I have found to do that is to create the bottom floor shape, and then move that one up with the "t" function so the code would look something like this: 

attr siy = 0 // floor counter
attr sty = 3 //Number of floors
attr floorHeight = 3 //Floor height
attr setbackDist = 1 //setback distance

@startrule
A01 --> //This code creates a loop that adds new floors until the "sty" is reached.
case siy < sty : A02(siy,sty) set(siy,siy+1) t(0,floorHeight,0) A01
else: A02(siy,sty)

A02(siy,sty) --> //This code takes the top floor and makes it the roof
case siy == sty : setback(setbackDist*siy-1) {front : NIL | remainder : Roof00}
else: A03(siy,sty)

A03(siy,sty) --> //This code creates the setbact of each floor, siy is the floor number where siy = 0 is the bottom floor, and siy = sty is the roof
setback(setbackDist*siy) {front : Balcony(siy,sty) | remainder : A04(siy,sty)}

A04(siy,sty) --> // here is each floor extruded to create a volume.
extrude(floorHeight)
comp(f) {side: Facade | bottom : Floor00}

Balcony(siy,sty) --> //this is the balcony area
setback(setbackDist*siy-1) {front :NIL | remainder: color(1,0,0)Balcony01}

This is maybe not the best code for doing it, but it will get the job done, you can always play around with it to see if you can make it better