Overview
CGAL integration uses nanobind for Python bindings for COMPAS. The contribution guide is found in the “Contribute” section, which explains how to create a pull-request and implement new methods in both C++ and Python. Additional sections explain technical aspects of the repository that are useful during the binding process. The workflow is as follows:

File and Folder Structure
The compas_cgal package contains numerous files and folders. For a simpler reference, check out the minimal nanobind binding example. Comparing it with compas_cgal helps understand the additional features provided by the COMPAS framework. For basic CGAL bindings, you’ll mainly work with the src
folder, tests
, and scripts
. The CMakeLists.txt
is pre-configured to automatically include any new C++ source files, so you typically won’t need to modify it.
Source Code
src/
- C++ backend codesrc/compas_cgal/
- Python frontend code
Build & Dependencies
build/
- Distributables e.g. for PyPi packageexternal/
- External C++ dependencies, downloaded via CMake ExternalProject moduleCMakeLists.txt
- C++ project configurationpyproject.toml
- Python project configuration (pip install -e .)requirements.txt
- Runtime requirements (pip install -r requirements.txt)requirements-dev.txt
- Development requirement (pip install -r requirements-dev.txt)tasks.py
- Development tasks (invoke test, invoke docs, invoke format, invoke lint)
Tests & Examples
scripts/
- Example filestests/
- Test files
Documentation
docs/
- Source code documentationdist/
- Documentation build output
Data & Temporary Files
data/
- Data sets (.json, .ply, .stl)temp/
- Temporary files
Project Info
README.md
- Project overviewCHANGELOG.md
- Feature changelogLICENSE
- License information