Skip to main content

compas_brep

Github Actions Build Status License PyPI Package latest release Made with COMPAS

A unified Brep wrapper for the COMPAS framework with pluggable OCC and Rhino backends. See Motivation for why.

Provides a single Brep class with a stable public interface. The backend (OCC or Rhino) is selected automatically at runtime based on what is importable — see Architecture. All inputs and outputs are COMPAS types — never backend types.

Examples in examples/ have mostly been copied from COMPAS OCC which is used as benchmark for this project.

Documentation

Full documentation: https://gramaziokohler.github.io/compas_brep/

Installation

Base (no backend):

pip install compas_brep

With OCC backend:

pip install "compas_brep[occ]"

The Rhino backend is available automatically when running inside Rhino.

Usage

import os
from compas_brep import Brep, DATA
from compas_viewer import Viewer

brep = Brep.from_step(os.path.join(DATA, "box_with_holes.stp"))

for face in brep.faces:
    print(face.surface)  # Plane for flat faces, NurbsSurface for curved faces

viewer = Viewer()
viewer.scene.add(brep)

viewer.show()

Running tests

Install the OCC backend and run:

uv pip install "cadquery-ocp-novtk>=7.8"
pytest -m occ -q

Download files

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

Source Distribution

compas_brep-0.3.0.tar.gz (104.1 kB view details)

Uploaded Source

Built Distribution

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

compas_brep-0.3.0-py3-none-any.whl (123.8 kB view details)

Uploaded Python 3

File details

Details for the file compas_brep-0.3.0.tar.gz.

File metadata

  • Download URL: compas_brep-0.3.0.tar.gz
  • Upload date:
  • Size: 104.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for compas_brep-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7a1627b5e5104183aa7a01d6a36f97deaf20031980a24b512041d04717f4831d
MD5 5c2026c905ebefd188b59ef6c844778a
BLAKE2b-256 14ece080019a6d829abac18bce1ecf0d39acd1eac9eff59da0bf5a34ffafa80a

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_brep-0.3.0.tar.gz:

Publisher: release.yml on gramaziokohler/compas_brep

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_brep-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: compas_brep-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 123.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for compas_brep-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb91c71929a200fe49e2b77384d8ee59a8eaa668ffc34471a3c43bb38c55c0e6
MD5 4784fdc7676b32467e4399cb4c2e2e4c
BLAKE2b-256 cff1c40499df9a6f53ca68889fb5b7bcdf7169ba02ef06c7b4b102c699d1e503

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_brep-0.3.0-py3-none-any.whl:

Publisher: release.yml on gramaziokohler/compas_brep

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

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.2

2 files

0.2.1

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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