Flight Ribbon Geometry Simulator
Visualize the interaction between segment resolution, DEM sampling density, and moving average filters over the Kathmandu–Lukla mountain profile.
Pipeline Parameters
Controls the number of discrete 3D fill-extrusion segments. Higher resolution decreases individual step length, eliminating the staircase effect.
Simulates the number of asynchronous queryTerrainElevation points along the route. Decreased sampling prevents main thread locking.
Radius of the sliding box blur applied to the sampled terrain profile. Filters out local mountain ridges and sudden tile elevation jumps.
Height of the Bezier trajectory apex above the runway endpoints, forming the parabolic curve.
3D Profile Projection
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.