-
Improvement
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
None
There's no way to sparse activate a grid without also setting the value.
CoordBBox bbox; grid.sparseFill(bbox, ValueType(0), /*active*/true);
This is a better alternative:
openvdb::MaskGrid mask(/*background=*/false); mask.fill(bbox, /*value=*/true, /*active=*/true); grid.topologyUnion(mask);
This is a bit obscure to know this though. I suggest something like this:
grid.sparseActivate(bbox, /*active=*/true);
Also, the similar logic that JeffLait has introduced to GEO_PrimVDB for intersections could be more broadly useful too:
openvdb::MaskGrid mask(false); mask.fill(bbox, true, true); grid.topologyIntersection(mask); geoInactiveToBackground<GridType> bgop(grid); openvdb::tools::foreach(grid.beginValueOff(), bgop);