Skip to main content

render_to_file

Function render_to_file 

Source
pub fn render_to_file(filename: &str, width: u32, height: u32) -> Result<()>
Expand description

Renders the current scene to a file.

Creates a headless GPU context, renders one frame of the current scene (all registered structures and quantities), and saves the result as a PNG or JPEG image.

The camera is automatically fitted to the scene bounding box.

ยงExample

use polyscope_rs::*;

init().unwrap();
register_point_cloud("pts", vec![Vec3::ZERO, Vec3::X, Vec3::Y]);
render_to_file("output.png", 800, 600).unwrap();