hypertidy / anglr

Mesh creation and topology for spatial data (and not just geographic)
https://hypertidy.github.io/anglr/
83 stars 10 forks source link

plot3d/persp3d cleanup #98

Closed mdsumner closed 4 years ago

mdsumner commented 4 years ago

currently there's a mix of stuff in there, I think plot3d() is only meant to call persp3d, which in turn can call mesh3d

also

mdsumner commented 4 years ago

So, it seems to be that plot3d.class() should call persp3d() for mesh-alikes, and persp3d.class() does plot3d(as.mesh3d(x)):

 rgl:::persp3d.tri
function (x, z, ..., add = FALSE) 
{
    plot3d(as.mesh3d(x, z, ...), add = add, ...)
}
<bytecode: 0x000000003ce41c18>
<environment: namespace:rgl>
> rgl:::plot3d.tri
function (x, z, ...) 
persp3d(x, z, ...)
<bytecode: 0x000000003ce42cc8>
<environment: namespace:rgl>
mdsumner commented 4 years ago

Check list

check exports of generics

Check - help, links in help,

check textures

plotRGB(cc)
library(raster)
plotRGB(cc)
cc <- cc_location(raster::extent(-180, 180, -85, 85), zoom = 2, type = "mapbox.outdoors")
el <- cc_location(cc)
library(anglr)
x <- as.mesh3d(el, image_texture = cc)
plot3d(x)
plotRGB(cc)
shade3d(x)
rgl::shade3d(x)

as.mesh3d

dot3d

mesh_plot

persp3d

plot3d

shade3d

Then, will need to go back to quadmesh and have it use these functions.

mdsumner commented 4 years ago
shade3d(as.mesh3d(trip::walrus818))
 Error: Can't use NA as column index in a tibble for assignment.
Run `rlang::last_error()` to see where the error occurred. 
mdsumner commented 4 years ago

good enough for now