
Last chance! 50% off unlimited learning
Sale ends in
Apply several cleaning algorithms to surface meshes
vcgClean(mesh, sel = 0, tol = 0, silent = FALSE, iterate = FALSE)
cleaned mesh with an additional entry
vector of length = number of vertices before cleaning. Entries = 1 indicate that this vertex was removed; 0 otherwise.
triangular mesh of class 'mesh3d'
integer vector selecting cleaning type (see "details"),
numeric value determining Vertex Displacement Ratio used for splitting non-manifold vertices.
logical, if TRUE no console output is issued.
logical: if TRUE, vcgClean is repeatedly run until nothing more is to be cleaned (see details).
the vector sel determines which operations are performed in which order. E.g. removing degenerate faces may generate unreferenced vertices, thus the ordering of cleaning operations is important, multiple calls are possible (sel=c(1,3,1) will remove unreferenced vertices twice). available options are:
0 = only duplicated vertices and faces are removed
1 = remove unreferenced vertices
2 = Remove non-manifold Faces
3 = Remove degenerate faces
4 = Remove non-manifold vertices
5 = Split non-manifold vertices by threshold
6 = merge close vertices (radius=tol
)
7 = coherently orient faces
CAVEAT: sel=6 will not work keep vertex colors
data(humface)
cleanface <- humface
##add duplicated faces
cleanface$it <- cbind(cleanface$it, cleanface$it[,1:100])
## add duplicated vertices
cleanface$vb <- cbind(cleanface$vb,cleanface$vb[,1:100])
## ad unreferenced vertices
cleanface$vb <- cbind(cleanface$vb,rbind(matrix(rnorm(18),3,6),1))
cleanface <- vcgClean(cleanface, sel=1)
Run the code above in your browser using DataLab