inashape3d | R Documentation |
This function checks whether points are inside an α-shape.
inashape3d(as3d, indexAlpha = 1, points)
as3d |
An object of class |
indexAlpha |
A single value or vector with the indexes of
|
points |
A 3-column matrix with the coordinates of the input points. |
The function inashape3d
checks whether each point in points
is
inside the α-shape for each value of α in
as3d$alpha[indexAlpha]
.
If indexAlpha="all"
or indexAlpha="ALL"
then the function
checks whether each point in points
is inside the α-shape
for all values of α in as3d$alpha
.
If indexAlpha
is a single value then the function returns a
vector of boolean of length the number of input points. The element at
position i
is TRUE
if the point in points[i,]
is inside
the α-shape.
Otherwise inashape3d
returns a list of vectors of boolean values
(each object in the list as described above).
ashape3d
T1 <- rtorus(2000, 0.5, 2) T2 <- rtorus(2000, 0.5, 2, ct = c(2, 0, 0), rotx = pi/2) x <- rbind(T1, T2) ashape3d.obj <- ashape3d(x, alpha = 0.4) # Random sample of points in a plane points <- matrix(c(5*runif(10000) - 2.5, rep(0.01, 5000)), nc = 3) in3d <- inashape3d(ashape3d.obj, points = points) plot(ashape3d.obj, transparency = 0.2) colors <- ifelse(in3d, "blue", "green") points3d(points, col = colors)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.