Open MysteryPancake opened 8 months ago
As a workaround you can find the symmetric difference with
csgUnionCopy(csgDifferenceCopy(grid1, grid2), csgDifferenceCopy(grid2, grid1))
or
csgDifferenceCopy(csgUnionCopy(grid1, grid2), csgIntersectionCopy(grid1, grid2))
For an in-place workaround, this might be the most efficient:
gridint = csgIntersectionCopy(grid1, grid2);
csgUnion(grid1, grid2);
csgDifference(grid1, gridint);
Currently OpenVDB supports the following SDF operations:
SDF Union:
min(d1, d2)
SDF Intersection:
max(d1, d2)
SDF Difference (usually named SDF Subtraction):
max(-d1, d2)
However, it doesn't support the XOR operation described by Inigo Quilez:
max(min(d1, d2), -max(d1, d2))
This operation finds regions where the sign mismatches.
It would be nice to include all standard SDF operations in OpenVDB.