volume_ashape3d: Volume computation

Description Usage Arguments Details Value See Also Examples

Description

This function calculates the volume of the α-shape of a given sample of points in the three-dimensional space.

Usage

1
volume_ashape3d(as3d, byComponents = FALSE, indexAlpha = 1)

Arguments

as3d

An object of class "ashape3d" that represents the α-shape of a given sample of points in the three-dimensional space, see ashape3d.

byComponents

Logical, if FALSE (default) volume_ashape3d computes the volume of the whole α-shape. If TRUE, volume_ashape3d computes the volume of each connected component of the α-shape separately.

indexAlpha

A single value or vector with the indexes of as3d$alpha that should be used for the computation, see Details.

Details

The function volume_ashape3d computes the volume of the α-shape for each value of α in as3d$alpha[indexAlpha] when indexAlpha is numeric.

If indexAlpha="all" or indexAlpha="ALL" then the function computes the volume of the α-shape for all values of α in as3d$alpha.

Value

If indexAlpha is a single value then the function returns the volume of the α-shape (if the argument byComponents is set to FALSE) or a vector with the volumes of each connected component of the α-shape (if the argument byComponents is set to TRUE).

Otherwise volume_ashape3d returns a list (each object in the list as described above).

See Also

ashape3d, components_ashape3d

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
C1 <- matrix(runif(6000), nc = 3)
C2 <- matrix(runif(6000), nc = 3) + 2
x <- rbind(C1, C2)
ashape3d.obj <- ashape3d(x, alpha = 0.75)
plot(ashape3d.obj, byComponents = TRUE)

# Compute the volume of the alpha-shape
volume_ashape3d(ashape3d.obj)
# Compute the volumes of the connected components of the alpha-shape
volume_ashape3d(ashape3d.obj, byComponents = TRUE)


Search within the alphashape3d package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.