Fast 3D Alpha Hull with Label Propagation

Fast 3D alpha shape (alpha hull) computation with label propagation from input points to hull vertices and faces. Uses 'CGAL' for robust geometric computations. Optimized for Light Detection and Ranging ('LiDAR') processing and tree segmentation workflows. The implementation follows the alpha shape algorithm described in Edelsbrunner et al. (1983) .


C++ R Topology

ahull3D: Fast 3D Alpha Hull with Label Propagation

Ultra-fast 3D alpha shape computation with label propagation from input points to hull vertices and faces. Optimized for tree segmentation workflows.

System Requirements

This package uses RcppCGAL for geometric computations. RcppCGAL is automatically installed from CRAN as a dependency. No external CGAL installation is required.

Dependencies

  • Required: Rcpp, RcppCGAL, rgl, Rvcg
  • Suggested: lidR, RANN, tictoc (for examples)

Installation

# Install from CRAN (once available)
install.packages("ahull3D")

# Development version from GitHub
remotes::install_github("DijoG/ahull3D")

Usage example

library(lidR)
library(dplyr)
library(ahull3D)

# Read tree point cloud
laz_file <- system.file("extdata", "12trees.laz", package = "ahull3D")
trees <- lidR::readLAS(laz_file)

# Prepare data
lasdff <- treesd@data[,c("X", "Y", "Z", "pid")] %>%
  as.data.frame() %>%
  distinct(across(1:3), .keep_all = TRUE) %>%
  as.matrix()

# Compute alpha hull with tree labels ("pid" propagation)
tictoc::tic()
a <- 
  ahull3D::ahull3D(
  points = lasdff[,1:3],
  input_truth = lasdff[,4],   # "pid" column
  alpha = 0.1
  )
tictoc::toc()  # ~25 seconds 

# Access and check results
input_pid <- attr(a, "input_truth")    # a vector of n vertices
face_pid <- attr(a, "face_truth")      # a matrix of 3*n faces 


length(input_pid) == ncol(a$vb)        # should be TRUE
dim(face_pid) == dim(a$it)             # should be TRUE TRUE

Feautures

  • πŸš€ Fast: 25 seconds for 1214385 points
  • 🏷️ Label propagation: Input labels β†’ hull vertices β†’ faces
  • πŸ“ Correct dimensions: input_truth matches vertices, face_truth is 3Γ—faces
  • πŸ”§ RcppCGAL powered: Robust geometric computations

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ahull3D")

1.0.0 by Gergo Dioszegi, 3 months ago


https://github.com/DijoG/ahull3D


Report a bug at https://github.com/DijoG/ahull3D/issues


Browse source code at https://github.com/cran/ahull3D


Authors: Gergo Dioszegi [aut, cre, cph] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports Rcpp, rgl, Rvcg

Suggests RANN, testthat

Linking to Rcpp, RcppEigen, RcppCGAL

System requirements: C++17


See at CRAN