compas_brep
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/
- What is a Brep? — the shape model, in one page
- Architecture — what happens where
- Examples — runnable scripts by topic
- Adding a new operation — extending compas_brep across both backends
- API Reference
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
Metadata
Release files for compas-brep 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| compas_brep-0.3.1.tar.gz | 104.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| compas_brep-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 227.9 kB
Release files / compas_brep-0.3.1.tar.gz
| Download URL | compas_brep-0.3.1.tar.gz |
|---|---|
| Size | 104.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4e7afe076d0ac193a8552be480b87c9f704f3f8e23542fbaffadebb3931d072
|
|
BLAKE2b-256 checksum How to use checksums |
d592a763eefe855204056c8a8e0976c4a8c5a1d1e08b6a81d9dad1e3b0212b5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 9, 2026.
Transparency logRelease files / compas_brep-0.3.1-py3-none-any.whl
| Download URL | compas_brep-0.3.1-py3-none-any.whl |
|---|---|
| Size | 123.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
932f037385f0917653c713b1797dca47c478016deda46556bb0e3be4f103f79c
|
|
BLAKE2b-256 checksum How to use checksums |
7ebb8d06103bdfcce2060b54687279648877a6766c2330a9339cce2a3dd3b6f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 9, 2026.
Transparency log