meshVolume: Mesh volume

View source: R/measures.R

meshVolumeR Documentation

Mesh volume

Description

Computes the volume bounded by a mesh.

Usage

meshVolume(mesh)

Arguments

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)

Value

A number, the volume bounded by the mesh.

Examples

library(MeshesOperations)
R <- 4; r <- 2
mesh <- torusMesh(R, r)
meshVolume(mesh)
# true volume of the torus: 
2 * pi^2 * R * r^2

stla/MeshesOperations documentation built on Oct. 23, 2022, 8:23 a.m.