I built this browser model to make the Montaña Rusa’s layout inspectable after the ride was dismantled. The model follows the original circuit topology: one trip ends at the opposite platform, and a second trip returns the train to its starting point. The article in Spanish covers the ride and its place in Chapultepec.
From references to track geometry#
An aerial image from 2018 sets the footprint and horizontal scale. Photographs and on-ride videos establish the order of turns, drops, crossings, and platform approaches. The published height of 110 feet sets the vertical scale. Where the sources leave gaps, the model estimates elevations, radii, and clearances.
TypeScript defines each platform-to-platform trip as a 3D centerline. Straights, arcs, and the station approaches specify its plan. The elevation profile is sampled along horizontal distance, filtered, and interpolated with a cubic spline. The renderer generates rails, ties, decks, and handrails from offsets to the centerline. Transverse frames support the paired tracks, with separate supports where the tracks diverge near the station.
A shared structure and four articulated cars#
Each car samples two axle positions along the route to determine its own position and orientation. This lets the front car start down a drop while the rear cars are still climbing. The renderer depth-sorts each car against the structure so a train can pass behind a frame and in front of another.
What the physics calculates#
The solver advances in steps of track distance. It estimates the train’s center-of-mass height from all four cars and updates kinetic energy from changes in elevation, rolling resistance, and speed-dependent drag. The lift can supply energy until the last car clears the crest. A trim brake caps speed before the second turnaround. The final block distributes braking work along its length, holds the train for four seconds, then releases it down the grade to the platform.
The solver assumes an empty car mass of 1,800 kg, six seats per car, and 75 kg per passenger. Tests cover empty, half-full, and full trains. Representative outputs are two trips of about 1.21 and 1.24 km and a peak speed near 82 km/h. The linked diagnostics contain the input parameters and outputs for each trip.
Rendering and verification#
Astro emits the initial SVG and a shared JSON file with train poses and timing samples at build time. The viewer uses requestAnimationFrame to play that timeline. The 20-second default and 40-second option scale elapsed time uniformly. The 1× setting uses the calculated durations of roughly 189 and 198 seconds. Rotation loads the geometry renderer on demand and recomputes projection and depth order. Zoom changes the SVG framing. PNG export renders the current view to a canvas.
Automated checks cover the platform connections, separation between tracks, train clearance at crossings, and the stop and subsequent gravity transfer. They also check that the train completes both trips under the tested loads and that the chain is its only source of positive mechanical work. Browser tests exercise playback, rotation, zoom, reduced motion, and export.
Some labels in the diagnostic files are in Spanish.
What remains unresolved#
The route uses estimated terrain and geometry. The apparent loads are computed in an unbanked track frame, and the timber is modeled visually. The solver omits structural deflection, suspension, wheel–rail contact, and interactions between trains. Its results describe the model under its stated assumptions.