Learn R Programming

Rvcg (version 0.12.2)

vcgQEdecim: Performs Quadric Edge Decimation on triangular meshes.

Description

Decimates a mesh by adapting the faces of a mesh either to a target face number, a percentage or an approximate mesh resolution (a.k.a. mean edge length

Usage

vcgQEdecim(mesh, tarface = NULL, percent = NULL, edgeLength = NULL,
  topo = FALSE, quality = TRUE, bound = FALSE, optiplace = TRUE,
  scaleindi = TRUE, normcheck = FALSE, safeheap = FALSE, qthresh = 0.3,
  boundweight = 1, normalthr = pi/2, silent = FALSE)

Arguments

mesh
Triangular mesh of class "mesh3d"
tarface
Integer: set number of target faces.
percent
Numeric: between 0 and 1. Set amount of reduction relative to existing face number. Overrides tarface argument.
edgeLength
Numeric: tries to decimate according to a target mean edge length. Under the assumption of regular triangles, the edges are half as long by dividing the triangle into 4 regular smaller triangles.
topo
logical: if TRUE, mesh topology is preserved.
quality
logical: if TRUE, vertex quality is considered.
bound
logical: if TRUE, mesh boundary is preserved.
optiplace
logical: if TRUE, mesh boundary is preserved.
scaleindi
logical: if TRUE, decimatiion is scale independent.
normcheck
logical: if TRUE, normal directions are considered.
safeheap
logical: if TRUE, safeheap update option enabled.
qthresh
numeric: Quality threshold for decimation process.
boundweight
numeric: Weight assigned to mesh boundaries.
normalthr
numeric: threshold for normal check in radians.
silent
logical, if TRUE no console output is issued.

Value

  • Returns a reduced mesh of class mesh3d.

Details

This is basically an adaption of the cli tridecimator from vcglib

See Also

vcgSmooth

Examples

Run this code
data(humface)
##reduce faces to 50\%
decimface <- vcgQEdecim(humface, percent=0.5)
## view
require(rgl)
shade3d(decimface, col=3)

## some light smoothing
decimface <- vcgSmooth(decimface,iteration = 1)

Run the code above in your browser using DataLab