-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Adding 3D barycentric coordinates for convex polyhedra #8267
base: master
Are you sure you want to change the base?
Adding 3D barycentric coordinates for convex polyhedra #8267
Conversation
…ulate tetrahedra coordinates, as well as utils_3 that do the actual calculation, and one example to test the possible 3 cases of points
…ty_maps and surface mesh
…the equations, now I will make my code more organized
…nd removing -tol from the wp test
…ween 0 and 1. Added utils.h to generate polyhedrons
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
/build:v1 |
The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8267/v1/Manual/index.html |
I suspect there is a degenerate case not handled as the mesh is cube and the query the centroid of the cube |
cc @antoniospg :) |
@sloriot No, for center query in a cube there are no edge cases. The sum should be strictly positive because all weights are positive. My guess would be that certain weights are positive and certain are negative so they sum up to zero. If this is a case, most likely the orientation of faces is different from what it has been when the test was developed because it did pass when Antonio worked on it. Could that be that this line
produces different results from this one:
In any case for such a simple test, I would first check how the cube looks like, orientation of its faces, and values of the weights. |
What is very strange. If I write the generated mesh into a file, and read it back the test works. |
|
||
// Compute wp coordinates for a given vertex v and a query q | ||
template<typename Vertex> | ||
FT compute_wp_vertex_query(const Vertex& vertex, const Point_3& query){ |
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.
@sloriot The issue is probably coming from this method. There is suspicious negation of the first face normal, which is not coherent with other normals used here. Implementations of other MV and DH coordinates do not have this. My guess would be that this method does not return the same weights for the same mesh but differently oriented faces, which should not be the case. What is important here is to have consistent normals as indicated in the original paper. Maybe just try to remove the negation in line 296 and see what happens?
There are multiple formulas to compute WP coordinates. I do not remember which one Antonio used here. Maybe it is worth using all formulas from the same paper to be consistent. Finally, another test that is easy to do is to change WP to DH coordinates in this test and see if it works. If I remember correctly for such a simple case (center point in a cube) WP and DH should produce exactly the same result.
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.
I went back to Meyers' paper and updated the formula. This test passes but now test_dh_weights_3
and test_edge_cases
don't. TBC
Summary of Changes
New package for 3D barycentric coordinates in a convex polyhedron
Release Management