Repository navigation
feat(pycvc): SWIG Python bindings for libcvc — Geometry (v0) - #107
Merged
Merged
Conversation
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.
This was referenced Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
cvcdata.What (v0)
pycvc.Geometry— build meshes/polylines incrementally or in bulk, per-vertex colors,compute_normals(), and read/write.off/CVC-raw via libcvc'sgeometry_file_io.pycvc_geometry.hforward-declarescvc::geometrybehind ashared_ptr, so SWIG only parsesstd::string/std::vector/primitives — never libcvc's heavy headers. Only the.cppincludes libcvc. C++ hosts reach the wrapped geometry vianative()(%ignored in Python) — this is how VolumeRover3's embedded interpreter will turn apycvc.Geometryinto a live scene node.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
.offsave/load round-trip through libcvc's own I/O.Next
Volume(cvc::volume + SDF) andState(cvc::state) bindings + numpy fast-paths; then the embedded interpreter + a genericvr3scene module in VolumeRover3; then a separate Python package that drives the lab with GRL-SNAM scenes.