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

updateNormals

Compute face or vertex normals of a triangular mesh


Description

Compute face or vertex normals of a triangular mesh of class "mesh3d"

Usage

updateNormals(x, angle = TRUE)

facenormals(x)

Arguments

x

triangular mesh of class "mesh3d"

angle

logical: if TRUE, angle weighted normals are used.

Value

updateNormals returns mesh with updated vertex normals.

facenormals returns an object of class "mesh3d" with

vb

faces' barycenters

normals

faces' normals

Note

only supports triangular meshes

Author(s)

Stefan Schlager

References

Baerentzen, Jakob Andreas. & Aanaes, H., 2002. Generating Signed Distance Fields From Triangle Meshes. Informatics and Mathematical Modelling, .

See Also

Examples

require(rgl)
require(Morpho)
data(nose)
### calculate vertex normals
shortnose.mesh$normals <- NULL ##remove normals
## Not run: 
shade3d(shortnose.mesh,col=3)##render

## End(Not run)
shortnose.mesh <- updateNormals(shortnose.mesh)
## Not run: 
rgl.clear()
shade3d(shortnose.mesh,col=3)##smoothly rendered now

## End(Not run)
## calculate facenormals
facemesh <- facenormals(shortnose.mesh)
## Not run: 
plotNormals(facemesh,long=0.01)
points3d(vert2points(facemesh),col=2)
wire3d(shortnose.mesh)

## End(Not run)

Morpho

Calculations and Visualisations Related to Geometric Morphometrics

v2.8
GPL-2
Authors
Stefan Schlager [aut, cre, cph], Gregory Jefferis [ctb], Dryden Ian [cph]
Initial release
2020-02-26

We don't support your browser anymore

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