## ----include = FALSE---------------------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width=6, fig.height=6 ) ## ----setup-------------------------------------------------------------------- library(ashapesampler) library(alphahull) library(ggplot2) library(doParallel) library(parallel) cores <- min(2L, detectCores()) ## ----------------------------------------------------------------------------- set.seed(201723) my_alpha = 0.15 n = 1000 N= 10 r_maj <- 0.75 r_min <- 0.25 ## ----------------------------------------------------------------------------- ann_list <- list() complex_list <- list() tau_vec <- vector("numeric", N) for (k in 1:N){ ann_pts <- runif_annulus(n, r_maj, r_min) ann_list[[k]] <- ashape(ann_pts, alpha = my_alpha) complex_list[[k]] <- get_alpha_complex(ann_pts, my_alpha) tau_vec[k] <- tau_bound(ann_list[[k]]$x, complex_list[[k]]) } ## ----------------------------------------------------------------------------- choose_2 <- sample(N,2) point_cloud = rbind(ann_list[[choose_2[1]]]$x, ann_list[[choose_2[[2]]]]$x) ## ----------------------------------------------------------------------------- tau_vec2 = c(tau_vec[choose_2[1]], tau_vec[choose_2[2]]) ## ----------------------------------------------------------------------------- new_annulus <- generate_ashape2d(point_cloud, J=2, tau=min(tau_vec2), cores=cores) tri_keep = new_annulus$delvor.obj$tri.obj$trlist[which(new_annulus$delvor.obj$tri.obj$cclist[,3]