← Back to Map

Flight Ribbon Geometry Simulator

Visualize the interaction between segment resolution, DEM sampling density, and moving average filters over the Kathmandu–Lukla mountain profile.

Visible Blockiness (Max Step Delta: 146.6m)

Pipeline Parameters

120 quads

Controls the number of discrete 3D fill-extrusion segments. Higher resolution decreases individual step length, eliminating the staircase effect.

40 points

Simulates the number of asynchronous queryTerrainElevation points along the route. Decreased sampling prevents main thread locking.

9 points (4 radius)

Radius of the sliding box blur applied to the sampled terrain profile. Filters out local mountain ridges and sudden tile elevation jumps.

+5200m peak

Height of the Bezier trajectory apex above the runway endpoints, forming the parabolic curve.

1.5x

3D Profile Projection

Exaggerated TerrainQuery Keypoints3D Ribbon ExtrusionsBezier Trajectory
2000m4000m6000m8000m10000m12000m

Mathematical Pipeline Breakdown

1. Bezier Curve Trajectory

Calculates a smooth spatial path between airports without locking to topography:
B(t) = (1-t)² P₀ + 2(1-t)t P₁ + t² P₂
Endpoints P₀ and P₂ are dynamically anchored to the active terrain heights at Kathmandu and Lukla.

2. Terrain Height Subtraction

To neutralize MapLibre's native ground-relative extrusion scaling, we calculate:
Relative Height = Trajectory(t) - Exaggerated Terrain(t)
When MapLibre adds the ground mesh height back during rendering, they cancel out, placing the top of the ribbon at exactly Trajectory(t).

3. Sparse Query & Noise Smoothing

Querying terrain at every segment creates main thread lock. Instead, we query 40 points, interpolate linearly, and apply a moving average filter:
SmoothTerrain[i] = Average(Terrain[i - window] ... Terrain[i + window])
This filters out steep ridge deltas and tile-resolution discrepancies.