Breaking up facades into sections

413
2
06-25-2012 02:14 PM
JoanneO_Brien
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
MatthiasBuehler1
Frequent Contributor
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 -->
    extrude(3)
    comp(f) {top : Roof. | side : Facade(comp.index) | all : NIL}

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


after this test works, continue in your own code. ok ?
0 Kudos
JoanneO_Brien
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