Metadata-Version: 2.3
Name: compas-brep
Version: 0.1.0
Summary: Canonical Brep wrapper based on COMPAS framework with pluggable OCC/Rhino backends
Author: Chen Kasirer
Author-email: Chen Kasirer <kasirer@arch.ethz.ch>
License: MIT License
         
         Copyright (c) 2026 Gramazio Kohler Research
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Requires-Dist: compas>=2.0
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: invoke ; extra == 'dev'
Requires-Dist: ruff ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: compas-invocations2[mkdocs] ; extra == 'dev'
Requires-Dist: bump-my-version ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'
Requires-Dist: wheel ; extra == 'dev'
Requires-Dist: build ; extra == 'dev'
Requires-Dist: mkdocstrings[python] ; extra == 'docs'
Requires-Dist: cadquery-ocp-novtk>=7.8 ; python_full_version >= '3.10' and extra == 'occ'
Requires-Dist: compas-viewer>=1.0 ; extra == 'occ'
Requires-Python: >=3.9
Project-URL: Repository, https://github.com/gramaziokohler/compas_brep
Provides-Extra: dev
Provides-Extra: docs
Provides-Extra: occ
Description-Content-Type: text/markdown

# compas_brep

[![Github Actions Build Status](https://github.com/gramaziokohler/compas_brep/actions/workflows/build.yml/badge.svg)](https://github.com/gramaziokohler/compas_brep/actions)
[![License](https://img.shields.io/github/license/gramaziokohler/compas_brep.svg)](https://pypi.python.org/pypi/compas-brep)
[![PyPI Package latest release](https://img.shields.io/pypi/v/compas-brep.svg)](https://pypi.python.org/pypi/compas-brep)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/compas-brep.svg)](https://pypi.python.org/pypi/compas-brep)
[![Made with COMPAS](https://compas.dev/badge.svg)](https://compas.dev/#/)

A unified Brep wrapper for the [COMPAS](https://github.com/compas-dev/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](https://github.com/compas-dev/compas_occ) which is used as benchmark for this project.

## Installation

**Base (no backend):**

```bash
pip install compas_brep
```

**With [OCC backend](https://github.com/CadQuery/OCP):**

```bash
pip install "compas_brep[occ]"
```

The Rhino backend is available automatically when running inside Rhino.

## Usage

```python
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:

```bash
uv pip install "cadquery-ocp-novtk>=7.8"
pytest -m occ -q
```
