Terrain Colorizer
Colors a terrain mesh by elevation and generates contours.
Overview
Colors a terrain mesh by elevation and generates contours.
Inputs (8)
- Terrain (Mesh): Input terrain mesh
- Colors (Colour): List of gradient colors (from low to high). Leaves empty for default palette.
- Use Slope Color (Boolean): Toggle steep slope coloring
- Slope Color (Colour): Color applied to sheer cliffs/slopes
- Slope Angle (Number): Angle in degrees where slope color starts
- Contour Step (Number): Interval for normal contour lines
- Main Step (Number): Interval for main contour lines
- Run (Boolean): Optional. False = skip the analysis and keep showing the last results (cached). Share one toggle with the Analysis Dashboard to switch everything on/off together.
Outputs (4)
- Colored Terrain (Mesh): Terrain mesh with vertex colors
- Contours (Curve): Normal contours
- Main Contours (Curve): Main contours
- Info (Text): Method, assumptions, simplifications and references.
Method, assumptions and simplifications
The same notes appear in the component's Info output.
Method
- Each vertex gets a colour from its normalised height t = (z - zMin) / (zMax - zMin) of the mesh bounding box, interpolated linearly in RGB along Colors (default green, yellow-green, goldenrod, brown, white).
- With Use Slope Color, the vertex normal's vertical component nz is compared with cos(Slope Angle): where |nz| is smaller (steeper than Slope Angle), the colour blends towards Slope Color by min((cos(Slope Angle) - |nz|) / 0.20, 1).
- Contours are cut every Contour Step from the first multiple of the step below the lowest point; a contour whose level is a multiple of Main Step (measured from Z = 0) goes to Main Contours, the rest to Contours.
Assumptions
- Terrain is a mesh in metres with Z up; vertex normals (recomputed here) represent the local slope.
Simplifications and limits
- The slope blend runs over a fixed 0.20 range of the normal's vertical component, not a fixed number of degrees.
- Main contours only appear when Main Step is a multiple of Contour Step.
Workflow
- Site Fetch terrain or any terrain mesh -> Terrain.