GeomSolver/WASM Interactive Demo
Back to Home

WASM Interactive Demo

Rust + WASM — 47+ constraints, 10 entities, 4 solvers, sparse CG, propagation, multi-start, diagnostics, drag mode

Sketch Canvas

FixedFree (unsolved)SolvedArcEllipseHyperbolaParabola

Example Sketches

Solver Configuration

JSON API

solve_sketch(systemJson) (simple) & solve_sketch_v2(requestJson) (full config + DOF + diagnostics)

// No example selected. Click an example above.

Solver Capabilities

Levenberg-Marquardt
Damped least-squares with Armijo backtracking. Dense + sparse variant.
Algorithm
DogLeg (Powell)
Trust-region: interpolates steepest descent and Gauss-Newton steps.
Algorithm
BFGS Quasi-Newton
Inverse Hessian approximation with strong Wolfe line search + zoom.
Algorithm
L-BFGS Solver
Limited-memory BFGS with two-loop recursion. O(mn) memory. Auto for n>=100.
Algorithm
Sparse CG Solver
CSC Jacobian, SpGEMM for JᵀJ, CG with Jacobi preconditioner. O(nnz).
Algorithm
Constraint Propagation
20 rules deduce variable values without iteration. Instant for fully-deducible.
Feature
Multi-Start
Random perturbation restarts. Keeps best solution across all starts.
Feature
Subsystem Decomposition
Union-Find splits independent constraint groups. Solve each separately.
Feature
Parameter Reduction
Eliminates Coincident, Horizontal, Vertical, EqualRadius, Concentric.
Feature
Fallback Chain
Auto-tries all algorithms if primary fails. Primary → fallback₁ → fallback₂.
Feature
DOF Analysis
Algebraic + QR rank-based. Detects under/over/full constraint, redundant & conflicting.
Diagnostics
Convergence Tracking
Per-iteration max residual and cost history. Per-constraint residual breakdown.
Diagnostics
Geometric Validation
Detects negative radius, zero-length lines, degenerate arcs/ellipses.
Diagnostics
JSON + Binary Serialization
Full round-trip: to_json/from_json, to_bytes/from_bytes, file save/load.
Feature
Python Bindings
PyO3/maturin wheel: geom_solver. Full API: entities, constraints, solve, DOF.
Binding
WASM Bindings
wasm-bindgen: solve_sketch() and solve_sketch_v2() JSON APIs. Runs in browser.
Binding
Warm Start / Drag Mode
solve_with_warm_start() reuses previous solution. solve_drag() fixes a variable.
Feature
Undo / Redo
Full System state snapshots with batch nesting. Auto-checkpoint before mutations.
Feature

Constraint Quick Reference