Skip to main content

compas_brep

Github Actions Build Status License PyPI Package latest release OCP versions 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]"

Both the 7.x and 8.x series of cadquery-ocp-novtk are supported, and pip picks the right one for your interpreter: 8.x requires Python >= 3.11, so Python 3.10 resolves to the latest 7.9.x instead.

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.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 compas-brep 0.4.0
File Size Uploaded
compas_brep-0.4.0.tar.gz 105.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for compas-brep 0.4.0
File Interpreter ABI Platform
compas_brep-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 230.8 kB

Release files / compas_brep-0.4.0.tar.gz

Download URL compas_brep-0.4.0.tar.gz
Size 105.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a7801d60960374b15bd813c372969a04be7222cae4a3357af57aab709d1a8875
BLAKE2b-256 checksum
How to use checksums
7b8b1f281665b056550a94ea6ee2030e932b7dc92a5b3a4c9aa6f9f0814b0c7d
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 10, 2026.

Transparency log

Release files / compas_brep-0.4.0-py3-none-any.whl

Download URL compas_brep-0.4.0-py3-none-any.whl
Size 125.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6007d3ff3e7ab5fa4e65773a46be3d607db61713697f36500348089999e6bb56
BLAKE2b-256 checksum
How to use checksums
bdf8c2611d39c4aaf464c9dbeb4a5ac2ee796ba0404891e892e9580a5ad389b2
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 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release 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