grain3d.orientFaces edit page

set up grain.I_GF such that +/- 1 indicates outgoing/ingoing normals

Description

Some file formats, e.g. Dream3d, do not store the boundary faces of a grain with a consistent winding, i.e., the normals computed from the vertex order point randomly into or out of the grain. This function determines for every face and every adjacent grain whether the stored normal points out of that grain (+1) or into it (-1) and stores the result in grains.I_GF. It also updates grains.boundary.grainId such that the face normal always points from the first to the second grain.

The faces themselves are not modified. Non manifold edges, i.e. edges where the surface of a grain pinches itself, are ignored - the resulting surface patches are oriented independently of each other.

Syntax

grains = grains.orientFaces

Input

grains grain3d

Output

grains grain3d

See also

grain3d.volume grain3Boundary.N