i have the following problem in my Cityengine project. Because of the hilly landscape I built my buildings on flat tops. But then the doors of the buildings are not at the lowest point. As already suggested in another post, I have therefore created stairs.
However, I would still be interested to know if it would be possible to automatically set the doors to the lowest point of the building? In other words, that Cityengine always searches and finds the lowest point in all buildings and then builds the door there.
Is there a way to find the lowest point? Maybe with case conditions or with special commands (maybe geometry.height or scope.elevation or similar)?
I am using the CE 2018.1 version
Unfortunately, there isn’t a good way to do this. I don’t think it’s possible. This is because it is currently not possible to access the terrain elevation from within CGA. Nevertheless, here are some suboptimal ideas.
One idea for a workaround is to do something like what this post does and create shapes that follow the terrain and use occlusion queries to test if you intersect the terrain:
Another idea for a workaround would be to align shapes to the terrain using Project All (instead of Translate), and then, splitting the side facades would give you a door that touches the ground. This will not work, however, when the terrain varies nonlinearly between the vertices of your initial shape.
Another idea for a more complicated workaround could be to create a cube that is positioned on the terrain just below the door and use minimumDistance() to query the distance of the door to the terrain. This will not work, however, when the distance from the door to the terrain is larger than the distance from the door to another door’s cube.
t(0, -minimumDistance(inter, "DoorCube"), 0)
Note: You might want to assign a unique ID (in an object attribute) to your footprint shape so that when you create the label on the door cube in step (5), you can include the unique ID in the label string. In step (3), object attributes of the footprint shape are passed to the door cube shape.