Raindrop Flow Engine

Generates a parametric grid, projects it to the terrain, and simulates downhill flow paths.

Site Analysis Nickname: WaterFlow

Overview

Generates a parametric grid, projects it to the terrain, and simulates downhill flow paths.

Inputs (5)

  • TerrainMesh (Mesh): The unified topological surface.
  • GridSpacing (Number): The XY distance between starting raindrops.
  • StepSize (Number): Distance the water travels per tick.
  • MaxSteps (Integer): Safety limit for the simulation loop.
  • 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)

  • FlowPaths (Curve): The generated water movement paths.
  • DropPoints (Point): The valid starting grid points on the mesh.
  • Info (Text): Method, assumptions, simplifications and references.

Method, assumptions and simplifications

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

Method

  1. Seeds a regular XY grid of drops at GridSpacing over the mesh bounding box and projects them straight down onto TerrainMesh; each hit is a drop point. GridSpacing and StepSize must be greater than 0; more than 1,000,000 seeds is refused with an error.
  2. From each drop, the downhill direction on the current face is the steepest-descent vector (n × g) × n, with n the face normal and g pointing down.
  3. The drop moves StepSize along that direction, is pulled back to the closest mesh point, and the step is kept only if it is at least 1 mm lower; otherwise the path ends.
  4. Paths also end on near-flat faces (normal Z ≥ 0.9999) or after MaxSteps. Each path is output as a polyline in its own branch.

Assumptions

  • Rain falls evenly over the bounding box; the mesh is a single-valued terrain surface in metres.
  • StepSize is small compared with the mesh faces, so each step stays on the slope it started on.

Simplifications and limits

  • Drops do not interact: no flow accumulation, ponding, infiltration or merging of paths.
  • Paths stop in pits and on flats instead of filling or crossing them; a large StepSize can overshoot a valley and stop early on the opposite slope.
  • Path length is limited to MaxSteps × StepSize.
  • Branch numbers follow the projected hits, not the seeds: on overhangs one seed can give several drops.

Workflow

  • Terrain mesh (Site Fetch, Terrain Generator Pro) -> TerrainMesh. FlowPaths -> Analysis Heatmap or drainage sketches; use Hydro-DEM for flow accumulation.