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 checker 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 where its curves cross, and re-check both; 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.4.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.4.0
File Size Uploaded Provenance Actions
laman-0.4.0.tar.gz 453.0 kB With provenance Details for laman-0.4.0.tar.gz

Built distributions (wheels)

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

Total release size: 7.0 MB

Release files / laman-0.4.0.tar.gz

Download URL laman-0.4.0.tar.gz
Size 453.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b94d218be4ed60cb8188e2d6bb8d09f345492cf7dc5ca54fe744aa36700eb8d7
BLAKE2b-256 checksum
How to use checksums
364d4982caa6b87143b48ab3a01edc46b5a1f8d20b81e18a438a1f63668fe74f
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 18, 2026.

Transparency log

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

Download URL laman-0.4.0-cp310-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1a5071fa1108cb18f7b2c48ae10c93c5ac8b1864ba421a3824ddcf0cdb8a45ca
BLAKE2b-256 checksum
How to use checksums
499ee3cca9277b27d0d4e7fb819f4b587ab47bba7f25094ef0665ec4c0f7ce9d
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 18, 2026.

Transparency log

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

Download URL laman-0.4.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.4 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
9ab3365bfdbe9b6617ef3ace84ee3f3117e6f019a8bb095485be0a283e348ab4
BLAKE2b-256 checksum
How to use checksums
07948b7fe442042e62bd3fba088f8526d794319d41cd8533bdc389f5b4455bef
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 18, 2026.

Transparency log

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

Download URL laman-0.4.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
305ae4008965830ed83d77730c74d4c234ca055acdcd6ab7d7e0ac8388306811
BLAKE2b-256 checksum
How to use checksums
6a7d1daf0bdc1edf5acbc1fe08a8df1fc7e8a070218f26dfe4a96ef579f42794
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 18, 2026.

Transparency log

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

Download URL laman-0.4.0-cp310-abi3-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
94082a4a8d6fa2234c4be981d38a48427f7811b16d2a7a6148e8b5183597b560
BLAKE2b-256 checksum
How to use checksums
ffafe06563779d4cf5aa5dbb5ba8ec1a2800cb44ae3aadcf453a0192ca19b78f
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 18, 2026.

Transparency log

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

Download URL laman-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 1.4 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f8cfc2edb951006371db30624185a8aa4ba4acd0c5d6d06e008883a67a2789d2
BLAKE2b-256 checksum
How to use checksums
28a17b8344c5f5e79e6ba20ea065adee0129af76ec98e32c3fb620c94680fe41
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 18, 2026.

Transparency log

Security for laman 0.4.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.4.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 18, 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