Skip to content

Bug in PMP::compute_vertex_normal() #2047

@lrineau

Description

@lrineau

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 master branch (pre-CGAL-4.10-beta1, commit 82286eb)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions