tri <- TRI0(minimal_mesh)
print(tri)
plot(tri)
# obtain the vertices and indices in raw form
## idx is the triplets of row numbers in tri$vertex
idx <- do.call(rbind, sc_object(tri)$topology_)
idx <- as.matrix(idx[c(".vx0", ".vx1", ".vx2")])
## vert is the vertices x_, y_, ...
vert <- as.matrix(sc_vertex(tri))
## now we can plot with generic tools
plot(vert)
polygon(vert[t(cbind(idx, NA)), ])
## or create other structures like rgl's mesh3d
## (see hypertidy/anglr for in-dev helpers)
## rgl::tmesh3d(t(cbind(vert, 1, 1)), t(idx),
## material = list(color = c("firebrick", "black", "grey", "blue")),
## meshColor = "faces")
Run the code above in your browser using DataLab