Skip to main content

write_glb

Function write_glb 

Source
pub fn write_glb(
    solids: &[GlbSolid],
    document_name: &str,
    up: GlbUpAxis,
    unit_scale: f64,
) -> Result<(Vec<u8>, GlbReport), String>
Expand description

Write solids as one binary glTF 2.0 document.

document_name names the scene and its root node; up states the caller’s world up axis and unit_scale the caller’s unit in metres (0.001 for millimetres) — both ride on the root node’s transform, never on the vertices.

Solids with no triangles are SKIPPED (a glTF accessor must hold at least one element); a set in which nothing has a triangle is refused, as the OBJ and STL lanes refuse an empty scene.