Fixes InOutOctree samping on surface boundary - #1909
Merged
Conversation
kennyweiss
requested review from
Arlie-Capps,
BradWhitlock,
adayton1,
bmhan12,
jcs15c,
publixsubfan,
rhornung67 and
white238
July 9, 2026 01:19
kennyweiss
commented
Jul 9, 2026
Comment on lines
+1310
to
+1321
|
|
||
| // First, handle the case where the query point lies on (or within the vertex welding tolerance of) | ||
| // one of the block's segments. Such points are 'within' the surface by convention, | ||
| // but the ray-orientation test below is degenerate for them. | ||
| for(int i = 0; i < numSegments; ++i) | ||
| { | ||
| if(primal::squared_distance(queryPt, m_meshWrapper.cellPositions(segmentSet[i])) <= | ||
| m_vertexWeldThresholdSquared) | ||
| { | ||
| return true; | ||
| } | ||
| } |
kennyweiss
commented
Jul 9, 2026
Comment on lines
+1170
to
+1180
| // First, handle the case where the query point lies on (or within the vertex welding tolerance of) | ||
| // one of the block's triangles. Such points are 'within' the surface by convention, | ||
| // but the ray-orientation test below is degenerate for them. | ||
| for(int i = 0; i < numTris; ++i) | ||
| { | ||
| if(primal::squared_distance(queryPt, m_meshWrapper.cellPositions(triSet[i])) <= | ||
| m_vertexWeldThresholdSquared) | ||
| { | ||
| return true; | ||
| } | ||
| } |
adayton1
reviewed
Jul 9, 2026
adayton1
reviewed
Jul 9, 2026
adayton1
reviewed
Jul 9, 2026
adayton1
reviewed
Jul 9, 2026
adayton1
reviewed
Jul 9, 2026
adayton1
reviewed
Jul 9, 2026
adayton1
reviewed
Jul 9, 2026
adayton1
reviewed
Jul 9, 2026
kennyweiss
force-pushed
the
bugfix/kweiss/inoutoctree-on-surface
branch
from
July 9, 2026 20:04
5383879 to
b329970
Compare
adayton1
approved these changes
Jul 9, 2026
kennyweiss
force-pushed
the
bugfix/kweiss/inoutoctree-on-surface
branch
from
July 10, 2026 18:22
4bed761 to
5e08126
Compare
bmhan12
approved these changes
Jul 15, 2026
By convention, such points should be categorized as "Inside".
By conention, such points should be categorized as "Inside".
... and exposes this as an option in the quest containment and shaping examples. This was previously exposed through a compile-time ifdef.
…tOctree After our bugfix, the volume for the "black" material increased from 36,595 to 36,662.53, which better matches the computed volume from the winding-based approach (36,653.78). The difference between the two is now 8.74 (~0.024%).
The 2D and 3D functions were sufficiently different that I kept them separate, so this is mostly cosmetic
…cific InOutOctree::withinGrayBlock*D implementation This was vestigial from the earlier SFINAE formulation.
Also addresses PR suggestions about comments in new tests.
This ensures that we are using the same on-surface check in the octree and its comparison tests.
This file was last updated before our move to C++17, so I took this opportunity to update the file a bit. There are no functional changes in this commit.
kennyweiss
force-pushed
the
bugfix/kweiss/inoutoctree-on-surface
branch
from
July 15, 2026 18:37
5e08126 to
42b62b1
Compare
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
containment_driverandshaping_driverexamplescontainment_driverandInOutOctreeto replace SFINAE w/if constexpr, and to use a variant for the 2D and 3D octrees, since we can only have one of these within the containment driver application