vcgIsolated: Remove isolated pieces from a surface mesh or split into...

View source: R/vcgIsolated.r

vcgIsolatedR Documentation

Remove isolated pieces from a surface mesh or split into connected components

Description

Remove isolated pieces from a surface mesh, selected by a minimum amount of faces or of a diameter below a given threshold. Also the option only to keep the largest piece can be selected or to split a mesh into connected components.

Usage

vcgIsolated(
  mesh,
  facenum = NULL,
  diameter = NULL,
  split = FALSE,
  keep = 0,
  silent = FALSE
)

Arguments

mesh

triangular mesh of class "mesh3d".

facenum

integer: all connected pieces with less components are removed. If not specified or 0 and diameter is NULL, then only the component with the most faces is kept.

diameter

numeric: all connected pieces smaller diameter are removed removed. diameter = 0 removes all component but the largest ones. This option overrides the option facenum.

split

logical: if TRUE, a list with all connected components (optionally matching requirements facenum/diameter) of the mesh will be returned.

keep

integer: if split=T, keep specifies the number of largest chunks (number of faces) to keep.

silent

logical, if TRUE no console output is issued.

Value

returns the reduced mesh.

Author(s)

Stefan Schlager

See Also

vcgPlyRead

Examples

## Not run: 
data(humface)
cleanface <- vcgIsolated(humface)

## End(Not run)


Rvcg documentation built on Sept. 30, 2024, 9:39 a.m.