require(rgl)
data(nose)
testmesh <- rmVertex(shortnose.mesh,1:50) ## remove first 50 vertices
if (FALSE) {
shade3d(testmesh,col=3)### view result
}
testmesh$vb <- cbind(testmesh$vb,shortnose.mesh$vb[,1:50]) ## add some unreferenced vertices
if (FALSE) {
points3d(vert2points(testmesh),col=2)## see the vertices in the holes?
}
cleanmesh <- rmUnrefVertex(testmesh)## remove those lonely vertices!
if (FALSE) {
pop3d()
points3d(vert2points(cleanmesh),col=2) ### now the holes are empty!!
}
Run the code above in your browser using DataLab