Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vcgVolume

Compute volume for manifold meshes


Description

Compute volume for manifold meshes

Usage

vcgVolume(x)

Arguments

x

triangular mesh of class mesh3d

Value

returns volume

Note

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.

Examples

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)

Rvcg

Manipulations of Triangular Meshes Based on the 'VCGLIB' API

v0.19.2
GPL (>= 2) | file LICENSE
Authors
Stefan Schlager [aut, cre, cph], Girinon Francois [ctb]
Initial release
2021-01-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.