Normals\Compute

From CloudCompareWiki
Jump to navigation Jump to search

Menu / Icon

This tool is accessible via the 'Edit > Normals > Compute' TypeNormal.png menu.

Description

Computes normals on the selected entities.

Computing normals on a cloud

Edit > Normals > Compute dialog - cloud case (dialog of the 2.6.2 version)

To compute normals on a point cloud, it is necessary to estimate the local surface represented by a point and its neighbors. The level of noise and the number/distance of neighbors will change how this surface looks like.

Local surface model

The user must first choose a local surface model:

  • (best fit) plane - robust to noise but very bad with sharp edges and corners
  • 2D triangulation - weak to noise but good with sharp edges
  • quadric (formerly called 'height function') - very good for curvy surfaces

Neighborhood

Then the user must choose how the local neighbors will be selected. The default neighbor extraction process relies on an octree structure. The user must only choose the neighborhood radius. The bigger the radius, the more points will be used to compute the local surface model, resulting in generally smoother normals but also in a longer process. If the radius is too small then the model won't be valid and some - or all - normals will be invalid (the corresponding points will appear in black whatever the camera orientation).

Since version 2.6.2:

  • an 'auto' button is available (if a single cloud is selected) in order to estimate a good starting value for the radius
  • structured clouds can be associated to a grid structure. This grid structure can be used to determine the neighbors around each point. However this is generally not better nor faster. This structure is however very useful to orient the normals properly (see below).

Orientation

When fitting a local model, only the direction of the normal can be computed. The normal orientation (i.e. whether it points outside or inside the object) still needs to be determined.

The user can choose several ways to do this:

  • to leave the normals as they are computed (i.e. with a quite random orientation). Simply uncheck the 'Orientation' checkbox.
  • to use a 'preferred orientation' heuristic:
    • to be as parallel as possible to one of the main axes (X, Y or Z), each time in the positive or negative direction (-X/+X, -Y/+Y, -Z/+Z)
    • to be as parallel as possible to a vector coming from the cloud barycenter and passing through the point or the opposite (+/-Barycenter)
    • to be as parallel as possible to a vector coming from the origin (0,0,0) and passing through the point or the opposite (+/-(0,0,0))
    • to use the previous normal (if any)
  • to use a Minimum Spanning Tree
  • last but not least, since version 2.6.2 if the cloud is associated to a grid structure, then this structure can be used to very guess the right normal orientation quickly and in a very robust way
Normals computed on a cloud (left) then properly oriented with a Minimum Spanning Tree (right)

Computing normals on a mesh

Edit > Normals > Compute dialog - mesh case

If the entity is a mesh, then CC will simply ask the user if the normals should be computed:

  • per-vertex (i.e. the mean normal of all the triangles connected to a vertex is assigned to this vertex - smooth look, no preservation of sharp edges)
  • or per triangle (i.e. the triangle normal is assigned to the triangle - hard/tessellated look, but preserves the sharp edges)
Per-vertex (left) and per-triangle (right) mesh normals