Building a city model

If you have an ESRI shapefile, you'll know that they are a collection of polygons, often representing building footprints in a city. Each polygon has a height value that denotes the height of the building. It is possible to build a simple hexahedral model using various operators in VisIt.

Procedure

Make the following expression in VisIt, taking care to use the proper mesh and height variable names:

building = if(lt(recenter(coord(<mesh>)[2]), <height>), 1, 0)

We'll use the above expression in VisIt to evaluate a field on a resampled 3D mesh so that the cells under the elevated building heights will be marked as part of the building while other cells will not.

  1. Add a Pseudocolor plot of building
  2. Add a Resample operator. You can often resample the entire extents but be sure to crank up the number of samples in X and Y.
  3. Add an Extrude operator. Set the Extrusion axis to 0 0 1 and set the length to the largest height in your model.
  4. Add a DeferExpression operator. Make the building variable be deferred.
  5. Add a Threshold operator. Set the min to 0.5
  6. Draw the plots
  7. If the model looks okay to you then Export Database to a file format like VTK or Silo. If the model does not look okay then adjust the number of samples in the Resample operation or adjust the bounds of the resampling.

ResampledCityModel.png