r-lidar/lidR

RGL displaying clouds very slow

Closed this issue · 3 comments

spono commented

Ciao JR,
in the last 2 months, the RGL device got ultra-slow (1-2 minutes) in showing even small pointclouds (10.000 pts). I tried updating, reinstalling, etc, but nothing changed.

I know that RGL is not your package but I wanted to ask you first because you might have a better idea of how the two packages interact.

Btw, I'm using the devel installation of lidR 2.1 (on Windows).

Thanks!

If it was ok before, and slow after, you must figure out what you did between "before" and "after". But the code of plot did not change since v2.0.0. You can try to display the point cloud outside the plot function. Roughly lidR uses rgl like the following:

LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
x    = lidR::readLAS(LASfile)
minx = min(x@data$X)
miny = min(x@data$Y)
with = list(x = x@data$X - minx, y = x@data$Y - miny, z = x@data$Z)

rgl::open3d()
do.call(rgl::points3d, with)

If the behavior is different from the package something unexpected arises in my plot function.

spono commented

mmm...same behaviour, but running the single steps it seems that the issue arises with rgl::open3d() while do.call(rgl::points3d, with) is quick in plotting the single points

So I can't help you more. Sorry.