Hello Mihai
Thank you for your question.
The CGA models are controlled by occlusion queries using the inside / overlaps / touches function—Esri CityEngine | ArcGIS Desktop .
I created a simple building rule that checks from top to bottom for floors outside an envelop and colors them red.
version "2017.1"
@Range(0,1,2)
attr LOD = 1
@Range(1,150)
attr maxFloors = 50
attr floorheight = 4
@StartRule
Lot --> offset(-3)
comp(f) { inside: Initial }
Initial --> extrude(maxFloors*floorheight)
FloorSplit
FloorSplit-->
case overlaps(inter, "limit"):
split(y){~1:FloorSplit | floorheight: Outside}
else:
case LOD < 1: Mass
else: split(y){~1:FloorSplit | floorheight: Floor}
Mass--> color("#0000ff")
Floor--> color("#00ff00") report("Floos",1)
Outside--> color("#ff0000")
Here is an example how to create an view shed occluder, just draw a shape and add this rule:
version "2017.1"
@Range(5,500)
attr height = 100
@StartRule
Occluder --> extrude(world.up,height)
label("limit")
set(material.opacity,0.3)
Finally a slope occluder to control the height of a building. Just draw a shape representing an area that shall be visible from a given angle and add this rule:
version "2017.1"
@Range(1,89)
attr angle = 30
@Range(50,1000)
attr dist = 500
@StartRule
Waterfront --> extrude(world.up.flatTop,0)
comp(f) { top = Top }
Top --> extrude(world.up,1)
comp(f) { side= Sides }
Sides --> extrude(vertex.normal, dist)
comp(f) { back: Slope | all: NIL }
Slope --> roofShed(angle)
comp(f) { vertical: NIL |
bottom: NIL |
all: Occluder }
Occluder --> extrude(world.up,-1)
label("limit")
set(material.opacity,0.3)