Exposed simplify_mesh_lossless method #34
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.
This PR exposes the
simplify_mesh_lossless
method, which appears to be faster and more effective compared to the standard method with thelossless
flag enabled. It also behaves differently in terms of triangle reduction and convergence. Additionally, thethreshold_lossless
argument in the standard method does not seem to influence the results as expected—triangle counts converge to a fixed value regardless of the threshold. However, in thesimplify_mesh_lossless
method, theepsilon
parameter has a clear effect on the result.This new method may be especially useful in batch processing scenarios where multiple meshes with similar characteristics need to be simplified efficiently.
On a minor note, the example comments at the end of the Simplify.pyx file have been removed as present in the readme. And it bugs me as to why this hasn't been done before, as I may have a mistake in closing this previous PR ...
Observations:
Standard Method with
lossless
Flag:The
lossless
flag, when used with differentthreshold_lossless
values, results in minimal triangle reduction regardless of the threshold value.threshold_lossless=10
), with the mesh consistently reducing to 112380-112400 triangles.Basic Exposed
simplify_mesh_lossless
Function:This method simplifies the mesh more significantly and efficiently compared to the
lossless
flag approach.simplify_mesh_lossless
with Differentepsilon
Parameters:Changing the
epsilon
parameter insimplify_mesh_lossless
clearly influences the degree of simplification:Epsilon = 1e-9:
Output:
Epsilon = 1e-3:
Output:
Epsilon = 5*1e-1:
Output:
Conclusion:
The
simplify_mesh_lossless
method offers a faster and more predictable alternative to the standard simplification with thelossless
flag. For cases involving large batches of meshes or cases where consistent simplification is needed, it may be a more suitable option. Further testing could explore whether this method could replace the currentlossless
flag implementation in certain scenarios, without creating an other method.PS : Sorry for the trailing white spaces, sublime text removes them automatically. >< Only the new cdef and class method have been added.