Terrain Slope

Colours terrain mesh faces by slope (angle of the face normal from vertical): binary over / under a threshold in degrees, percent or 1:X, or a gradient across the slope range of all input meshes.

Site Analysis Nickname: TerrainSlope

Overview

Ultra-fast mesh slope analyzer using raw C# sequential array processing and safe UI automation.

Inputs (6)

  • TargetMeshes (Mesh): Meshes to analyze
  • ThresholdValue (Number): Threshold for slope analysis
  • ThresholdMode (Integer): 0: Degrees, 1: Percentage, 2: Ratio
  • Custom Colors (Colour): List of colors for gradient or binary mapping
  • EnableBinaryMode (Boolean): If true, snaps to binary colors (Under/Over threshold)
  • 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 (3)

  • AnalyzedMeshes (Mesh): Colored Meshes
  • Dashboard Data (Text): JSON Legend Data
  • Info (Text): Component information and interpretation

Method, assumptions and simplifications

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

Method

  1. Each mesh is unwelded and its face normals computed; face slope θ = acos(|n.Z|), so faces wound downwards read the same as upward ones.
  2. ThresholdValue is converted to an angle from the chosen ThresholdMode: degrees, percent (θ = atan(p / 100)) or ratio 1:X (θ = atan(1 / X)).
  3. Binary mode (default): faces with θ ≤ threshold take the first Custom Colors entry, steeper faces the last (defaults light green and red).
  4. Gradient mode: θ is normalised between the minimum and maximum slope over all input meshes and coloured by linear interpolation through all Custom Colors; legend labels give the slope at each colour stop in the ThresholdMode unit.
  5. Dashboard Data reports the share of mesh surface area over the threshold over all meshes, and the average of the per-mesh area shares.

Assumptions

  • Meshes are terrain with +Z up; units do not matter because slope is an angle.

Simplifications and limits

  • Slope is per face, with no smoothing across neighbouring faces, so mesh noise shows as steep faces.
  • Gradient colours are relative to the slope range of the run, so they are comparable between the meshes of one run but not between runs.

Workflow

  • Terrain mesh (for example from Site Fetch) -> TargetMeshes; Dashboard Data -> Legend Geometry or Analysis Dashboard.