Add selectable inside/outside method for SDF sign determination (#1393)#1393
Closed
cdtwigg wants to merge 1 commit into
Closed
Add selectable inside/outside method for SDF sign determination (#1393)#1393cdtwigg wants to merge 1 commit into
cdtwigg wants to merge 1 commit into
Conversation
Contributor
|
@cdtwigg has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104091366. |
meta-codesync Bot
pushed a commit
that referenced
this pull request
May 15, 2026
Summary: Add a `SignMethod` enum to `MeshToSdfConfig` with three options: - `RayCasting` (default): existing 6-direction majority vote. Fast but fails on non-watertight meshes where rays pass through gaps. - `WindingNumber`: signed winding number (wn > 0.5), assumes consistent outward-facing normals. Will reject meshes with accidentally flipped normals rather than silently accepting them. - `WindingNumberPermissive`: absolute winding number (abs(wn) > 0.5), tolerant of either winding convention. Handles mesh soups, mixed orientations, and geometry from multiple sources. Both winding number variants use the Van Oosterom-Strackee solid angle formula, computed per voxel over all triangles. No new dependencies — the computation is self-contained. The sign determination step was already isolated in `applySignsToDistanceField`, so the change is minimal: the function now accepts a `SignMethod` parameter and dispatches to the appropriate classifier. Reviewed By: cstollmeta Differential Revision: D104091366
b00cce0 to
a9c8463
Compare
meta-codesync Bot
pushed a commit
that referenced
this pull request
May 15, 2026
Summary: Add a `SignMethod` enum to `MeshToSdfConfig` with three options: - `RayCasting` (default): existing 6-direction majority vote. Fast but fails on non-watertight meshes where rays pass through gaps. - `WindingNumber`: signed winding number (wn > 0.5), assumes consistent outward-facing normals. Will reject meshes with accidentally flipped normals rather than silently accepting them. - `WindingNumberPermissive`: absolute winding number (abs(wn) > 0.5), tolerant of either winding convention. Handles mesh soups, mixed orientations, and geometry from multiple sources. Both winding number variants use the Van Oosterom-Strackee solid angle formula, computed per voxel over all triangles. No new dependencies — the computation is self-contained. The sign determination step was already isolated in `applySignsToDistanceField`, so the change is minimal: the function now accepts a `SignMethod` parameter and dispatches to the appropriate classifier. Reviewed By: cstollmeta Differential Revision: D104091366
a9c8463 to
5740f86
Compare
Summary: Add a `SignMethod` enum to `MeshToSdfConfig` with three options: - `RayCasting` (default): existing 6-direction majority vote. Fast but fails on non-watertight meshes where rays pass through gaps. - `WindingNumber`: signed winding number (wn > 0.5), assumes consistent outward-facing normals. Will reject meshes with accidentally flipped normals rather than silently accepting them. - `WindingNumberPermissive`: absolute winding number (abs(wn) > 0.5), tolerant of either winding convention. Handles mesh soups, mixed orientations, and geometry from multiple sources. Both winding number variants use the Van Oosterom-Strackee solid angle formula, computed per voxel over all triangles. No new dependencies — the computation is self-contained. The sign determination step was already isolated in `applySignsToDistanceField`, so the change is minimal: the function now accepts a `SignMethod` parameter and dispatches to the appropriate classifier. Reviewed By: cstollmeta Differential Revision: D104091366
5740f86 to
40fe2f3
Compare
Contributor
|
This pull request has been merged in 2210f0a. |
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.
Summary:
Add a
SignMethodenum toMeshToSdfConfigwith three options:RayCasting(default): existing 6-direction majority vote. Fast but fails on non-watertight meshes where rays pass through gaps.WindingNumber: signed winding number (wn > 0.5), assumes consistent outward-facing normals. Will reject meshes with accidentally flipped normals rather than silently accepting them.WindingNumberPermissive: absolute winding number (abs(wn) > 0.5), tolerant of either winding convention. Handles mesh soups, mixed orientations, and geometry from multiple sources.Both winding number variants use the Van Oosterom-Strackee solid angle formula, computed per voxel over all triangles. No new dependencies — the computation is self-contained.
The sign determination step was already isolated in
applySignsToDistanceField, so the change is minimal: the function now accepts aSignMethodparameter and dispatches to the appropriate classifier.Reviewed By: cstollmeta
Differential Revision: D104091366