-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Bug in PMP::compute_vertex_normal() #2047
Copy link
Copy link
Closed
Description
Issue Details
There is a bug in PMP::compute_vertex_normal()
For a vertex of a surface mesh, it computes the normalized normals of all incident faces, and compute the unweighted mean of those normalized normals. ... That is wrong!
Steps to easily see the bug:
- Load the OFF file
demo/Polyhedron/data/cube.off(that is a simple triangulated unit cube: 8 vertices, 12 faces), in the polyhedron demo, - Use "create a point set from vertices". That will display the normals.
- For each vertex that is incident to four faces, you will see that the normal is wrong : all vertex normals of the 8 vertices of the cube should be proportional to the diagonal vectors (±1, ±1, ±1).
There are several methods to compute vertex normals of a mesh, and the unweighted mean is clearly always wrong (but if the mesh is very isotropic). See details our three different methods in this blog. The page points to articles, one comparing six different methods to compute normals. The best one seems to weight the mean with the angles of the face around the vertex.
Environment
- CGAL version: current
masterbranch (pre-CGAL-4.10-beta1, commit 82286eb)
Reactions are currently unavailable