Fortune & Theory

C++ · geometry · executable theory

Inside
the sweep.

The diagram is the result.
The interesting work happens between events.

A geometry workbench that exposes the changing beachline, the tree beneath it, and the numerical decisions that keep them consistent.

Explore Fortune's sweep

Runs in your browser · C++ compiled to WebAssembly

Geometry / events / structureInspect the state
The geometry and structure of a sweep event A schematic joins parabolic beachline arcs, a pending circle event and an ordered tree. It illustrates the linked views; it is not a captured execution. SWEEP LINENEXT EVENT ↓ PENDING CIRCLE EVENTNeighbors determine its validity. THE SAME ORDER, IN A TREE Split · remove · rebalanceThreaded neighbors stay in order. Open the working system
Schematic · the working application opens from this view.

Three entry points

Follow a difficult transition.

Each route opens a specific setup
in the same workbench.

Inside the implementation

Geometry and structure
have to agree.

A beachline has two simultaneous orders: the tree's in-order traversal and its threaded neighbors. Splits, removals and rotations must preserve their agreement.

Arcs on leavesLeaf AVL
Arcs on every node
AVLRed-blackTreapSplaySize-balanced
One geometric obligation. Six backends.

Different balancing behavior supplies differential evidence. Recorded mutations and structural checks make a mismatch traceable.

Evidence before a polished result

Keep the failure visible.

Raw construction / reference

The raw sweep edges remain distinct from the independently clipped final diagram. Reference-final mode can correct the display; it does not prove the sweep succeeded. Their disagreement is a useful result.

The formula behind a comparison

Expression graphs retain geometric constructions while predicate views expose numerical evaluation and unresolved decisions. Formula preservation and filtered comparisons do not constitute certified exact arithmetic. This WebAssembly build provides 53-bit double and 113-bit software long double significands; wider evaluation still does not certify geometric predicates.

A harder construction, qualified

The weighted-diagram investigation caches analytic pairwise information incrementally. DCEL topology is reassembled globally. It remains an incomplete paper-based construction with explicit numerical fallbacks.

Checked in this edition. The native core test suite and 26 WebAssembly signature groups passed. These checks provide regression evidence for the covered cases; they do not establish correctness for every degeneracy.

The browser edition

A focused window into
the C++ application.

The main sweep and weighted-geometry routes are accompanied by selected theory views. This edition does not claim parity with every desktop laboratory.

  • Desktop 3D GLSL 330 volume views and threaded laboratories are omitted.
  • The original Crystal/SFML executable remains a separate project archive.
  • Snapshot playback is instrumentation, not an algorithm-throughput benchmark.
  • Known degeneracies and unresolved predicates remain part of the investigation.

Origins

From a Crystal prototype
to a geometry workbench.

The original visualizer joined the moving beachline to its underlying tree. The C++ project expands that idea through multiple backends, recorded mutations and explicit comparisons.

I wrote the original Crystal implementation and the main C++ tree and beachline infrastructure without AI assistance.

View the earlier Crystal project
Start with the mechanism.Open Fortune & Theory