Geodesic Flow & Non-Euclidean Geometries


← Parametric Equations  ·  Contents  ·  Implicit Surfaces (Ray Marching) →


Surface Explorer 4D includes an advanced Geodesic Flow engine. Instead of defining a surface explicitly, this mode generates geometry by simulating the physical paths of particles (geodesics) traveling through a curved space.

 

Geometric & Numerical Mechanism

The system evaluates the parametric equations of the ambient space to automatically compute the Metric Tensor (gij) and the Christoffel Symbols (Γkij). These symbols describe the intrinsic curvature of the space. All numerical computations are performed on the GPU via a dedicated compute shader (geodesic.glsl), which uses a highly stable 4th-Order Runge-Kutta (RK4) integration to solve the geodesic differential equations in real-time.

 

The Conformal Factor (Λ) & Hyperbolic Spaces

For advanced topologies, you can inject a Conformal Factor (Λ). This mathematically scales the metric tensor isotropically, allowing you to simulate non-Euclidean geometries completely inside a standard 3D Euclidean space (R3).

A prime example is the Poincaré Ball model of hyperbolic geometry. By defining the ambient space simply as the interior of a standard 3D solid sphere, and applying a conformal factor that approaches infinity at the boundary—such as 1 / (1 - r2)2—the geodesics are naturally forced to curve sharply inward. The RK4 integrator will trace the classic circular arcs characteristic of hyperbolic space without requiring explicit parametric definitions for those curves.

 

Script & Equations: who decides

A geometry can be driven by both the Script dock and the Equations dock at the same time. A common case is a metric-tensor script (one that ends with return mat3(...) to define the metric gij directly) whose initial conditions are also present in the Geodesic Flow fields. When the two panels disagree, the rule is simple:

The Equations dock always wins.

A script's := directives—the limits (u_min, u_max, …), the constants (AF, S), and the geodesic initial conditions (U, V, W, dU, dV, dW, Conform)—only fill in fields that are still empty. They never overwrite a value already present in the dock, whether you press Run from the Equations dock or from the Script dock, and whether you are loading a preset or running manually. As a result both Run buttons produce the same surface and the same animation, and edits you make in the dock after loading are never reverted by re-running the script.

The directives therefore behave as defaults / first-load seeds: a freshly written script with empty dock fields still populates them on its first Run. To change a value that is already filled, edit the corresponding field in the Equations dock—the panels are not auto-synced back into the script source.

Note on steps: a steps := N; line in a script is not applied to the resolution. The mesh resolution is governed exclusively by the Steps slider (seeded from the preset's saved value when you load it). This lets you drag the slider freely without a re-run snapping it back to the scripted number; the directive is kept in the source only as a note of the author's intended value.

Technical Note: Because geodesic integration calculates multiple micro-steps per vertex using RK4, extremely high grid resolutions combined with steep conformal gradients may impact your CPU's performance. The engine includes an automatic singularity detection system that will safely halt the calculation if a geodesic escapes to infinity or hits a mathematical pole.
Warning: The numerical integration may fail if the input data is incorrect, physically impossible, or pushes the curve outside the valid domain. If the engine encounters a mathematical singularity, the generation will be safely aborted. Always carefully review your starting coordinates, vectors, and conformal factor.

← Parametric Equations  ·  Contents  ·  Implicit Surfaces (Ray Marching) →