mesh_volume: Computes mesh volume

View source: R/mesh_volume.R

mesh_volumeR Documentation

Computes mesh volume

Description

Calculate volume of an arbitrary closed mesh by adding up signed tetrahedron volumes for each constituent triangle. Please ensure that the mesh is clean (e.g. no non-manifold vertices, etc)

Usage

mesh_volume(mesh, par_exec = FALSE, max_cores = NA)

Arguments

mesh

a closed mesh3d object for which volume will be computed

par_exec

boolean indicating whether par_exec processing is to be used. Default value is set to FALSE

max_cores

maximum number of cores to use if parallel processing is requested. Requesting more cores than are physically available will simply result in all cores being used.

Value

numeric value of the computed volume or NA in case of bad input

Note

For small meshes it may be faster to use a single thread due to the overhead associated with starting the processing cluster.

Examples

data(demoFlake1)
mesh_volume(demoFlake1$mesh)

cornelmpop/Lithics3D documentation built on Feb. 10, 2024, 11:54 p.m.