R/mesh_to_points.R

Defines functions mesh_to_points

Documented in mesh_to_points

#' Transform mesh to 3D point cloud
#'
#' @param mesh A triangular mesh of class mesh3d.
#'
#' @return A data frame with XYZ coordinates.
#' @export
#'
#'

mesh_to_points <- function(mesh) {
  out <- data.frame(t(mesh$vb)[,1:3])
  colnames(out) <- c("x", "y", "z")
  out
}

Try the habtools package in your browser

Any scripts or data that you put into this service are public.

habtools documentation built on May 29, 2024, 7:30 a.m.