-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposed simplify_mesh_lossless method #34
Conversation
Looks good to me. We'll want to adjust the |
Normally I've adjusted the verbose handling for the other method. Maybe before merging the readme file should be updated with the logging + the new lossless method, and maybe a link to this PR for the testing data. |
Yeah, I think it's important that the logging thing gets mentioned or, given that the debug messages are suppressed by default, nobody is even going to know they're there. And yes, an example of |
Just temporarily distracted or do you want me to finish this one off? |
Sorry, wasn't really available the last days, and wanted to take some time to make the readme reflect the changes, which should be ok now! Maybe you can check that just one last time. Also, should we pass to a new version, for the new method + verbose change, maybe a 0.3.0 ? And add an issue concerning the implementation of the preserve borders option for the lossless method. |
Mind adding a test for
I'll do a release after this. You can either change the version now or I'll do it then. It doesn't really matter. |
I let you do the rest, I hope it was ok to merge ! |
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.