Open mdsumner opened 6 years ago
Geozoo has a bunch of interesting geometries, but not many have edges. You can use ball pivoting from vcg to some extent.
Good grist for rangl.
Mobius ribbon
library(geozoo)
m <- mobius()
library(rgl)
library(Rvcg)
e <- vcgBallPivoting(m$points)
shade3d(e)
Solid cube grid
a <- cube.solid.grid()
segments3d(a$points[t(a$edges), ])
Simplex
sp <- simplex(p = 3)
segments3d(sp$points[t(as.matrix(sp$edges)), ])
Shell
needs a bit to be done properly, including some additions to quadmesh
M <- expand.grid(x = seq(0, 2*pi, length.out = 150),
y = seq(-pi/2, 5.33 *pi/2, length.out = 150))
r <- raster::rasterFromXYZ(cbind(M, 0))
qm <- quadmesh::quadmesh(r)
M <- expand.grid(x = seq(0, 2*pi, length.out = 151),
y = seq(-pi/2, 5.33 *pi/2, length.out = 151))
U <- M$x
V <- M$y
x <- 10 * 1.2^V*(sin(U)^8 * sin(V))
y <- 8 * 1.2^V*(sin(U)^2 * cos(V))
z <- 10 * 1.2^V * (sin(U - 0.4) * cos(U + 0.4))
qm$vb[1:3, ] <- t(cbind(x, y, z))
shade3d(qm, col = "chocolate", alpha = 0.2)
http://gmsh.info/doc/texinfo/gmsh.html
rgl needs ascii read for STL, see demos/sphere-surf.stl explore .geo format
A geographic example using gmsh in python is here: https://github.com/ccorail/qgis-gmsh/wiki
Is it worth using triangles as per polyggon to do this?
the triangles in RSTudio problem: https://github.com/mdsumner/gris/issues/1
Lake Superior, fuse poygons and raster
u <- "https://www.ngdc.noaa.gov/mgg/greatlakes/superior/data/geotiff/superior_lld.geotiff.tar.gz"
tf <- tempdir()
download.file(u, file.path(tf, basename(u)), mode = "wb")
untar(file.path(tf, basename(u)), exdir = tf)
r <- raster::raster(file.path(tf, "superior_lld", "superior_lld.tif"))
rgl::rgl.clear(); plot(anglr(st_transform(sfdct::lakesuperior, 4326), z = r)); rgl::aspect3d(1, 1, 0.1); rgl::rglwidget()
Can we wrap this http://www.cs.unc.edu/~isenburg/sd/
deck.gl with textures in sight
https://github.com/uber/deck.gl/issues/632
elevation wind layers example referred to is https://github.com/uber/deck.gl/blob/0941bdb965e9e599dc850f1f40bce4f167ef6abb/showcases/wind/src/layers/elevation-layer/elevation-layer.js#L31
Hawaii example