Ze Meng
← ZTools

Site

zSiteModifier

Fit a site surface to buildings or terrain

zSiteModifier reshapes a site surface so that it follows the top of other objects. It rebuilds the control grid of one or more original site surfaces, then drops each control point straight down onto the highest hit on a set of target objects (buildings, a terrain mesh, any solids). The result is a smooth new ground that fits the existing buildings or terrain, without editing control points by hand.

Control points that miss every target take the height of their nearest control point that did hit, so the fitted surface is always complete with no holes. After the projection, the new surface is trimmed back to the outline of the original surface as seen from the top view: the outer edge of the original stays the same, and holes in the original stay holes. This also works when the original surface is sloped or has an irregular outline.

Good for:

  • Fitting a site surface to a terrain mesh, or to the tops of a group of building masses.
  • Handling several site surfaces at once with shared settings.
  • Softening the projected height steps with smoothing, and checking the result with contours.

Not suited for:

  • Polysurfaces as the original site. Only single surfaces are accepted.
  • Making one area exactly flat with a smooth transition to its surroundings. The tool has no such option.

Quick start

  1. Run zSiteModifier.
  2. Select one or more original site surfaces and press Enter. Only single surfaces are accepted; selected polysurfaces are skipped, with a message on the command line.
  3. Select one or more target objects: surfaces, polysurfaces, meshes, solids, extrusions, in any mix. Press Enter.
  4. Type a cell size (a bare number is in the document unit) and press Enter. The fitted surfaces are drawn live; the original surfaces are hidden while you look and shown again afterwards. They are never modified.
  5. Set the options if you want: Iterations (smoothing, 0 means none), ShowGrid, ShowControlPoints, ShowContour. Typing another cell size updates the preview.
  6. Press Enter on the empty prompt to create one new fitted surface per original surface on the zSiteModifier layer. Esc discards the preview.

Lengths follow the Rhino document unit.

Options

  • Cell size (the number you type): the cell length of the new control grid (default 30 ft, or 10 m in a metric document). There is no upper limit. The number of control points in U and V is worked out separately for each original surface so the cells stay roughly square.
  • ShowGrid: shows the rebuilt control grid as lines (on by default).
  • ShowControlPoints: shows each control point as a dot.
  • Iterations: how many times the projected heights are smoothed, from 0 to 100. The amount of smoothing at each control point depends on the largest height difference to its four neighbors.
  • ShowContour: a contour preview for reference only; it is not baked. The spacing is fixed at 1 ft (1 m in a metric document). Every fifth contour is drawn thicker and labeled with its elevation.

How things work together

  • The preview uses a coarse mesh of the target objects for speed. The final step re-meshes the targets at the document’s mesh quality and computes once more, so the baked result is more accurate than the preview.
  • Changing the cell size rebuilds the grid and reprojects in one step. There is no separate Rebuild button.
  • The trim happens after projection and smoothing: first a full fitted patch is made, then the outer edge and holes of the original surface are projected straight down onto it from the top view and the extra parts are cut away. Both the preview and the baked result are trimmed.
  • The contours follow the smoothed result, so changing Iterations also changes the contours when ShowContour is on.
  • With several original surfaces, all options are shared. The final step creates a separate new surface for each original, all on the zSiteModifier layer.
  • Each control point takes only the highest hit on the targets directly below it. Where a target has an overhang, the ground follows the top of the overhang.

Good to know

  • A selected site surface was skipped. The original must be a single surface; polysurfaces are skipped. Extract the face you need first, then run the tool.
  • The result goes beyond the original site edge, or a hole is filled. Normally the result is trimmed back to the original outline from the top view, and holes are kept. If the trim cannot be made (for example the edge cannot be projected onto the new surface), you get the full untrimmed surface instead and need to trim it by hand.
  • The heights along the edge look pushed out flat. Control points near the site edge that miss every target take the height of the nearest control point that hit. Let the targets cover the whole site, or add a ring of target geometry beyond the edge, for a more natural result.
  • After smoothing, the ground no longer fits the building edges. Smoothing changes the heights of the hit points, and the higher the Iterations, the further they move. Lower Iterations, or set it to 0, when an exact fit is needed.
  • Smoothing has no strength or radius setting. Iterations is the only control. Smoothing weights are limited to between 0 and 1, so the result cannot overshoot or spike.
  • The grid is too dense and the preview is slow. Type a larger cell size.
  • The contour spacing cannot be changed. It is fixed at 1 ft.
  • An original surface was deleted or changed while the command was running. The originals are hidden while the command is running. If you delete or change one by other means, that surface produces no result on Bake. It does not crash.
  • The original surfaces are still there after you press Enter. The originals are never modified; a new surface is made. Once you are happy with the result, delete or hide the originals yourself.