How sgsellan/gpytoolbox works
Project type and purpose
• This is an open-source Python library (“gpytoolbox”) for geometry processing, with optional high-performance C++ bindings.
• It provides hundreds of algorithms (mesh operators, FEM, distance computations, etc.) as pure Python functions and, where needed, native extensions via pybind11/CMake.
• It ships as a pip-installable package, with documentation built by MkDocs and a full test suite.
File structure
• Top-level:
• CMakeLists.txt + cmake/ → build scripts to compile C++ code into Python extension modules
• setup.py / pyproject.toml → Python packaging, pointing at both pure-Python sources and the compiled extensions
• mkdocs.yml + docs/ → source for the MkDocs documentation website
• .github/workflows/ → CI pipelines for Linux/Mac/Windows builds, testing, doc deployment
• src/
• src/gpytoolbox/ → the pure-Python package (one .py per algorithm, copyleft submodule)
• src/cpp/ → C++ implementation files and binding_* wrappers, organized by feature (remesher, swept_volume, tinyply, etc.)
• ext/pybind11 → embedded pybind11 submodule used by CMake to generate Python bindings
• test/ → pytest-style unit tests that import Python functions (and indirectly exercise C++ bindings) against sample mesh/data fixtures
Diagramming guidance
• Python API layer (“gpytoolbox” package)
• C++ extension layer (compiled modules built via CMake + pybind11)
• Build system (CMake, setup.py / pyproject.toml)
• External dependencies (NumPy, SciPy, libigl, mkdocs, pytest)
• Documentation site generator (MkDocs + docs sources)
• Continuous integration pipelines (GitHub Actions workflows)
b. Relationships & data flow:
• Python API calls → C++ extension functions through pybind11 bindings
• setup.py/pyproject.toml & CMakeLists.txt → orchestrate build of native modules during pip install or manual build
• docs/ + mkdocs.yml → MkDocs → published website
• .github/workflows → trigger build→ test (pytest) → bundle & publish to PyPI & docs hosting
c. Architectural patterns & principles:
• Layered architecture separating high-level Python algorithms from low-level C++ performance kernels
• Modular design: each geometry operator lives in its own Python file with a matching C++ binding source when needed
• CI/CD pipelines ensure cross-platform compatibility and continuous documentation publishing
d. Key technologies & frameworks:
• Python packaging: setuptools, pip, pyproject.toml
• Native extensions: CMake, pybind11, custom cmake/*.cmake modules for third-party libraries (igl, glfw3webgpu, nanoflann, webgpu)
• Documentation: MkDocs
• Testing: pytest
• CI: GitHub Actions