Select to view content in your preferred language

Breaking up facades into sections

487
2
06-25-2012 02:14 PM
JoanneO_Brien
Deactivated User
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
Deactivated User
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
Deactivated User
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