CGALSurfaceMesh is an R package that supports processing of
3D surface meshes using as backend the C++ library CGAL for computational
geometry via R package RcppCGAL.
Features:
mesh3d from package rgl, also
compatible with package RvcgThe package also calculates distance and similarity metrics for a given pair of 3D surface meshes (see dkfz metrics reloaded):
See package Rmpfr
for a note on how to install system requirements MPFR and GMP.
This package includes code adapted from packages Boov, cgalMeshes,
and SurfaceReconstruction
developed and copyright by Stéphane Laurent.
Currently, only a subset of the functionality of these packages is
provided in SurfaceMesh.
A fork / adaptation of packages Boov, cgalMeshes,
and SurfaceReconstruction
was carried out as upstream changes to CGAL introduced
incompatibilities, and the packages were archived from CRAN.
The design was chosen such that mesh data resides in R space. This
means that for each mesh operation, data is first transferred to the C++
side (using Rcpp), converted to a CGAL surface mesh,
processed with CGAL functions, and then transferred back to R. The
package does not maintain a pointer to a C++ data structure to keep the
mesh data there - unlike packages such as terra
or cgalMeshes.
This approach carries a performance penalty, but from an R perspective,
it is more straightforward. In particular, there are no serialization
issues (saving meshes). Furthermore, memory management is easier.
This package is provided under the GPL-3 license, but it uses the C++
library CGAL. To use
CGAL for commercial purposes, you must obtain a license from the GeometryFactory.