Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot3d/persp3d cleanup #98

Closed
mdsumner opened this issue Mar 26, 2020 · 4 comments
Closed

plot3d/persp3d cleanup #98

mdsumner opened this issue Mar 26, 2020 · 4 comments

Comments

@mdsumner
Copy link
Member

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

  • added generic raster texturing with plot(TRI, col = BasicRaster) - why not?
  • apply that across the board, and allow graphics::as.raster, raw matrix, array with 0,1 or 0,255 etc.
@mdsumner
Copy link
Member Author

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 added a commit that referenced this issue Mar 27, 2020
@mdsumner
Copy link
Member Author

mdsumner commented Mar 28, 2020

Check list

check exports of generics

Check - help, links in help,

  • as.mesh3d
  • dot3d
  • mesh_plot
  • persp3d
  • plot3d
  • shade3d
  • wire3d

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)
  • not working as-is, but does work when tracing through manually ...

as.mesh3d

dot3d

  • ARC (works for polygons)
  • ARC does not work for lines (see constrained triangulation on XYZ (needs z-capture-copy) #117)
  • BasicRaster
  • DEL/DEL0
  • PATH/PATH0
  • PATH/PATH0 (doesn't work for non-closed lines, figure out and catch the cases when no triangles get created)
  • QUAD
  • SC/SC0 (same caveats as for ARC, PATH)
  • SC/SC0 (when triangulatable)
  • Spatial
  • TRI/TRI0
  • matrix (array?)
  • mesh3d (already in rgl?)
  • sc
  • sf/sfc
  • sfg ? (not yet)
  • triangulation (the RTriangle one)
  • trip

mesh_plot

  • BasicRaster
  • DEL/DEL0
  • QUAD
  • Spatial
  • TRI/TRI0
  • matrix (array?)
  • mesh3d
  • sf/sfc
  • sfg ? (not yet)
  • triangulation (the RTriangle one)
  • check use of crs for above where relevant (Spatial, sf, raster, sc)

persp3d

  • BasicRaster
  • DEL/DEL0
  • QUAD
  • Spatial
  • TRI/TRI0
  • matrix (array?)
  • mesh3d (already in rgl)
  • sf/sfc
  • sfg ? (not yet)
  • triangulation (the RTriangle one)

plot3d

  • ARC
  • BasicRaster
  • DEL/DEL0
  • PATH/PATH0
  • QUAD
  • SC/SC0
  • Spatial
  • TRI/TRI0
  • matrix (array?)
  • mesh3d (already in rgl)
  • sc - plot the vertices if nothing else
  • sf/sfc
  • sfg ? (not yet)
  • triangulation (the RTriangle one)
  • trip

shade3d

  • ARC
  • BasicRaster
  • DEL/DEL0
  • PATH/PATH0
  • QUAD
  • SC/SC0
  • Spatial
  • TRI/TRI0
  • matrix (array?)
  • mesh3d (already in rgl)
  • sf/sfc (not sfg, PATH0 doesn't support)
  • sfg ? (not yet)
  • triangulation (the RTriangle one)
  • trip

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

@mdsumner
Copy link
Member Author

mdsumner commented Mar 30, 2020

  • add shade3d above
  • sanity check on polygonal holes (cover silicate::plot too), plot, plot3d, mesh_plot, shade3d, etc. etc. PATH/0, TRI/0, DEL/0, and all the sf types in plot3d, persp3d, ...
  • add degenerate paths, this finally makes them useful - automatic interpolation of z_, t_, m_ if present and densification controlled by max_area DEL(point) should work #115
  • trip doesn't work
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 added a commit that referenced this issue Apr 5, 2020
@mdsumner
Copy link
Member Author

good enough for now

@mdsumner mdsumner unpinned this issue Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant