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 exact remaining degrees of freedom of a sketch, the constraints to blame when it cannot be satisfied, smooth interactive dragging, and the same bits on every platform, under MIT OR Apache-2.0.

Status

Early. The sketch solver is being designed and built in the open (SEED.md is the charter). This release 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

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.0.1

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.0.1
File Size Uploaded Provenance Actions
laman-0.0.1.tar.gz 11.0 kB Without provenance Details for laman-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for laman 0.0.1
File Interpreter ABI Platform Actions
laman-0.0.1-cp310-abi3-manylinux_2_34_x86_64.whl CPython 3.10 abi3 Linux glibc 2.34+ x86-64 Details for laman-0.0.1-cp310-abi3-manylinux_2_34_x86_64.whl

Total release size: 285.5 kB

Release files / laman-0.0.1.tar.gz

Download URL laman-0.0.1.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f0b889384ca686264937c45544ee9a1f937c4bd8dbce3e366c3ad0f0c2dc0dd3
BLAKE2b-256 checksum
How to use checksums
6088e030f3fe5c7423655fd9494756ea424d430dd135013b24ddcca65b32d800
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / laman-0.0.1-cp310-abi3-manylinux_2_34_x86_64.whl

Download URL laman-0.0.1-cp310-abi3-manylinux_2_34_x86_64.whl
Size 274.5 kB
Tags CPython 3.10 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
d02d7f5dcd9bbbef86ebbca5d98b9f6d82c3277b8b78e86fddb84fa700bb0283
BLAKE2b-256 checksum
How to use checksums
4d6c69b47b6e6de78cdb4e03f292fc25f2ec888a1dca89900c9090662927e5b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for laman 0.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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