Solved! Go to Solution.
/** * File: Test 2.cga * Created: 27 May 2014 07:43:52 GMT * Author: KennethL */ version "2013.1" attr height = 100 attr groundfloor_height = 10 attr floor_height = 10 attr top_ledge = 2 attr first_tile = mid_tiles - wall attr mid_tiles = 5 attr last_tile = mid_tiles attr top_legde2 =2 attr wall = 0.5 attr window = mid_tiles - wall attr nSymmetries = 2 Building --> comp(f){ front : Frontfacade | side : SideFacade | top: Roof} @Location(903,-265) Frontfacade --> split(y){ groundfloor_height : Floor(split.index) | groundfloor_height : Floor(split.index) | {~floor_height : Floor(split.index)}* | floor_height ++ top_ledge : Floor(999)} @Location(1810,-9) Floor(floorindex) --> case floorindex == 0 : TileRow(floorindex) case floorindex == 999 : split(y){ TileRow(floorindex) | ~top_ledge : TopLedge | top_legde2 : TopLedge2} case floorindex == 1 : split(y){ TileRow(floorindex) | top_ledge : TopLedge} else : split(y){ TileRow(floorindex) | top_ledge : TopLedge} @Location(2680,398) TileRow(floorIndex) --> case floorIndex == 0: split(x){ ~mid_tiles: Tile(-1) }* case floorIndex == 1: split(x){ ~mid_tiles: Tile(-1) }* else: split(x){ ~mid_tiles: First_tile | {~mid_tiles : Mid_tiles }*|~mid_tiles: Last_tile } @Location(3419,840) First_tile --> split (x) {mid_tiles-wall : Shape} Shape @Location(3446,1128) Last_tile --> split (x) {wall : Shape} Shape @Location(3432,989) Mid_tiles --> split (x) {wall : Shape | mid_tiles - wall - wall : Shape} Shape /**
* File: Test 2.cga
* Created: 27 May 2014 07:43:52 GMT
* Author: KennethL
*/
version "2013.1"
attr height = 100
attr groundfloor_height = 10
attr floor_height = 10
attr top_ledge = 2
attr first_tile = mid_tiles
attr mid_tiles = 5
attr last_tile = mid_tiles
attr top_legde2 =5
attr wall = 0.5
attr window = mid_tiles - wall
Building -->
comp(f){ front : Frontfacade | side : SideFacade | top: Roof}
Frontfacade -->
split(y){ groundfloor_height : Floor(split.index)
| groundfloor_height : Floor(split.index)
| {~floor_height : Floor(split.index)}*
| floor_height ++ top_ledge : Floor(999)}
split(x){ ~first_tile : Tile(split.index)
| {~mid_tiles : Tile(split.index) }*
| ~last_tile : Tile(999) }
Floor(floorindex) -->
case floorindex == 0 :
Ground_floor
case floorindex == 999 :
split(y){ Subfloor(floorindex) | ~top_ledge : TopLedge | top_legde2 : TopLedge2}
case floorindex == 1 :
split(y){ Ground_floor | top_ledge : TopLedge}
else :
split(y){ Subfloor(floorindex) | top_ledge : TopLedge}
Ground_floor --> Shape
Tile(tileindex)-->
case tileindex == 0 : window_left(split.index)
case tileindex == 999 : window_right
else : window_mid
window_left(floorindex) -->
case floorindex == 0 : split(x) { window : Window_side}
else: NIL
Shape
/** * File: Test 2.cga * Created: 27 May 2014 07:43:52 GMT * Author: KennethL */ version "2013.1" attr height = 100 attr groundfloor_height = 10 attr floor_height = 10 attr top_ledge = 2 attr first_tile = mid_tiles - wall attr mid_tiles = 5 attr last_tile = mid_tiles attr top_legde2 =2 attr wall = 0.5 attr window = mid_tiles - wall attr nSymmetries = 2 Building --> comp(f){ front : Frontfacade | side : SideFacade | top: Roof} @Location(903,-265) Frontfacade --> split(y){ groundfloor_height : Floor(split.index) | groundfloor_height : Floor(split.index) | {~floor_height : Floor(split.index)}* | floor_height ++ top_ledge : Floor(999)} @Location(1810,-9) Floor(floorindex) --> case floorindex == 0 : TileRow(floorindex) case floorindex == 999 : split(y){ TileRow(floorindex) | ~top_ledge : TopLedge | top_legde2 : TopLedge2} case floorindex == 1 : split(y){ TileRow(floorindex) | top_ledge : TopLedge} else : split(y){ TileRow(floorindex) | top_ledge : TopLedge} @Location(2680,398) TileRow(floorIndex) --> case floorIndex == 0: split(x){ ~mid_tiles: Tile(-1) }* case floorIndex == 1: split(x){ ~mid_tiles: Tile(-1) }* else: split(x){ ~mid_tiles: First_tile | {~mid_tiles : Mid_tiles }*|~mid_tiles: Last_tile } @Location(3419,840) First_tile --> split (x) {mid_tiles-wall : Shape} Shape @Location(3446,1128) Last_tile --> split (x) {wall : Shape} Shape @Location(3432,989) Mid_tiles --> split (x) {wall : Shape | mid_tiles - wall - wall : Shape} Shape