| write_png | R Documentation |
Writes the output of render_mesh() or render_scene()
to a PNG file using the built-in C++ PNG writer (stb_image_write).
No additional R packages are required.
write_png(image, filename)
image |
An image list returned by |
filename |
Output PNG file path. |
No return value; called for side effects.
mesh <- generate_cuboid(c(0, 0, 0), c(1, 1, 1))
img <- render_mesh(mesh$vertices, mesh$triangles)
tmp_file <- tempfile(fileext = ".png")
write_png(img, tmp_file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.