Conversation
graphCutPostProcessing reads invertTetrahedronBasedOnNeighborsNbIterations with get<bool> and uses it as a loop bound, so the bound is 1 whatever is configured: property_tree's bool translator does not accept a value like "10" and falls back to the default, and the default supplied here is 10, which converts to bool true and back to int 1. The 4-neighbour inversion pass therefore runs once rather than the ten times the parameter asks for. nbSolidAngleFilteringIterations two lines below reads an int count as a double. That one does work, since the double translator parses "10" and the narrowing gives 10, but it is the same mistake and the value is an int count. Fixes alicevision#2178 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Fixes #2178.
Mesher::graphCutPostProcessingreads an iteration count withget<bool>:and uses it as a loop bound at line 317. The result is 1 either way:
boost::property_tree's bool translator does not accept a value like"10", so thegetfalls back to its default;10, which converts tobooltrue, which converts back tointas1.So the 4-neighbour inversion pass runs once, whatever is configured — neither the configured value nor the intended default of 10 ever reaches the loop.
The second hunk changes
nbSolidAngleFilteringIterationsfromget<double>toget<int>. That one is not a defect — the double translator parses"10"and the narrowing gives 10 — but it is the same mistake on anintcount, two lines below, so it seemed worth correcting while the file is open.Effect
The later rounds remove the isolated spikes and pits that the first round exposes. Measured with only these calls changed:
About 0.8 s more on the larger job. Small in face count, but it is the difference between the pass doing what the parameter asks and doing one round regardless.
Found while porting the meshing stage to HIP for AMD GPUs, but this is CPU code and is not platform specific; both measurements above are from CPU runs.
🤖 Generated with Claude Code