vcgVolume | R Documentation |
Compute volume for manifold meshes
vcgVolume(x)
x |
triangular mesh of class mesh3d |
returns volume
Please note, that this function only works reliably on watertight, coherently oriented meshes that constitute a manifold. In case your mesh has some issues regarding non-manifoldness or there are isolated pieces flying around, you can use vcgIsolated and vcgClean to remove those.
mysphere <- vcgSphere()
vcgVolume(mysphere)
## Not run:
## 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))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.