volume

Volume enclosed by a 3-D alpha shape.

Category: Mathematics > Computational Geometry

Syntax

V = volume(shp)

Returns the volume of the alpha shape shp.

Description

volume is a method of alphaShape. It adds up the volume of the tetrahedra that make up the shape for the current alpha radius. For a shape built from the four corners of a unit tetrahedron, the result is 1/6.

For a 2-D alpha shape, use area instead.

Input arguments

shp
An alphaShape object built from 3-D points.

Output arguments

V
Scalar volume of the region the shape occupies.

Example

Volume of a unit tetrahedron

P = [0 0 0; 1 0 0; 0 1 0; 0 0 1];
shp = alphaShape(P);
V = volume(shp)
Output
V = 0.1667

Notes

Calling volume on a 2-D alphaShape raises the error "Use area for 2-D alpha shapes."

See also

alphaShape area surfaceArea convhulln