I created a building using vertical splits because some elements (the entrance part) didn't line up with the rest and to keep the number of splits to a minimum. However, now I'd like to split the building horizontally to color its floors separately. Is that possible while retaining the current structure?
Here's a photoshop mockup of what I'm trying to do:
Solved! Go to Solution.
Here's one way to do it:
version "2014.1"
attr floorCount = 4
attr floorHeight = 4
Shape -->
extrude(floorCount * floorHeight)
SplitIntoFloors
SplitIntoFloors -->
split(y) {floorHeight: Floor}*
Floor -->
comp(f) {side: Facade(split.index)}
Facade(floorIndex) -->
case floorIndex == 0: color(1,0,0) FacadeVerticalSplits(true)
else: color(0,1,0) FacadeVerticalSplits(false)
FacadeVerticalSplits(isGroundFloor) -->
split(x) {
'0.4: VerticalSplittingLeft |
'0.2: EntranceOrWindows(isGroundFloor) |
'0.4: VerticalSplittingRight
}
EntranceOrWindows(isGroundFloor) -->
case isGroundFloor: Entrance
else: EntranceWindows
Entrance --> YourOldCodeHereForGroundFloor.
EntranceWindows --> YourOldCodeHereForWindowsAboveEntrance.
VerticalSplittingLeft --> YourOldCodeHereForLeftSide.
VerticalSplittingRight --> YourOldCodeHereForRightSide.
Here's one way to do it:
version "2014.1"
attr floorCount = 4
attr floorHeight = 4
Shape -->
extrude(floorCount * floorHeight)
SplitIntoFloors
SplitIntoFloors -->
split(y) {floorHeight: Floor}*
Floor -->
comp(f) {side: Facade(split.index)}
Facade(floorIndex) -->
case floorIndex == 0: color(1,0,0) FacadeVerticalSplits(true)
else: color(0,1,0) FacadeVerticalSplits(false)
FacadeVerticalSplits(isGroundFloor) -->
split(x) {
'0.4: VerticalSplittingLeft |
'0.2: EntranceOrWindows(isGroundFloor) |
'0.4: VerticalSplittingRight
}
EntranceOrWindows(isGroundFloor) -->
case isGroundFloor: Entrance
else: EntranceWindows
Entrance --> YourOldCodeHereForGroundFloor.
EntranceWindows --> YourOldCodeHereForWindowsAboveEntrance.
VerticalSplittingLeft --> YourOldCodeHereForLeftSide.
VerticalSplittingRight --> YourOldCodeHereForRightSide.
But if you do it that way, you must be OK with the vertical section over the entrance being slightly different as in below image:
Hmm that's what I wanted to avoid.. but I guess it's probably better to just rewrite the script and do the coloring like in your example. Thanks!