Skip to main content

Canonical Brep wrapper based on COMPAS framework with pluggable OCC/Rhino backends

Project description

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.

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

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

Project details


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.1.1.tar.gz (73.0 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.1.1-py3-none-any.whl (89.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: compas_brep-0.1.1.tar.gz
  • Upload date:
  • Size: 73.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for compas_brep-0.1.1.tar.gz
Algorithm Hash digest
SHA256 62c7bd8063ff68a2a2d6160529ec4a803455e83191eabe0a8cf76dfaf6cd7ca5
MD5 a6ab2defef94e27fb2db40c2a79b0c51
BLAKE2b-256 01f1864ce6a2ed61f3274636019d07e9e32585495d9e27114fde24a363d1c2f9

See more details on using hashes here.

File details

Details for the file compas_brep-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: compas_brep-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 89.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for compas_brep-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d987d1d2604109a1dda109c9893910cdf9efa7b85c5e51fdf9af3463f2d32fa
MD5 127849992beffc0e439402b27b127be1
BLAKE2b-256 441f45a8628a183fd492e600fdb5f09fd231e96dc2e15608a4897c5b153ca7b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page