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.1.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.1.0
File Size Uploaded Provenance Actions
laman-0.1.0.tar.gz 211.5 kB With provenance Details for laman-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for laman 0.1.0
File Actions
laman-0.1.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for laman-0.1.0-cp310-abi3-win_amd64.whl
laman-0.1.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.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
laman-0.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for laman-0.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
laman-0.1.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for laman-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
laman-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for laman-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 4.3 MB

Release files / laman-0.1.0.tar.gz

Download URL laman-0.1.0.tar.gz
Size 211.5 kB
Tags Source
SHA-256 checksum
How to use checksums
aad05ad639bd6433a46c5ef229afd104f7199a1077136cd3090d560087eb84dc
BLAKE2b-256 checksum
How to use checksums
51cd59fba2d54dfce0250c9f92a9d2cb845b5490bfcb1472c73f15093d4fd36a
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 3, 2026.

Transparency log

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

Download URL laman-0.1.0-cp310-abi3-win_amd64.whl
Size 715.3 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c837d8e86dbff16c4bb13237a96fde5e5a34148dbcf9d8c224cf5ce63261859f
BLAKE2b-256 checksum
How to use checksums
9db0b54119678b0f966f81253f42d2405c228e20b7b48c0c5e9810f9e8f69951
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 3, 2026.

Transparency log

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

Download URL laman-0.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 887.1 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
730c9c245fb7a1357c2f12f832ca9fe77b042af7d3c404e1a6f44eaca98b05cc
BLAKE2b-256 checksum
How to use checksums
54d62e527972547b830a24b82f0033be8d4e928f38c05a50e2724ad656ce7947
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 3, 2026.

Transparency log

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

Download URL laman-0.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 854.8 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
42b94f55d688bd03cb6218dfa3435d4a4b54c3ebda18d88e22e00d7dddf3f4dc
BLAKE2b-256 checksum
How to use checksums
2967206bb6c3111a60607593a298e3e8de8709c945e3a36da37ab9c953752843
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 3, 2026.

Transparency log

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

Download URL laman-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Size 789.1 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
004cf9dd93ae602c7d023d3dd1da41a6972342272ed37f25a3b3f1c86831a8fc
BLAKE2b-256 checksum
How to use checksums
3e834dadac9010c1849a43250941fc637b5fa8252bbc8f593daca8390989eb1d
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 3, 2026.

Transparency log

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

Download URL laman-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 841.4 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c79de0c33118b47ac1d7aa0092e73b1e9c6af4f776f5ca86b22a6a059fe228d2
BLAKE2b-256 checksum
How to use checksums
59ef8a90b2636887d0d40de1af3cbf4d1c885fb2db0b04246ef33736f92e5bf8
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 3, 2026.

Transparency log

Security for laman 0.1.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.1.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 3, 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