Skip to main content

laman

A deterministic 2D geometric constraint solver in pure Rust, for Rust and Python, built to be trusted.

laman is a library for sketchers, code-CAD tools, mechanism designers and anything else that places points, lines, circles and arcs under geometric and dimensional constraints. Its aim: the permissively licensed sketch solver Python does not have, built from the same Rust core as the crate; diagnostics in the caller's own ids and tags (the exact remaining degrees of freedom, per entity, and the constraints to blame when a sketch cannot be satisfied); dragging that keeps the solution the user is on and returns the same bits on every platform; and every solve re-checkable by an independent verifier that shares no code with the solver. MIT OR Apache-2.0.

Status

Early. The sketch solver is being built in the open (SEED.md is the charter). In Python you can build a sketch, solve it, drag it, read every diagnostic and re-check the result; the package also holds the combinatorial core the project is named after, the generic rigidity count of a bar framework in the plane.

// A square flexes: one internal freedom. A diagonal makes it rigid,
// and a second diagonal is redundant.
let bars = [(0, 1), (1, 2), (2, 3), (3, 0), (0, 2), (1, 3)];
let r = laman::rigidity(4, &bars[..4]).unwrap();
assert_eq!(r.dof, 1);
let r = laman::rigidity(4, &bars).unwrap();
assert_eq!(r.dof, 0);
assert_eq!(r.redundant, vec![5]);
import laman
from laman.check import check

# A triangle from its three side lengths (50, 30, 40): the origin is
# fixed and the first side lies along the x axis.
sk = laman.Sketch()
a = sk.point(0, 0, fixed=True, tag="origin")
b = sk.point(40, 5)
c = sk.point(10, 30)
ab = sk.line(a, b)
sk.horizontal(ab)
sk.distance(a, b, 50, tag="base")
sk.distance(a, c, 30, tag="left")
sk.distance(b, c, 40, tag="right")

solution = sk.solve()
assert solution.status is laman.Status.FullyConstrained
assert solution.diagnostics.dof == 0
assert abs(solution.coordinates[(b.id, "x")] - 50) < 1e-9
assert abs(solution.coordinates[(c.id, "y")] - 24) < 1e-9
assert check(sk, solution.coordinates).is_clean()  # re-checked, independently

The generic rigidity count of a bar framework is laman.rigidity:

import laman

r = laman.rigidity(4, [(0, 1), (1, 2), (2, 3), (3, 0), (0, 2), (1, 3)])
assert r.dof == 0 and r.redundant == [5]
cargo add laman
pip install laman

The name

laman is named after Laman's theorem (G. Laman, On graphs and rigidity of plane skeletal structures, 1970), which says exactly when points joined by rigid bars in the plane are rigid: 2n − 3 bars for n points, and no subset of k points carrying more than 2k − 3 of them. Counting the freedom that remains, and saying where constraints are missing or in excess, is what this constraint solver is for. The name implies no endorsement by Laman or his estate.

Licence

Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Metadata

Release files for laman 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for laman 0.2.0
File Size Uploaded Provenance Actions
laman-0.2.0.tar.gz 296.4 kB With provenance Details for laman-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for laman 0.2.0
File Actions
laman-0.2.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for laman-0.2.0-cp310-abi3-win_amd64.whl
laman-0.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for laman-0.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
laman-0.2.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for laman-0.2.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
laman-0.2.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for laman-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
laman-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for laman-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 5.1 MB

Release files / laman-0.2.0.tar.gz

Download URL laman-0.2.0.tar.gz
Size 296.4 kB
Tags Source
SHA-256 checksum
How to use checksums
328aaf39b32b720121dd638711f447c17bf1c505e322febf5fd405fe74a11701
BLAKE2b-256 checksum
How to use checksums
7b9e7abd149e25dbf9ae4228497ca3abe0e35a2b2aa8414ef5895a9da07c73e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / laman-0.2.0-cp310-abi3-win_amd64.whl

Download URL laman-0.2.0-cp310-abi3-win_amd64.whl
Size 857.8 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2967728dd6f42fa113e7405c244f6a76580299882f330b3074b0c5f69adf3017
BLAKE2b-256 checksum
How to use checksums
04f027f176c9d8ff97e6e8e299fcc40f690136ddb460883aabb149a986aca59e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / laman-0.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL laman-0.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
d0387e9c4b84cd592e49a27dcab62274a7cf4f239bbf45e3db6138a3129db479
BLAKE2b-256 checksum
How to use checksums
5a1d95e51cee974209dece329a90b417db099e7d783e06755ff50610182e6c37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / laman-0.2.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL laman-0.2.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 993.6 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
9e18aff691d94dfeafc548b64b05555e85a45ad19675f085f10b1866b538582c
BLAKE2b-256 checksum
How to use checksums
65c02f45a4762d1b3db36cc3462167f7389a6b9c76906649add998bc16973a6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / laman-0.2.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL laman-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Size 918.4 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
674264c3c056828b494d12b2c964684146176b8552f49fec680c09a0da6c417a
BLAKE2b-256 checksum
How to use checksums
3f8d7c030c0a1b05817148b5081f3ab279ac1d7b4ad25ad84a3a4a52cc003dd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / laman-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL laman-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 982.1 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
38762c2556a559c2c911ce37deb179caaf8b24c17e0b17e2be809dc94e5f44c3
BLAKE2b-256 checksum
How to use checksums
5ec8a56c3c03e5b2653fd1059ecdb0db0df43d296acf4a670b7d946dee8be66a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for laman 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for laman-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page