Uploaded image for project: 'OpenVDB'
  1. OpenVDB
  2. OVDB-56

Sparse Activation of VDB Grids in Parallel

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • Core
    • 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);
      

            Unassigned Unassigned
            danrbailey danrbailey
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: