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, read its profiles and re-check them; 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 closed outlines of a sketch and the holes in them are its profiles:
import math
import laman
from laman.check import check_profiles
from laman.profile import profiles
# A 40 x 30 plate with a round hole of radius 5.
sk = laman.Sketch()
corners = [sk.point(x, y) for x, y in [(0, 0), (40, 0), (40, 30), (0, 30)]]
for i in range(4):
sk.line(corners[i], corners[(i + 1) % 4])
sk.circle(sk.point(20, 15), 5)
found = profiles(sk, sk.coordinates())
(plate,) = found.profiles
assert plate.outer.signed_area == 1200 # counter-clockwise: positive
assert len(plate.holes) == 1 and plate.holes[0].signed_area < 0
assert abs(plate.net_area - (1200 - 25 * math.pi)) < 1e-9
assert check_profiles(sk, sk.coordinates(), found).is_clean() # re-measured
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.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| laman-0.3.0.tar.gz | 362.9 kB | With provenance | Details for laman-0.3.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| laman-0.3.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for laman-0.3.0-cp310-abi3-win_amd64.whl |
| laman-0.3.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.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| laman-0.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details for laman-0.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| laman-0.3.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for laman-0.3.0-cp310-abi3-macosx_11_0_arm64.whl |
| laman-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for laman-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 6.0 MB
Release files / laman-0.3.0.tar.gz
| Download URL | laman-0.3.0.tar.gz |
|---|---|
| Size | 362.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db49835b1b8c27f743bdc827d53c2b26c66bae697e2fdaacc16b92d5cd8e34fe
|
|
BLAKE2b-256 checksum How to use checksums |
2c10fe07aa139c23c1c1d5b51d17304094dfbfa10156c54bce734e97b900f954
|
| 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 8, 2026.
Transparency logRelease files / laman-0.3.0-cp310-abi3-win_amd64.whl
| Download URL | laman-0.3.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c3e3826332675e6a6ccd8254646cf5612bb511ee30dc5c44352efbe50635419c
|
|
BLAKE2b-256 checksum How to use checksums |
fbede73daa2e33bfcbb4c39b341347064bc6dc071feba4f6cef39f9bee6ca991
|
| 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 8, 2026.
Transparency logRelease files / laman-0.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | laman-0.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
61aa4651d7596a9f2e00778e846e7928a462edc0757a4b85cf5f305f91151809
|
|
BLAKE2b-256 checksum How to use checksums |
b8143315bce2b58da1d11f455adbec270e7bcfe1d4db50a4ae940f639005bd7a
|
| 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 8, 2026.
Transparency logRelease files / laman-0.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | laman-0.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
644c7f23662976a72c88fbee231c9805d5bf4d504a8da94f8736f66ca8c73d85
|
|
BLAKE2b-256 checksum How to use checksums |
022a4d4674e473519ee9ef5ccae2330bf8532c6679b4cd8238493033760168e6
|
| 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 8, 2026.
Transparency logRelease files / laman-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | laman-0.3.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
aac553b4242c06f905716cb838ec80ff977b0ec801426c03ecbe8ef30ca4b970
|
|
BLAKE2b-256 checksum How to use checksums |
eceaaface8f674570b9edde4c78c3132e5ae4ca1d9c757db0b95da1fbcf3c495
|
| 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 8, 2026.
Transparency logRelease files / laman-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | laman-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
ccd587cca7548ddedc3ba4a28b7086c701116d75ffdb86efaf545a317a2185e1
|
|
BLAKE2b-256 checksum How to use checksums |
7d8f5ef5f3a76319d556fabe7207edc2a7b5f53d5bf62f04cd6b12664738eedb
|
| 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 8, 2026.
Transparency logSecurity for laman 0.3.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.
Attestation for laman-0.3.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 8, 2026.
Transparency logA 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.