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

rgl conversion #12

Closed
mdsumner opened this issue Aug 25, 2016 · 1 comment
Closed

rgl conversion #12

mdsumner opened this issue Aug 25, 2016 · 1 comment

Comments

@mdsumner
Copy link
Member

first stab at mesh3d:

library(rgl)

x <- tetrahedron3d()
class(x)
str(x)
library(tibble)
fun <- function(x) {
  v <- setNames(as_tibble(t(x$vb[1:3, ])), c("x_", "y_", "z_"))
  v$vertex_ <- spbabel:::id_n(nrow(v))
  tXv <- tibble(vertex_ = v$vertex_[x$it], 
                triangle_ = spbabel:::id_n(ncol(x$it))[rep(seq(ncol(x$it)), each = 3)])
  tt <- tibble(triangle_ = tXv$triangle_[seq(ncol(x$it))], object_ = "1")
  o <- tibble(object_ = "1")
  structure(list(o = o, t = tt, tXv = tXv, v = v), class = "trimesh")
}

(Doesn't work)

@mdsumner
Copy link
Member Author

rgl triangles now working

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