Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

checkFaceOrientation

check the orientation of a mesh


Description

check the orientation of a mesh assuming that expansion along normals increases centroid size

Usage

checkFaceOrientation(x, offset = NULL)

Arguments

x

mesh of class mesh3d

offset

numeric: amount to offset the mesh along the vertex normals. If NULL a reasonable value will be estimated.

Details

assuming that a correctly (i.e outward) oriented mesh increases its centroid size when 'growing' outwards, this function tests whether this is the case.

Value

returns TRUE if mesh is oriented correctly and FALSE otherwise

Examples

data(dummyhead)
## now we invert faces inwards
checkFaceOrientation(dummyhead.mesh)

if (requireNamespace("Morpho", quietly = TRUE)) {
dummyinward <- Morpho::invertFaces(dummyhead.mesh)
checkFaceOrientation(dummyinward)
}

Rvcg

Manipulations of Triangular Meshes Based on the 'VCGLIB' API

v0.19.2
GPL (>= 2) | file LICENSE
Authors
Stefan Schlager [aut, cre, cph], Girinon Francois [ctb]
Initial release
2021-01-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.