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.1

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.1
File Size Uploaded
compas_brep-0.4.1.tar.gz 105.6 kB Details

Built distribution (wheel)

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

Total release size: 231.3 kB

Release files / compas_brep-0.4.1.tar.gz

Download URL compas_brep-0.4.1.tar.gz
Size 105.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3dafe964ee699ccaa06c51b307217c13f350ef484f5d32528bdc54adeafe1096
BLAKE2b-256 checksum
How to use checksums
ed53d31427ebde12ed1e507565ed2167dde05bbc9464664118c05076eabcf830
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 Oct 13, 2026.

Transparency log

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

Download URL compas_brep-0.4.1-py3-none-any.whl
Size 125.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
888b3b4e8655b3ef0c32e9e75e8ad729f95f3e8be18dc0ecc992f9f604550cce
BLAKE2b-256 checksum
How to use checksums
94f1dd34dc2ca8e00104122955067381fbaa511e908dffe3a1b625c18573626e
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 Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

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