Skip to content

tools: fix wrong voxel offset in MeshToVolume checkNeighbours - #2307

Closed
sifakis wants to merge 1 commit into
AcademySoftwareFoundation:masterfrom
sifakis:fix/mesh-to-volume-checkneighbours-offset
Closed

tools: fix wrong voxel offset in MeshToVolume checkNeighbours#2307
sifakis wants to merge 1 commit into
AcademySoftwareFoundation:masterfrom
sifakis:fix/mesh-to-volume-checkneighbours-offset

Conversation

@sifakis

@sifakis sifakis commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • In openvdb/openvdb/tools/MeshToVolume.h, the checkNeighbours() overload that scans a leaf node's raw data array has a mask[6] branch labeled i+1, j, k-1 that checks data[pos + NodeT::DIM * NodeT::DIM] — the same offset used by the mask[0] (i+1, j, k) branch two lines above, missing the - 1 for the k-1 step.
  • The analogous edge-adjacent branches immediately below (mask[7], mask[8], mask[9]) all correctly include the ±1 z-offset, confirming this is a copy/paste slip rather than intentional.
  • Fixed the offset to data[pos + NodeT::DIM * NodeT::DIM - 1] so the correct voxel is checked.

Test plan

  • CI build/tests for openvdb core

The mask[6] branch (i+1, j, k-1) checked data[pos + DIM*DIM],
duplicating the mask[0] (i+1, j, k) offset instead of accounting
for the k-1 step, unlike the analogous edge-neighbor branches
immediately below it.

Signed-off-by: Efty Sifakis <esifakis@nvidia.com>
@sifakis
sifakis requested a review from kmuseth as a code owner August 31, 2026 17:18
@sifakis

sifakis commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Superseeded by #2306

@sifakis sifakis closed this Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant