Hello everybody.
I'm a CityEngine beginner and this is my first time here.
I found Avgi's question interesting as I'm facing a very similar problem.
Even though I run through the tutorials, I'm not able to solve this issue...
So, let me try to make it plain.
I have a SHP file of building footprints and another SHP file of streets which I imported into CE.
After the footprint extrusion, I use the component split in order to get the facades.
In fact, I'm quite interested in main facades (the street-facing components). As footprints and streets don't interact dynamically (in the current case), I can't use the selector street.xxx to set the faces I want to use as main (or front) facades.
As you can see (left side of the image - attachment file), whether I use front, side,etc or object.front, object.side,etc selectors, it doesn't work. It has to do with the different object coordinate system, right?
Despite that, I have a second goal. I want to classify main facades according to the different street types (A,B and C).
Then I tested the following workflow:
1. In order to set different main (or front) facades, I added a new object attribute to the original shapes called "BuildingType".
The possible values are:
StreetFront_north
StreetFront_east
StreetFront_south
StreetFront_west
Corner_northeast
Corner_southeast
Corner_southwest
Corner_northwest
and BlockFront (to the 4 quadrants).
2. Then I used the world.xxx selectors to get only the facades that correspond to the assigned buildings orientation.
I gave them different colors so that I made it clear. The X faces are represented as black.
----------------------------------------------------------------------------------------------------------------
Building(BuildingType) -->
case BuildingType == "StreetFront_north" :
comp(f)
{world.north:N | world.west:X | world.south:X | world.east:X}
case BuildingType == "StreetFront_south" :
comp(f)
{world.north:X | world.west:X | world.south:S | world.east:X}
(...)
else: NIL
----------------------------------------------------------------------------------------------------------------
As you can see at the right side of the image, the result is not perfect yet.
Some faces of both corner and top buildings of the block have been generated as main facades too because there are more than one facing the same quadrant... And I even didn't classify the facades according to the street type yet...
The next step would be adding a second new object attribute to the original shapes called "streetType" whose values differ between three values (A,B,C) so that I can call the right facade shape to either N, E, S and O previously generated shapes.
So... I was wondering... there must be a simpler way of doing this!
Would you give me some clues, please?
Thank you.
Best regards.
Sónia I.