Hy,
I have a question about the use case presented by the Singapore Urban Authority, creating a development scenario they created those three yellow views that they want to be preserved while developing the new neighborhood, any suggestions how can you create them?
As well they have a height control mechanism (screen shot 2) were they conditioned the new development to a certain height, any suggestion how this one can be coded?
Any leads will be much appreciated,
Thank you,
Mihai
Designing Our Future – Urban Redevelopment Authority - YouTube
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") // or NIL
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)
Thomas,
Many thanks for the clarifications, I will start implementing them see what comes out.
Mihai
Hi Thomas,
I tried using the code you have provided. But doesn't generates like you have shown in screenshots. Does occlusion works in same parcel/footprint .
Code Used
Code_1.cga :-
version "2016.1"
@Range(0,1,2)
attr LOD = 1
attr maxFloors = 50
attr floorheight = 4
@StartRule
Lot-->
offset(-3)
comp(f) { inside: Initial }
Initial-->
extrude(maxFloors*floorheight)
FloorSplit
FloorSplit-->
case overlaps(inter):
split(y){~1:FloorSplit | floorheight: Outside}
else:
case LOD < 1: Mass
else: split(y){~1:FloorSplit | floorheight: Floor}
Mass--> color("#0000ff")
Floor--> color("#00ff00")
Outside--> color("#ff0000") // or NIL
Code_2.cga :-
version "2016.1"
@Range(1,89)
attr angle = 30
@Range(50,1000)
attr dist = 500
@StartRule
Lot -->
offset(dist)
comp(f) { border: Slope }
Slope-->
rotate(abs,scope,-angle,0,0)
extrude(world.up,1)
comp(f){bottom: Visualisation}
Visualisation--> set(material.opacity,0.3)
The example with the slope around a shape in the middle is a quite unusual use case.
To make this inter occlusion queries work, the Procedural Runtime preferences need to be adjusted:
neighborhood distance for inter-occlusion needs to be set to the maximum extend of the slope (attr dist in the cga rule above)
Please refer to the help for further explanations: Context (and Occlusion) Queries
Thanks Thomas, it works perfectly now.
Hi Thomas, sorry to disturb you again. I was trying to use the 30⁰ rule for a river but it is loosing shape while extruding.
Lot -->
extrude(world.up, dist)
comp(f) {front: Slope }
Slope -->
rotate(abs,scope,90-angle,0,0)
extrude(world.up,0.1)
Visualisation
Visualisation --> color(0,1,0) set(material.opacity,Transparent)
I am not able to figure out how to solve this.
Thanks in advance.
Hi Abhishek,
I reworked the slope rule in my initial reply. This should now work in your case.
This doesn't answer your question, but I have the camera RPK used in that demo. The demo version had a little focus box seen in the video, but I can't find that version. It was originally made in 2013, and was updated just slightly in 2016. The RPK is unlocked so you can unzip the file to get the source.
Chris