ashape3d | R Documentation |
This function calculates the 3D α-shape of a given sample of points in the three-dimensional space for α>0.
ashape3d(x, alpha, pert = FALSE, eps = 1e-09)
x |
A 3-column matrix with the coordinates of the input points.
Alternatively, an object of class |
alpha |
A single value or vector of values for α. |
pert |
Logical. If the input points are not in general position and
|
eps |
Scaling factor used for data perturbation when the input points are not in general position, see Details. |
If x
is an object of class "ashape3d"
, then ashape3d
does not recompute the 3D Delaunay triangulation (it reduces the
computational cost).
If the input points x
are not in general position and pert
is
set to TRUE, the function adds random noise to the data. The noise is
generated from a normal distribution with mean zero and standard deviation
eps*sd(x)
.
An object of class "ashape3d"
with the following components
(see Edelsbrunner and Mucke (1994) for notation):
tetra |
For each
tetrahedron of the 3D Delaunay triangulation, the matrix |
triang |
For each triangle of the 3D Delaunay
triangulation, the matrix |
edge |
For each edge of the 3D Delaunay
triangulation, the matrix |
vertex |
For each sample point, the matrix |
x |
A 3-column matrix with the coordinates of the original sample points. |
alpha |
A single value or vector of values of α. |
xpert |
A 3-column matrix with the coordinates of the perturbated
sample points (only when the input points are not in general position and
|
Edelsbrunner, H., Mucke, E. P. (1994). Three-Dimensional Alpha Shapes. ACM Transactions on Graphics, 13(1), pp.43-72.
T1 <- rtorus(1000, 0.5, 2) T2 <- rtorus(1000, 0.5, 2, ct = c(2, 0, 0), rotx = pi/2) x <- rbind(T1, T2) # Value of alpha alpha <- 0.25 # 3D alpha-shape ashape3d.obj <- ashape3d(x, alpha = alpha) plot(ashape3d.obj) # For new values of alpha, we can use ashape3d.obj as input (faster) alpha <- c(0.15, 1) ashape3d.obj <- ashape3d(ashape3d.obj, alpha = alpha) plot(ashape3d.obj, indexAlpha = 2:3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.