Skip to main content

Manifold wrapper for COMPAS: robust, guaranteed-manifold mesh booleans.

Project description

compas_manifold

build

Robust, guaranteed-manifold mesh boolean operations for COMPAS, powered by the Manifold library and bound with nanobind.

Manifold uses its own robust geometric predicates and always returns a valid, watertight, oriented 2-manifold — no exact kernel to opt into, no precision crashes on degenerate input.

Quickstart

Needs uv and a C++17 compiler. Manifold is fetched and compiled automatically — no extra setup.

git clone https://github.com/petrasvestartas/compas_manifold.git
cd compas_manifold

uv venv --python 3.12
source .venv/Scripts/activate    # Git Bash on Windows  (Linux/macOS: source .venv/bin/activate)

uv pip install nanobind "scikit-build-core[pyproject]" cmake ninja
uv pip install --no-build-isolation -ve ".[dev]"

python docs/examples/example_booleans.py

Run the tests with pytest tests. More options in docs/installation.md.

Usage

from compas.geometry import Box, Sphere, Polyhedron
from compas_manifold.booleans import (
    boolean_union_mesh_mesh,
    boolean_difference_mesh_mesh,
    boolean_intersection_mesh_mesh,
    split_mesh_mesh,
)

A = Box(2).to_vertices_and_faces(triangulated=True)
B = Sphere(1.0, point=[1, 1, 1]).to_vertices_and_faces(u=32, v=32, triangulated=True)

V, F = boolean_difference_mesh_mesh(A, B)
shape = Polyhedron(V.tolist(), F.tolist())

Whole-pipeline booleans (evaluated in C++)

Keep every intermediate mesh inside C++ and only return the final result:

from compas_manifold.booleans import boolean_chain

# rounded, drilled cube: cube ∩ sphere − cyl_x − cyl_y − cyl_z
V, F = boolean_chain(
    [cube, sphere, cyl_x, cyl_y, cyl_z],
    ["intersection", "difference", "difference", "difference"],
)
Function Description
boolean_union_mesh_mesh(A, B) Union of two meshes
boolean_difference_mesh_mesh(A, B) Difference A - B
boolean_intersection_mesh_mesh(A, B) Intersection of two meshes
split_mesh_mesh(A, B) Split A with B
boolean_*_mesh_mesh_with_polygons(A, B) (V, F, P) with coplanar-face ids (merge triangles into n-gons)
merge_coplanar_faces / coplanar_polygons / coplanar_outline_edges recover polygonal faces (with holes) & clean outlines
boolean_chain(meshes, operations) Left-folded chain of ops, in C++
boolean_batch(meshes, operation) Single op over many meshes (BatchBoolean)
boolean_chain_with_face_source(meshes, operations) Chain + per-face source tracking
boolean_difference_mesh_meshes(A, Bs) Subtract many cutters from A in one batch

Documentation

License

compas_manifold is released under the Apache License 2.0, matching the Manifold library it wraps. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

compas_manifold-0.1.0.tar.gz (529.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

compas_manifold-0.1.0-cp312-abi3-win_amd64.whl (243.4 kB view details)

Uploaded CPython 3.12+Windows x86-64

compas_manifold-0.1.0-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (595.4 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

compas_manifold-0.1.0-cp312-abi3-macosx_11_0_x86_64.whl (423.6 kB view details)

Uploaded CPython 3.12+macOS 11.0+ x86-64

compas_manifold-0.1.0-cp312-abi3-macosx_11_0_arm64.whl (371.0 kB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

compas_manifold-0.1.0-cp311-cp311-win_amd64.whl (245.5 kB view details)

Uploaded CPython 3.11Windows x86-64

compas_manifold-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (599.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

compas_manifold-0.1.0-cp311-cp311-macosx_11_0_x86_64.whl (425.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

compas_manifold-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (373.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

compas_manifold-0.1.0-cp310-cp310-win_amd64.whl (245.7 kB view details)

Uploaded CPython 3.10Windows x86-64

compas_manifold-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (599.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

compas_manifold-0.1.0-cp310-cp310-macosx_11_0_x86_64.whl (425.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

compas_manifold-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (373.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

compas_manifold-0.1.0-cp39-cp39-win_amd64.whl (245.9 kB view details)

Uploaded CPython 3.9Windows x86-64

compas_manifold-0.1.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (600.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

compas_manifold-0.1.0-cp39-cp39-macosx_11_0_x86_64.whl (426.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

compas_manifold-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (373.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file compas_manifold-0.1.0.tar.gz.

File metadata

  • Download URL: compas_manifold-0.1.0.tar.gz
  • Upload date:
  • Size: 529.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for compas_manifold-0.1.0.tar.gz
Algorithm Hash digest
SHA256 28484b9fb56af41efef964c99c0b4373b570b94055178181d0df2697c3de9d1d
MD5 c22210dd0cc62d39a1cec9f46ad6bfce
BLAKE2b-256 24f0051c2046363f2277d04b0a2d8882ebb877e586ecf917e1c4d5ad53693156

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0.tar.gz:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b8fbfd7592db1079f6be62f9bdff121d1f17c34d9d680266fecbf058401e29a4
MD5 ee4f73968f0d3dbe641987c66370f216
BLAKE2b-256 e6da5fc990fa59b6f58976d785f933b5a39ec34bfcd38e269509cdfeed79b9f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp312-abi3-win_amd64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 38199c7e921c2a883780f312f26066e61d0876a99413589ae4499a4fbbbad494
MD5 d5c450a36f8bf5db64a343e771ecc090
BLAKE2b-256 7f885f356d45e013d6fb34438159ff72b67c8e3357d1f231c006328b147af834

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp312-abi3-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp312-abi3-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 3d10ecd3f727a7e6bc6ab65c53cb21a6788e419f4017882466718675ce8130e4
MD5 4e93a286d5097b36564cd89d7742276c
BLAKE2b-256 c6a3db72f72ba6279d8cd57c4c122460a746baf904cd647a133ad334e37f7862

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp312-abi3-macosx_11_0_x86_64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b9fb0c5cccb69269a6e57e5e3701abe18cc9eaec8605f3fad564d562d85808dd
MD5 d53bebfcf92454eccd43ff84f44c0475
BLAKE2b-256 23dce296fb84282527d5b185036fad06e0df4913d3b2d6bdacc21215578a995a

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4a7bf835499a6fde7ab0b3f86efc80e1035c42e92339a22e10d785e72e877462
MD5 762e6076f2935920d59b21ad83de9dcc
BLAKE2b-256 b998677d9639e4fb35ff8afe9d4df1c9f9e9ca5a07a695147e1ce5c776b4c39c

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 882ab933b4e44b63cb6ab5576921e091598e726a207dea715ff548b8e06a217d
MD5 bb5c51bfee2cc104c045dc5c02b13960
BLAKE2b-256 0bd0d719a8678f26ad0896b8127b48380dfdd13986f5e72fde52f8174a34bdeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c684bdcd36e6aaa4c06cc5cc9247a56301a6150e1d1ee1f0c668d45f38afa712
MD5 4912dc095f99c769cc7218bc4d23e4dc
BLAKE2b-256 1e399ff1ef65d502949ef22669652bddf9cb6ccb8e29d15d24e1fc6f6b8734c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp311-cp311-macosx_11_0_x86_64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e00fbb0f08f9f1e6a168e2a2131779145befba21690bd43253f4b8fb712f8cb
MD5 e21e2399ae21e7b18c5488bd60aee4d6
BLAKE2b-256 727f64e026e4eb23f7acd1ff2e0dd1a3b394c362c57ba7fb2307cc87ddfda144

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 80985eed161168425f35a4ea519d4e1b2f9b80d93773e85abc8d5a31cf295e87
MD5 3770b92668b0fa36d0f70fee3230e704
BLAKE2b-256 c4dec86f3fc091597e33c898e76f6579f90e1038babeca4ecbfcbeb17d131ae5

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp310-cp310-win_amd64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cfb82d36c088464ec0b0e2d008c7200c91f9e994bc6c43c63bfbb8789d51b890
MD5 7bb2db6725d3184d96feaa52302a973c
BLAKE2b-256 a25297c32d24e39b5011246eb7205204cdb50d3e7350ffd7329f17a6943c5b70

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 101f56ac2c12129839bfcf8e3de2316e861828b0dc7de51237fa401b21a1110a
MD5 4214c9f43fe69a98790d0599ad935278
BLAKE2b-256 51b3087770362aecdf82269590915ecc78c88f5cd30fe60414cb2afe153b127b

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp310-cp310-macosx_11_0_x86_64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 222cde424ac2843185fa2624d97f566c4a757662c4440553b149c31aa38afc4a
MD5 a4c23ff9841f545043fcc1281a00a138
BLAKE2b-256 6c7362c6ebe26ffde530040596992c1b5919fbd938bf72bdca7b0f55c21c6ef9

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 776eb59323992accb1e0181bf5ae805ea62754f160bfeab1164485f441aa9d59
MD5 67eb913af73e5b18083c748a73202da0
BLAKE2b-256 76748adf7505bc016e5e5dc30e1e4302dab6b73cfd7c92bf5ba9d742fed5875a

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp39-cp39-win_amd64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 61226fdadb1a01161b88f37ca224ee4f343fd2ff15012ef45ccd3ca2bffb4337
MD5 6b496bf3a9251c8a9d6fed749ad782b0
BLAKE2b-256 9a272ee11a2d90a89cf87927fa7c490d02cc395e9553088118d5ee8c64756326

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 eac03583ccc6d29ec80010f21baf243fb8971afa118510132c1d6503682efacb
MD5 b4118c97654a3a16cb6ff02b1f3a9363
BLAKE2b-256 f3e22e56bff897ac4e26f6d19893d483104ad2507c9bdb762952b49767e1e710

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp39-cp39-macosx_11_0_x86_64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file compas_manifold-0.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for compas_manifold-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3d9b909543e2d280694bbaf2045d3d9bdaa0dbd12479e54acc22900371ae0e61
MD5 63407918bd83ede5fd23c015f0bacb55
BLAKE2b-256 fbd4d2111a5adcbe259fb05196a770a890a46427c1bf3f5f61ea974415d8cfee

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_manifold-0.1.0-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: release.yml on petrasvestartas/compas_manifold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page