tm <- quadmesh::triangmesh(volcano)
xyzg <- tibble::tibble(x = tm$vb[1, tm$it],
y = tm$vb[2, tm$it],
z = tm$vb[3, tm$it],
g = rep(seq_len(ncol(tm$it)), each = nrow(tm$it)))
library(ggplot2)
ggplot(xyzg, aes(x, y, group = g, fill = z)) +
geom_polygon()
Created on 2020-02-19 by the reprex package (v0.3.0)
capabilities()