mysphere <- vcgSphere()
vcgVolume(mysphere)
if (FALSE) {
## here is an example where the mesh has some non-manifold vertices
mysphere <- vcgSphere(normals=FALSE)
## add a degenerate face
mysphere$it <- cbind(mysphere$it,c(1,2,1))
try(vcgVolume(mysphere))
## fix the error using vcgClean():
vcgVolume(vcgClean(mysphere,sel=0:6,iterate=TRUE))
}
Run the code above in your browser using DataLab