fix face area weighting in quadric edge collapse #238
Merged
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.
Thank you for sending a Pull Request to the VCGLib!
Check with
[x]
what is your case:I think there is a bug in the area weighting of quadric edge decimation. In the paper "Simplifying Surfaces with Color and Texture using Quadric Error Metrics" and "New Quadric Metric for Simplifying Meshes
with Appearance Attributes", they both mentioned that the area weighting should be appied on the matrix Q, meaning Q *= Area.
But in the vcglib's implementation, the squared area is multiplied into Q. I think it's a mistake. The current code
will actually multiple the area into the unit normal vector. And this face normal vector is used to construct the matrix Q, where each component is squared, or multiplied to each other, therefore the squared area is incorrectly weighted into Q.
Here is an actual experiment:
In meshlab, we can take a sphere mesh and select half of its faces and do subdivision (Here I used midpoint subdivision three times)
And we decimate the mesh to 10000 faces. In the current implementation, we will observe a non-uniform face size. It's because the area is incorrectly squared, and most face area area less than one. So the smaller face will have a incorrect even smaller weight, which make the algorithm think the smaller face should have fewer cost, therefore being decimated much more.
After this fix, it works correctly. All the faces are distributed uniformly.