Breaking up facades into sections

06-25-2012 02:14 PM
Occasional Contributor
I'm just learning cityengine and am trying to break up the ground floor layer into sections. My building is a fairly complex hexagonal shape with multiple sides but I only want entrances on two of the sides, and tiles on the rest. How do I write the code to achieve this? Is there a way to assign each side a different name or something so that only some sides contain doors?
0 Kudos
2 Replies
Frequent Contributor II
hi !

I'd try to make this with the comp.index

after extruding your hexagonal shape, use the comp(). when using the side selection, pass on the comp.index as an argument to the next rule. this will give each facade an index with which you then can work.

Here's the code :

[ did not check the code, just writing it down here ]

Try this, then adapt the indices below in the code ( currently 0 and 1 )

Lot -->
    comp(f) {top : Roof. | side : Facade(comp.index) | all : NIL}

Facade( myIndex ) -->
    case myIndex == 0 :
    case myIndex == 1 :
    else :

after this test works, continue in your own code. ok ?
0 Kudos
Occasional Contributor
Hey thanks that code works amazingly! I just need to determine which Index number the walls are that I want doors in and apply the code to it but replacing colour with texture etc! Very nice! :)
0 Kudos