# Split function, without a two walls on each side of the first and last window!

1327
3
05-26-2014 06:16 AM
Occasional Contributor
I do not think that this is too complicated, but I seem to fail to get it to work like I would like.
I got my floors indexed into ground floor, first floor, sub floors and top floor. All of the floors needs to have needs to have tiles with ~4 in width. But the sub floors also need to have their tiles split once more,  ~0.5 on the right side, and ~0.5 on the left side. But in the beginning and in the end, I do not want it to start with a ???sub split??? if this doesn???t make any sense, please have a look at the picture 😉
So what Im not able to do is to make the first and the last tile, to have only a split on one of the sites!
[ATTACH=CONFIG]34081[/ATTACH]
[ATTACH=CONFIG]34082[/ATTACH]
Tags (3)
1 Solution

Accepted Solutions
Occasional Contributor
I got it, it???s working for me now. I provide the rule if any other is struggling with the same understanding issue as I did.
Maybe it could be done easier, so don???t hesitate with any comments. I???m here to learn 😉

`/**  * 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 `
3 Replies
by Anonymous User
Not applicable
Original User: kelin84

I believe I need to describe this a little more.
So each floor needs to have a an (x) split at the exact same place, be course I every tile needs to be aligned on top of each other.
Seperatly I can create a floor index and a tile index, but I fail to put those two together, so that everything not equal floorindex 0 && florindex == 1 should use my subdivided tile. For some reason the floorindex seems to get corrupted, when I try to use it again, after I have used my tileindex.
This is probably pretty easy; I guess I just am missing a link in my understanding. I have tried to put it together in many ways, but I think that this code is where I got closest to what I want, but still not at all where I want to be.

```/**
* 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 -->
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```
Occasional Contributor
I got it, it???s working for me now. I provide the rule if any other is struggling with the same understanding issue as I did.
Maybe it could be done easier, so don???t hesitate with any comments. I???m here to learn 😉

`/**  * 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 `
by Anonymous User
Not applicable
Original User: matthiasbuehler

hehe .. thanks for sharing !

🙂