Alpha Shape and delaunay triangultion with R

Alpha Shape and delaunay triangultion with R

Doughnut with strawberry topping

# Uniform sample of size n=300 in the annulus B(c, 0.5)\B(c, 0.25) 
# with c=(0.5, 0.5). 
n <- 300
theta<-runif(n,0,2*pi)
r<-sqrt(runif(n,0.25^2,0.5^2))
x<-cbind(0.5+r*cos(theta),0.5+r*sin(theta))

# alpha-shape 
ashape.obj <- ashape(x, alpha = 0.1)

#Plotting the alpha
plot(ashape.obj, wlines= "del", col = c(4, 1, 2, 3), lwd = c(1,3))

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.