quadmesh icon indicating copy to clipboard operation
quadmesh copied to clipboard

refactor mesh_plot around mesh3d

Open mdsumner opened this issue 5 years ago • 6 comments

See start at 6e0e215

  • [ ] make mesh_plot.mesh3d the base functionality
  • [ ] what about the quadmesh(, z = ) behaviour? (maybe deprecate in favour of copy_down)
  • [ ] allow textures, but remove raster functions
  • [ ] use coercions to mesh3d for matrix, raster, stars, silicate, sf, etc
  • [ ] figure out where these coercions live, currently most are in anglr, but also quadmesh and sc_triangle (can we have a mesh3d package without importing spatial-spaghetti or rgl?)
  • [ ] colouring is always face-wise, so detect vertex/legacy colouring in rgl and convert + warn
  • [ ] alllow colours that are on the mesh already, unless overridden -if not present scale from vb[3, ]

mdsumner avatar Feb 07 '20 03:02 mdsumner

Also see https://github.com/hypertidy/quadmesh/issues/36

for value lookup via indexing only

mdsumner avatar Feb 08 '20 04:02 mdsumner

  • matrix as base input
  • raster is next (matrix is 0,nrow,0,ncol
  • TRI, and QUAD

A problem is that we need as.mesh3d to be able to apply quad, triangle, and discrete versions of those - but only for stars, raster, matrix. So, as.mesh3d really needs a type, and maybe it's not the right function

mdsumner avatar Feb 09 '20 10:02 mdsumner

And #37

mdsumner avatar Mar 19 '20 19:03 mdsumner

mesh_plot.mesh3d

  • [x] define method
  • [x] include .default method with as.mesh3d(x, )
  • [x] prefer_quad arg
  • [x] use material$color if present, then zlim and col args
  • [ ] establish behaviours of quadmesh(BasicRaster) in light of reproj, then:
  • [ ] refactor .BasicRaster
  • [ ] refactor .quadmesh
  • [ ] refactor .stars
  • [ ] refactor TRI into .sc methods
  • [ ] ~crs arg~ consider crazy idea below
  • [ ] ~coords arg~ ditto

mdsumner avatar Mar 19 '20 19:03 mdsumner

Crazy idea: consider copy_down() for a 2 or 3 layer raster, for 2 you copy onto x, y for 3, copy onto x, y, z - for 1, same as anglr::copy_down(x, raster) now. The lookup is the vertices of x[x, y] in each case. Then we could push coords from mesh_plot, and maybe just enforce the need to reproj(x) instead of allowing crs = .

mdsumner avatar Mar 20 '20 09:03 mdsumner

Also, mesh_plot belongs in anglr. It would export mesh_plot, and the attendant 'as.mesh3d' methods for quadmesh. (Or just remove from quadmesh and point to anglr anyway).

Then as.mesh3d() should get all the coords, crs, copy_down stuff - or we add that to the TRI/DEL/QUAD constructors?

mdsumner avatar Mar 21 '20 06:03 mdsumner