Select to view content in your preferred language

Paris example: How can I get the front facade on all sides and back of a building?

1116
2
06-08-2017 06:45 AM
RebeccaM
Deactivated User

Hi,

I am using the Paris example for an experiment. My blocks have offset subdivision, so there are inner yards (cour interieure) sometimes. The original paris.cga rule creates generic back facades and special facades if sides of buidlings touch each other ("shared wall"):

I need the building's side and back to be exactly the same as the front (green circle in nextscreenshot). I am aware that it's not "natural" if the side of a building has "entrance doors" and shops, but it's for the sake of the experiment.

In the code, I think this is done with the getGenMurAveugleTexture function.

Original code looks like this:

################
# Back Facades
################

BlindFacade -->
    30%:
        split(x){ 'rand(0.2,0.7) : BlindFacadeTextured | ~1: YardFacade }
    5%:
        split(x){ 'rand(0.1,0.4) : BlindFacadeTextured | ~1: YardFacade | 'rand(0.1,0.4) : BlindFacadeTextured }
    5%:
        split(x){ 'rand(0.1,0.4) : YardFacade | ~1: BlindFacadeTextured | 'rand(0.1,0.4) : YardFacade }
    else:
        YardFacade
        
BlindFacadeTextured -->
    alignScopeToAxes(y)
    setupProjection(0,scope.xy,16,scope.sy,16)
    projectUV(0)
    texture(getGenMurAveugleTexture)

BlindFacadeGF -->
    alignScopeToAxes(y)
    setupProjection(0,scope.xy,16,Groundfloor_Height*6,16)
    projectUV(0)
    texture("genMurAveugle1.png")
    BlindFacade.


YardFacade -->
    FacadeSets(0)


floorindex(textureOffset) =
    case textureOffset == 1 : split.index + textureOffset
    else : textureOffset


Floor(textureOffset) -->
    case !LOD_HIGH : Floor. # lores floor
    case comp.sel == "back": Floor. # lores floor on the back
    case textureOffset == 0: GroundFloor. # no hires for groundfloors
    else :     
        split(y){~Floor_Height : FloorDetails(floorindex(textureOffset))}* # split repeated mid floors again for High LOD

I changed the getGenMurAveugleTexture to gettexture, like this:

################
# Back Facades
################
// these are the facades that are on the back side of buildings (inner yards..)

BlindFacade -->
    30%:
        split(x){ 'rand(0.2,0.7) : BlindFacadeTextured | ~1: YardFacade }
    5%:
        split(x){ 'rand(0.1,0.4) : BlindFacadeTextured | ~1: YardFacade | 'rand(0.1,0.4) : BlindFacadeTextured }
    5%:
        split(x){ 'rand(0.1,0.4) : YardFacade | ~1: BlindFacadeTextured | 'rand(0.1,0.4) : YardFacade }
    else:
        YardFacade
        
BlindFacadeTextured -->
    alignScopeToAxes(y)
    setupProjection(0,scope.xy,16,scope.sy,16)
    projectUV(0)
    //texture(getGenMurAveugleTexture)
    texture(gettexture)

BlindFacadeGF -->
    alignScopeToAxes(y)
    setupProjection(0,scope.xy,16,Groundfloor_Height*6,16)
    projectUV(0)
    //texture("genMurAveugle1.png")
    texture(gettexture)
    BlindFacade.


YardFacade -->
    FacadeSets(0)


floorindex(textureOffset) =
    case textureOffset == 1 : split.index + textureOffset
    else : textureOffset


Floor(textureOffset) -->
    case !LOD_HIGH : Floor. # lores floor
    case comp.sel == "back": Floor. # lores floor on the back
    case textureOffset == 0: GroundFloor. # no hires for groundfloors
    else :     
        split(y){~Floor_Height : FloorDetails(floorindex(textureOffset))}* # split repeated mid floors again for High LOD

However, that has not resulted in what I need yet:

The ground floor is repeated (red circles), so there are doors on the second floor of side parts and back parts. How can I get the same structure / texture on all sides of my building? What am I missing? I did not find the

comp (f){front: ...
            |back : ...
            |side : ...
            }

part anywhere.

0 Kudos
2 Replies
CherylLau
Esri Regular Contributor

Tip:  Use the Model Hierarchy (Window -> Show Model Hierarchy) to help you figure out what's going on in the rules.  You can double click on shapes in the shape tree in the model hierarchy to jump to the corresponding rule in the rule file.

First, the mass is split into a ground floor mass and an upper floor mass.  Then, the comp happens on each of these masses to get the facades.  This is in the rules GroundfloorMass and UpperfloorsMass, and the component splits are on lines 195-196 and 203-204.  On line 195, change BlindFacadeGF to FacadeGF so that what happens to the back faces is the same as what happens to the other side faces.  Similarly, on line 203, change BlindFacade to MainFacade("upper") so that the back faces match the side faces.

With the model hierarchy open, click on the back face to see how it was generated, and follow the shapes up the tree until you get to a rule that you understand and back down the tree.  Try to figure out why the back face is different from the front face.  How is the texturing set up?

The Floor rule (line 268) has a case statement which uses comp.sel=="back", so this causes back faces to be treated differently than other faces.  Comment this line out (270).

In the FacadeSets rule (line 226) the texture file is set on line 227 using gettexture.  In the definition of gettexture, there's another case statement that tests if comp.sel=="back".  Comment this out (line 130).

RebeccaM
Deactivated User

Excellent, I will try this. Thank you!

0 Kudos