vcgUpdateNormals: updates vertex normals of a triangular meshes or point clouds

Description Usage Arguments Value Examples

View source: R/vcgUpdateNormals.r

Description

update vertex normals of a triangular meshes or point clouds

Usage

1
2
vcgUpdateNormals(mesh, type = 0, pointcloud = c(10, 0),
  silent = FALSE)

Arguments

mesh

triangular mesh of class 'mesh3d' or a n x 3 matrix containing 3D-coordinates.

type

select the method to compute per-vertex normals: 0=area weighted average of surrounding face normals; 1 = angle weighted vertex normals.

pointcloud

integer vector of length 2: containing optional parameters for normal calculation of point clouds. The first enty specifies the number of neighbouring points to consider. The second entry specifies the amount of smoothing iterations to be performed.

silent

logical, if TRUE no console output is issued.

Value

mesh with updated/created normals, or in case mesh is a matrix, a list of class "mesh3d" with

vb

4 x n matrix containing coordinates (as homologous coordinates

normals

4 x n matrix containing normals (as homologous coordinates

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(humface)
humface$normals <- NULL # remove normals
humface <- vcgUpdateNormals(humface)
## Not run: 
pointcloud <- t(humface$vb[1:3,]) #get vertex coordinates
pointcloud <- vcgUpdateNormals(pointcloud)

require(Morpho)
plotNormals(pointcloud)#plot normals

## End(Not run)

zarquon42b/Rvcg documentation built on Jan. 17, 2019, 9:10 a.m.