Open-source geometric constraint solver
  • Rust 98.7%
  • Just 0.8%
  • Python 0.2%
  • JavaScript 0.2%
Find a file
Adam Chalmers c002a1d204
Release 0.2.16 (#222)
Fixed:

 - More stable math for point-on-arc constraint (#221)
2026-01-27 16:16:19 -06:00
.cargo Add a profile for cargo mutants (#216) 2025-12-30 16:45:51 +00:00
.github/workflows CI: Add cargo-semver-checks (#205) 2025-12-23 22:24:50 +00:00
ezpz-cli New simple interface for getting solved geometry (#208) 2025-12-23 20:51:44 -06:00
ezpz-wasm Refactor datatypes module for consistency (#209) 2025-12-24 03:03:22 +00:00
fuzz Rename solve_with_priority to just 'solve' (#207) 2025-12-24 02:19:22 +00:00
kcl-ezpz Release 0.2.16 (#222) 2026-01-27 16:16:19 -06:00
test_cases [BUG]: Point on arc changes when constrained even with good initial guesses (#221) 2026-01-27 14:46:40 -06:00
.gitignore Update .gitignore to include mutants.out.old 2025-12-23 10:42:45 -06:00
_typos.toml Move newton-faer fork into this repo (#45) 2025-09-02 20:51:05 +00:00
AGENTS.md Increase test coverage (#151) 2025-11-21 21:59:29 +00:00
Cargo.lock Release 0.2.16 (#222) 2026-01-27 16:16:19 -06:00
Cargo.toml Add a profile for cargo mutants (#216) 2025-12-30 16:45:51 +00:00
CHANGELOG.md Release ezpz and newton-faer 0.1.3 (#126) 2025-10-22 13:52:39 +00:00
clippy.toml Replace more f64 calls with libm (#171) 2025-12-11 16:03:32 -06:00
CONTRIBUTING.md Add README for the main ezpz crate (#206) 2025-12-23 19:57:48 -06:00
justfile Add more tests (#215) 2025-12-30 16:25:38 +00:00
LICENSE Add LICENSE file (MIT) (#174) 2025-12-11 22:47:13 +00:00
pr-desc.md [BUG]: Point on arc changes when constrained even with good initial guesses (#221) 2026-01-27 14:46:40 -06:00
README.md Fix markdown formatting in READMEs 2025-12-23 21:16:49 -06:00
symbolic solver plan.png Compile to WASM (#4) 2025-08-21 20:00:05 -05:00

EZPZ

Constraint solver for use in Zoo Design Studio, or wherever you want to use it.

Overview

This project has 3 Rust crates:

  • kcl-ezpz: The core constraint solver library. This is the primary crate for ezpz.
  • ezpz-cli: A CLI tool that lets you easily solve, analyze and benchmark constraint systems using kcl-ezpz.
  • ezpz-wasm: A WebAssembly library that wraps kcl-ezpz and exposes a few core functions. Intended for the ezpz maintainers to check if kcl-ezpz compiles and works in WebAssembly, and to benchmark its performance vs. native code.
  • Users probably won't need to use this library yourself, it's really intended as a sample application for the maintainers to test with.
  • Users should probably integrate kcl-ezpz into your web projects directly.

Development

New developers should read CONTRIBUTING.md

Using the CLI

The CLI lets you pass a constraint problem file (described below) and analyze it, solve it, visualize the solution and benchmark how long it took.

Here's a quick video demo:

https://github.com/user-attachments/assets/adbd223f-cfc1-4f5a-8b2c-84352862e02a

First, install it. From this repo's root, run:

cargo install --path ezpz-cli

Then you can use it like this, by passing it a constraint problem file:

$ ezpz --filepath myconstraints.md
Problem size: 2000 rows, 2000 vars
Iterations needed: 2
Solved in 2943μs (mean over 100 iterations)
i.e. 339 solves per second

You can also add the --gnuplot option to visualize the resulting points in a gnuplot window, or --gnuplot-png-path points.png to write the visualization to a PNG at the given path instead. If you'd rather print the final points to stdout and process them in your own tool, use --show-points instead.

Constraint problem files

ezpz defines a text format for writing out constraint problems. You don't have to use this format -- you can use the Rust library directly -- but it's a very convenient format. It looks like this:

# constraints
point p
point q
p.x = 0
p.y = 0
q.y = 0
vertical(p, q)

# guesses
p roughly (3, 4)
q roughly (5, 6)

There's two sections, Constraints and Guesses. You define each point (like p and q) and once defined, you can write constraints that use them. For example, you can fix a point's X or Y component (p.x = 0). Or you can relate two points, e.g. vertical(p, q).

For more examples, see the test_cases/ directory.