This is a point cloud viewer for R. The primary goal of this package is to serve as an alternative backend for displaying point clouds in the lidR package, replacing rgl
.
While rgl
is a powerful package, it has some limitations when it comes to handling large point clouds. The lidRviewer
package is designed to efficiently display arbitrarily large in-memory point clouds, with tested cases including over 880 million points.
- Capable of handling hundred millions of points efficiently if they fits in memory, unlike
rgl
, which may struggle with a few million. - More memory efficient: it requires less additional memory than
rgl
that may require gigabytes to store a full copy of the point cloud. - Provides keyboard controls for changing coloring attributes and point size on-the-fly.
- Features eyes-dome lighting for better visualization.
- Limited functionality: only displays point clouds and does not offer additional features. It is not intended to replace
rgl
for other visualization needs and custom rendering. - Limited to only one windows and thus one rendering.
install.packages('lidRviewer', repos = c('https://r-lidar.r-universe.dev'))
brew install sdl2 mesa mesa-glu
library(lidR)
library(lidRviewer)
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile)
view(las)
# Close the view to continue working in your R session
- Rotate with left mouse button
- Zoom with mouse wheel
- Pan with right mouse button
- Keyboard r or g or b to color with RGB
- Keyboard z to color with Z
- Keyboard i to color with Intensity
- Keyboard c to color with Classification
- Keyboard + or - to change the point size
- Keyboard l to enable/disable eyes-dome lightning
lidRviewer
is based on Markus Schultz thesis with some adaptation and variation. One of the main difference is that Potree spatially indexes the point cloud in dedicated and optimized files on-disk file for an out-of-core rendering. lidRviewer
on its side creates a nested octree on-the-fly on an in-memory data.frame
without modifying the original data (not sorting, no data layout optimization).