divya_udayan

Tutorial 7-Facade modeling

Discussion created by divya_udayan on Jan 1, 2014
Latest reply on Jan 3, 2014 by MBuehler-esristaff
In Tutorial 7-Facade modeling, it is shown that the picture has ground floor with only doors. But what if the ground floor has both windows and doors. How to write the CGA script? Please help me.
Also see the attached file for the 'code' and facade picture.

@StartRule
Lot --> s(15,15,15) extrude(height) Building



# we only need the front face for this example
Building --> comp(f) { front : Frontfacade | side : Frontfacade}



# the front facade is subdivided into one front groundfloor
# and upper floors
Frontfacade -->
split(y){ groundfloor_height : Floor(split.index) // Groundfloor
| floor_height : Floor(split.index) // First Floor
| floor_height : Floor(split.index) // Second Floor
| floor_height : Floor(split.index) // Third Floor
| floor_height : Floor(split.index) // Mid Floors
| floor_height : Floor(999) } // Top Floor, indexed with 999

Floor(floorindex)-->

case floorindex == 0:
Subfloor(floorindex)
case floorindex == 1:
split(y) {~1 : Subfloor(floorindex) Balcony | 0.5: TopLedge}
case floorindex == 4:
split(y) {~1 : Subfloor(floorindex) Balcony}
else:
split(y){1 : BottomLedge(floorindex) | ~1 : Subfloor(floorindex) | 0.5 : TopLedge}

Subfloor(floorindex)-->
split(x) {0.5 : Wall(1) | {~tile_width:Tile(floorindex)}* | 0.5:Wall(1)}


Tile(floorindex)-->
case floorindex == 0 :

split(x){~1: SolidWall | door_width : DoorTile | ~1: SolidWall}
else:
split(x){~1: Wall(getWalltype(floorindex)) | window_width : WindowTile(floorindex) | ~1 : Wall(getWalltype(floorindex))}

Attachments

Outcomes