powered by
Computes the volume bounded by a mesh.
meshVolume(mesh)
A number, the volume bounded by the mesh.
a mesh given either as a list containing (at least) the two fields vertices (numeric matrix with three columns) and faces (integer matrix or list of integer vectors), otherwise as a rgl mesh (i.e. a mesh3d object)
vertices
faces
mesh3d
library(MeshesTools) R <- 4; r <- 2 mesh <- torusMesh(R, r) meshVolume(mesh) # true volume of the torus: 2 * pi^2 * R * r^2
Run the code above in your browser using DataLab