-
Notifications
You must be signed in to change notification settings - Fork 575
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
Smoothing Algorithms #321
Smoothing Algorithms #321
Conversation
trimesh/smoothing.py
Outdated
= 2 - Umbrella Weights | ||
Output: Laplacian operator (scipy sparse matrix) | ||
""" | ||
vert_neigh=mesh.vertex_neighbors; vert=mesh.vertices; vert_ori=mesh.vertex_normals.copy(); n_vert=len(vert) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we split these out into separate lines without semicolons?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done... Thanks for the suggestion...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No prob man, thanks! I didn't say this before, but nice work! This will be very useful!!!
Looks great, huge improvement thanks! I'll probably change up the formatting when I merge (remove semicolons like @Marviel suggested, remove trimesh import), though one thing before I merge: could you add a unit test file,
|
I can try... But it is not easy to state a test... The Laplacian filter is known to reduce volume and Humphry and Taubin tries to address the issue... There always be some changes in volume and specially in area and it depends how severe the user sets the diffusion. If the diffusion is to severe large changes in shape can occur and the filter can be working just fine... I can think about it, see if i can come up with some test... I'm open to suggestions... |
Hey, yeah no worries, the test mainly needs to be repeatable, it's not necessarily "exactly assess whether the solution is correct or not." The value is making sure that the smoothing routines are run in CI so we can make sure that given the same parameters changes elsewhere don't break the functionality. Thanks! |
Sorry, but i'm new to github an programming.... How can i test my "test_smoothing.py" code? Before committing it? |
No worries, you may be running in to an import paths issue: you can either put the directory with the trimesh repo into the
You can also do an editable pip install from inside the trimesh directory, which will do basically the same thing: I'd put the following in
Or if you just have a code block that works as a script (with some |
Hello, i added a test file hopefully it is properly done... But, i will have read a bit about how git works so far a just my script in vs code with anaconda and that's it... About the algorithms, these are classic well know algorithms much more advanced algorithms are available. Now i'm working in a new weighting function... At a given vertices and its neighbour (that forms an edge i need to know the area of the two triangles that forms the edge... Regards |
Looks terrific, thanks! I'll merge to a branch for testing and profiling and then get it into master ASAP. This is a huge improvement, thanks again for taking the time to PR! |
Hello, i added smoothing.py which as four def's. The Laplacian calculation which is the most expensive step. Then three filters: laplacian, humphrey, taubin, which can be applied multiple times in different orders in an i
inexpensive way...