Repository navigation
feat(pycvc): Volume bindings (3D scalar-field facade) - #108
Merged
Merged
Conversation
The RF / signed-distance / risk-field path: build a Float cvc::volume from a flat scalar grid + spatial bounds in Python, read voxels / min / max / bounds, and (where the SDK registers the handler) load/save volume files. Same SWIG-safe pimpl pattern as Geometry (forward-declares cvc::volume). Also hardens the SWIG exception wrapper with a catch(...) fallback: cvc exceptions derive from boost::exception (NOT std::exception), so an unhandled one previously std::terminate'd the interpreter (hit via an unregistered .rawiv handler in a shared-lib build) — now surfaced as a Python RuntimeError. The volume test tolerates a missing file handler; the field-building core is fully covered. Uses a process-wide `static cvc::app` for the volume context (mirrors the cvc-cli pattern; instancePtr() is protected). ctest smoke passes.
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.
Second
pycvcbrick (after Geometry, #107): the scalar-field path for RF / SDF (φ) / risk-field volumes — exactly what feeds VolumeRover3's GPU ray-cast VolumeNode.What
pycvc.Volume—set_float_grid(values, nx,ny,nz, bounds…)builds a Floatcvc::volume;value(i,j,k),min_value()/max_value(), bounds accessors;load/savewhere the SDK registers the volume handler.cvc::volume; only the.cppincludes libcvc).native()%ignored for C++ hosts.Robustness fix
cvc exceptions derive from
boost::exception, notstd::exception, so the SWIG%exceptionhandler now has acatch(...)fallback — an unhandled cvc exception previouslystd::terminate'd the interpreter (reproduced via an unregistered.rawivhandler when consuming libcvc as a shared lib). Now it's a clean PythonRuntimeError.Note (follow-up, not blocking)
The
.rawivvolume-file handler isn't registered when linking againstlibcvc.soin this SDK build — a static-initializer stripping issue for the format-handler TUs. Volume file I/O for SDK consumers (incl. the lab loading.rawivfields) needs the handlers force-linked. Field-building from memory (the primary path) is unaffected.ctest smoke passes (field build, value/min/max/bounds, bad-length error, tolerant file roundtrip).