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

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.2
File Size Uploaded Provenance Actions
compas_brep-0.4.2.tar.gz 105.7 kB With provenance Details for compas_brep-0.4.2.tar.gz

Built distribution (wheel)

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

Total release size: 231.4 kB

Release files / compas_brep-0.4.2.tar.gz

Download URL compas_brep-0.4.2.tar.gz
Size 105.7 kB
Tags Source
SHA-256 checksum
How to use checksums
af0329c2d2be6c7056dbac8bbe7d0921a269902dad3860407546c773e52b072e
BLAKE2b-256 checksum
How to use checksums
5623b556fe9028f7e87c98d96b4b840142443f431dd3334cca9690fdeca76a7a
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 Nov 10, 2026.

Transparency log

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

Download URL compas_brep-0.4.2-py3-none-any.whl
Size 125.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34d2c8a518a81d8553b7406a62a6c5f44868b731e85bf4c4d0cf127a1f272c7d
BLAKE2b-256 checksum
How to use checksums
05d200fbbef653827b1c462f630c7a7993b937081e4e9fef31fd3a0e67ba82eb
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 Nov 10, 2026.

Transparency log

Security for compas-brep 0.4.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for compas_brep-0.4.2.tar.gz

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 Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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