Terrain Generator Pro

Generates topography with noise-masked procedural forest scattering and strict elevation limits.

Site Analysis Nickname: TRN-P

Overview

Generates topography with noise-masked procedural forest scattering and strict elevation limits.

Inputs (21)

  • Boundary (Curve): Closed boundary limits
  • MaxHeight (Number): Maximum elevation in meters
  • MinHeight (Number): Minimum elevation in meters
  • Seed (Integer): Randomization seed
  • PatternSizeXY (Number): List of feature sizes in meters
  • PatternHeightZ (Number): List of relative feature strengths
  • ContourStep (Number): Interval for normal contour lines
  • MainStep (Number): Interval for main contour lines
  • Colors (Colour): List of gradient colors based on height
  • Resolution (Integer): Grid density
  • UseSlopeColor (Boolean): Toggle steep slope coloring
  • SlopeColor (Colour): Color applied to sheer cliffs/slopes
  • SlopeAngle (Number): Angle where slope color starts
  • TerrainStyle (Integer): 0 = Realistic Soft Hills, 1 = Ridged/Cellular Pattern
  • Solid (Boolean): Toggle closed mesh extrusion
  • BaseCol (Colour): Color for the extruded solid base section
  • TreeMsk (Number): Coverage mask threshold 0.0 to 1.0
  • TreeDns (Number): Density multiplier inside mask areas 0.0 to 1.0
  • TreeSeed (Integer): Dedicated seed for the forest noise map
  • TreeZMin (Number): Minimum relative elevation for trees 0.0 to 1.0
  • TreeZMax (Number): Maximum relative elevation for trees 0.0 to 1.0

Outputs (5)

  • Mesh (Mesh): Gradient colored terrain geometry
  • NormContours (Curve): Standard contour lines
  • MainContours (Curve): Major interval contour lines
  • Trees (Point): Scattered point coordinates for trees
  • Info (Text): Component information and interpretation

Method, assumptions and simplifications

The same notes appear in the component's Info output.

Method

  1. The Boundary is flattened and tessellated: a grid of Resolution columns across its width (rows in proportion) inside the boundary, plus points along the boundary at about one grid step, are triangulated with Rhino CreateFromTessellation.
  2. If MinHeight is greater than MaxHeight the two are swapped and a warning is shown. Each vertex height = MinHeight + t × (MaxHeight − MinHeight), where t is fractal gradient (Perlin-style) noise: one octave per PatternSizeXY / PatternHeightZ pair (defaults when the inputs are empty 500, 150, 30 m and 1, 0.3, 0.05; the auto-wired panels give 150, 50, 20 and 1.0, 0.3, 0.1), octave i seeded with Seed + i and each octave's coordinates rotated about 37°.
  3. TerrainStyle 0 (soft hills): weighted mean of the octaves mapped to 0 to 1 and clamped. TerrainStyle 1 (ridged): weighted mean of (1 − |n|)².
  4. Vertex colours follow the Colors gradient by relative height. With UseSlopeColor, vertices whose normal Z is below cos(SlopeAngle) blend towards SlopeColor over 0.2 of normal Z.
  5. Contours are cut every ContourStep from the mesh; those at multiples of MainStep go to MainContours.
  6. Trees: on triangles with normal Z ≥ 0.7 and relative height between TreeZMin and TreeZMax, a forest mask noise (150 m scale, TreeSeed) below TreeMsk gives an expected count of (1 − mask / TreeMsk) × TreeDns × 3 trees per triangle at random positions.
  7. Solid adds a flat base at min height − max(1 m, 10% of the height range) and side walls from the naked edges.

Assumptions

  • Units are metres; the noise uses absolute world X and Y, so moving the Boundary changes the terrain.
  • The result is synthetic test terrain, not a model of a real site.

Simplifications and limits

  • Heights stay inside MinHeight to MaxHeight but rarely reach them: the noise is not stretched to the full range.
  • Tree count is per triangle, not per area, so density per hectare changes with Resolution.
  • No erosion, drainage or geological process is modelled.
  • The sine-based hash loses precision at large (UTM-size) coordinates, so the noise degrades far from the origin.
  • With Solid on, the mesh is welded at any angle, so wall and base colours can bleed into the terrain edge.

Workflow

  • Closed curve -> Boundary. Mesh -> Raindrop Flow Engine, Hydro-DEM, slope or wind tools to test them on varied topography.

References

  • Perlin K. (2002), Improving noise, ACM SIGGRAPH: quintic fade curve used in the noise.