Generating and Rendering Minimal Surfaces

An interactive mathematical blog with executable JavaScript and Canvas 2D demonstrations, shaded geometry, projected shadows, and downloadable Costa surface samples.

A smooth minimal surface has H=(k₁+k₂)/2=0: it is stationary for area, not necessarily globally area-minimizing or stable. At a nonflat point k₁=−k₂, so Gaussian curvature is nonpositive. Different classes overlap: topology, periodicity, embeddedness, and construction method describe different properties.

A shared rendering pipeline

Every example returns vertices and triangle indices. The renderer centers and uniformly scales the mesh, rotates it, computes face normals, projects to the canvas, depth-sorts triangles, and applies ambient, diffuse, and specular shading. Projected silhouettes on a ground plane provide softened shadows. An exact smooth parametrization still becomes a polygonal approximation on screen.

Drag to rotate; scroll or pinch to zoom. Toggle automatic rotation, mesh lines, and shadows. Collapse the controls with the small button. Reduced-motion preferences disable automatic rotation initially. Only visible panels are redrawn.

Canvas 2D uses painter’s ordering, not a per-pixel depth buffer. Overlapping or intersecting triangles can show ordering artifacts. Shadows are geometric ground projections with artistic blur, not self-shadowing or shadow maps. For correct self-occlusion and self-shadowing use a WebGL depth-buffer and shadow-map renderer.

1. Catenoid: a surface of revolution

Exact parametrization

Revolve a catenary: X(u,v)=(cosh(v)cos(u), cosh(v)sin(u), v). The angular seam is welded; the two ends are clipped.

2. Helicoid: a ruled minimal surface

Exact parametrization

Use X(u,v)=(v cos(u),v sin(u),0.45u). Constant-u curves are straight lines; rotation and vertical translation generate a screw-like surface.

3. Enneper: polynomial minimal geometry

Exact parametrization; possible self-intersections

Use X(u,v)=(u−u³/3+uv², v−v³/3+u²v, u²−v²). The polynomial coordinates are inexpensive to sample. Minimality does not imply embeddedness.

4. Weierstrass: generalized Enneper surfaces

Exact analytic family

Choose g(z)=zᵐ and ω=2dz, and integrate Φ=((1−g²)/2, i(1+g²)/2, g)ω. This demo uses m=2: X=Re(z−z⁵/5, i(z+z⁵/5), 2z³/3). General data need regularity and period checks.

5. Associate family: catenoid to helicoid

Locally exact; do not weld the angular edges

Combine X=(cosh(v)cos(u),cosh(v)sin(u),v) and its conjugate Y=(sinh(v)sin(u),−sinh(v)cos(u),u) as cos(θ)X+sin(θ)Y. The demo uses θ=π/4. Local minimality does not guarantee global closure.

6. Björling: prescribe a curve and its normal

Exact analytic example

Given analytic c and perpendicular unit normal n, use X=Re[c(z)−i∫n×c′ dz]. For c(t)=(0,0,t), n(t)=(cos(kt),sin(kt),0), the result is (sin(ku)sinh(kv)/k,−cos(ku)sinh(kv)/k,u). Here k=1.4. This is a helicoid; arbitrary curves require analytic continuation and integration.

7. Scherk: an exact minimal graph

Exact graph patch

Use z=log(cos(y)/cos(x)) on |x|,|y|<π/2. The sampled patch stops at 1.30, before the vertical asymptotes. It solves the nonlinear minimal graph equation.

8. Plateau: numerical boundary-spanning surfaces

Numerical area minimization within graphs

Fix the x,y coordinates and wavy boundary heights of a square grid. Optimize the free z coordinates to reduce total triangle area. The line search accepts decreasing steps. This is a fixed-topology graph problem, not a general topology-changing Plateau solver.

9a. Schwarz P: a periodic approximation

Nodal approximation, not exact minimality

Extract cos(x)+cos(y)+cos(z)=0 in one 2π cell using marching tetrahedra. Refining the mesh improves this level-set approximation but does not make its mean curvature identically zero.

9b. Schwarz D: a periodic approximation

Nodal approximation, not exact minimality

Extract sin(x)sin(y)sin(z)+sin(x)cos(y)cos(z)+cos(x)sin(y)cos(z)+cos(x)cos(y)sin(z)=0. Periodic boundary matching is required when assembling multiple cells.

9c. Gyroid: a periodic approximation

Nodal approximation, not exact minimality

Extract sin(x)cos(y)+sin(y)cos(z)+sin(z)cos(x)=0. The displayed cell is cut open at its boundaries. Changing the threshold generally does not preserve minimality.

10. Higher genus: render a validated mesh

Costa’s surface: a genuine genus-one minimal surface, represented by numerical triangulations.

Exact higher-genus constructions need appropriate Riemann-surface data and solved global period conditions, not an arbitrary torus formula. Costa’s surface is an embedded genus-one minimal surface with three infinite ends. The samples below were generated numerically from the elliptic-function parametrization in Andrej Bauer’s published Costa-surface notebook.

Each mesh trims its three ends to finite size while retaining the central handle. Topologically, it is a genus-one surface with three boundary loops. These are polygonal approximations of a smooth minimal surface, not certified discrete minimal meshes.

Download or load a Costa sample

Start with the lightweight mesh for faster Canvas rendering. The detailed mesh provides finer geometry and a smoother silhouette. Both JSON files are embedded in this page: downloading or loading them requires no server or internet connection.

SampleVerticesTrianglesSizeActions
Lightweight1,5152,960106 KBDownload JSON
Detailed3,8897,682286 KBDownload JSON
  1. Click “Download JSON” and save the chosen sample.
  2. Click “Import JSON” below and select that file, or click “Load in viewer” to display the embedded sample directly.
  3. Drag to rotate; scroll or pinch to zoom. Toggle Mesh or Shadow to inspect the geometry.

Validation and limitations

Both samples were checked for finite coordinates, valid indices, nondegenerate triangles, manifold edge incidence, and boundary loops. Each has genus one, three boundary loops, and Euler characteristic χ=−3. These structural checks do not certify smooth minimality, embeddedness, or discrete area stationarity.

A finite-difference sanity check of the underlying smooth parametrization at 40 points gave a maximum absolute mean-curvature residual of approximately 1.25 × 10⁻⁷. This is not a proof about the triangular meshes. The infinite ends have been deliberately clipped, and the Canvas renderer has the same occlusion and shadow limitations discussed above.

Background: Costa Minimal Surface, Wolfram MathWorld.

Mesh interchange format

{
  "vertices": [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]],
  "faces": [[0, 1, 2]]
}

This tiny example illustrates syntax only, not a higher-genus surface. Indices start at zero. Optional metadata is ignored by the renderer. Both Costa downloads already use the expected format.

Verification beyond a convincing picture

For a regular parametrization compute H=(eG−2fF+gE)/(2(EG−F²)) from the first and second fundamental forms, and check Xu×Xv≠0. For a regular implicit level set compute H=½ div(∇F/|∇F|). Check convergence under refinement. For Weierstrass data, global single-valuedness requires Re ∮Φ=0, or the intended lattice translations for a periodic surface. Closure, embeddedness, stability, and zero mean curvature are separate questions.

Implementation notes

The complete dependency-free JavaScript is embedded below in this document’s source. Reuse parametric() for explicit coordinates, implicitMesh() for level sets, solveGraph() for the numerical graph demonstration, and Viewer for rendering. The periodic examples use marching tetrahedra. The higher-genus renderer accepts externally generated meshes and also loads the embedded Costa samples.