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

turn extents into quads #127

Open
mdsumner opened this issue May 13, 2020 · 0 comments
Open

turn extents into quads #127

mdsumner opened this issue May 13, 2020 · 0 comments

Comments

@mdsumner
Copy link
Member

I.e.

library(rgl)

source("https://raw.githubusercontent.com/hypertidy/pfft/master/R/extents.R")
library(silicate)
d <- extents(silicate::inlandwaters)
d$z <- runif(nrow(d))
reps <- rep(seq(1, nrow(d)*4, by = 4), each = 4)-1
xl <- c(1, 2, 2, 1) + reps
yl <- c(1, 1, 2, 2) + reps
avb <- rbind(x = as.vector(t(cbind(d$xmn, d$xmx)))[xl], 
             y = as.vector(t(cbind(d$ymn, d$ymx)))[yl], 
             z = rep(d$z, each = 4), 
             h = 1)

idx <- matrix(seq(1, nrow(d) * 4), 4)
mesh <- qmesh3d(avb, idx, meshColor = "faces")
mesh$material$color <- colourvalues::colour_values(d$z)
plot3d(mesh)
aspect3d(1, 1, 1)
@mdsumner mdsumner changed the title turns extents into quads turn extents into quads May 13, 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