Finding the lowest Point

11-05-2019 04:04 AM
New Contributor III

Hello everyone,

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

Thomas FuchsChris WilkinsMatthias BuehlerCheryl LauDavid WassermanMichelle MathiasMartin ManzerL RElliot HartleyDan PattersonTaisha FabriciusDavid KossowskyGeoff Taylor

Thank you

0 Kudos
1 Reply
Esri Regular Contributor

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.

Idea 1

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:

detecting terrain intersetion with a shape to achieve more realistic window texturing 

Idea 2

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.

Idea 3

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.

  1. Where you create your door, create a small cube.  
  2. NIL everything else so that the door cube is the only geometry in the model.
  3. Shapes -> Convert Models to Shapes. Now the door cube is a separate initial shape and is selectable in the Scene Editor.
  4. Align door cube shape to terrain using Translate to Minimum.
  5. Assign rule to door cube shape to label the geometry for later use in context queries.
    DoorCube -->
  6. Go back to your rule where you create the door.  Now, you can use minimumDistance() to get the distance from the door to the closest door cube.  You can use this distance to translate the door, for example.
    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.

0 Kudos