Skip to content

feat(pycvc): SWIG Python bindings for libcvc — Geometry (v0) - #107

Merged
transfix merged 1 commit into
masterfrom
feat/pycvc-bindings
Jul 18, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/pycvc-bindings

Conversation

@transfix

@transfix transfix commented Jul 18, 2026 •

Copy link
Copy Markdown
Owner

First brick of the pycvc modernization deliverable (Phase 13) and the foundation for the embedded-Python VolumeRover3 lab.

Why

The plan (per Joe): keep VolumeRover3 general-purpose (no domain knowledge), embed a Python interpreter in it, and expose libcvc via pycvc — so GRL-SNAM and other research code drives the viewer from Python and is never rewritten in C++. pycvc is the layer that lets Python build cvc data.

What (v0)

  • pycvc.Geometry — build meshes/polylines incrementally or in bulk, per-vertex colors, compute_normals(), and read/write .off/CVC-raw via libcvc's geometry_file_io.
  • SWIG-safe facade: pycvc_geometry.h forward-declares cvc::geometry behind a shared_ptr, so SWIG only parses std::string/std::vector/primitives — never libcvc's heavy headers. Only the .cpp includes libcvc. C++ hosts reach the wrapped geometry via native() (%ignored in Python) — this is how VolumeRover3's embedded interpreter will turn a pycvc.Geometry into a live scene node.
  • Builds standalone against an installed/cvcpkg libcvc SDK (find_package(cvc CONFIG)), the same consumption model as volrover3.

Verification

ctest smoke test passes: build, incremental + bulk builders, colors, normals, malformed-input errors surfaced as Python exceptions, and an .off save/load round-trip through libcvc's own I/O.

Next

Volume (cvc::volume + SDF) and State (cvc::state) bindings + numpy fast-paths; then the embedded interpreter + a generic vr3 scene module in VolumeRover3; then a separate Python package that drives the lab with GRL-SNAM scenes.

First brick of the pycvc modernization deliverable (Phase 13): drive
libcvc from Python so research/domain code (grl-snam, DBG, …) never has to
be rewritten in C++, and so an embedded interpreter in VolumeRover3 can
build scenes from Python. pycvc is general-purpose and knows nothing about
any downstream project.

v0 exposes cvc::geometry via a SWIG-safe pimpl facade (forward-declares
cvc::geometry so SWIG never parses libcvc's headers): incremental + bulk
mesh/polyline builders, per-vertex colors, normals, and file I/O
(.off/CVC-raw via geometry_file_io). C++ hosts reach the underlying
cvc::geometry through native() (%ignore'd in Python).

Builds standalone against an installed/cvcpkg libcvc SDK via
find_package(cvc CONFIG) — same consumption model as volrover3. ctest
smoke test covers build, bulk/incremental, colors, normals, bad-input
errors, and .off round-trip. SWIG >= 4.0 + Python 3.
@transfix
transfix merged commit 8a47e9e into master Jul 18, 2026
4 of 8 checks passed
@transfix
transfix deleted the feat/pycvc-bindings branch July 18, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant