pub struct Mesh3DOptions {
pub stl_format: Option<StlFormatChoice>,
pub gltf_format: Option<GltfFormatChoice>,
pub render_mode: Option<Mesh3DRenderMode>,
pub light: Option<LightSpec>,
pub camera: Option<CameraSpec>,
pub projection: Option<ProjectionMode>,
pub fov_deg: Option<f32>,
pub bg: Option<[u8; 4]>,
pub aa: Option<u32>,
}Expand description
Per-format encoder option flags forwarded to the 3D side-channel.
All fields default to None meaning “use the format crate’s
registry default” — i.e. the existing convert behaviour is
unchanged when no -foo-format flag is supplied.
Fields§
§stl_format: Option<StlFormatChoice>-stl-format ascii|binary. None → registry default (binary).
gltf_format: Option<GltfFormatChoice>-gltf-format glb|embedded|external. None → infer from
output extension (.glb → Glb, .gltf → JsonEmbedded), which
is exactly what the registry’s by-extension lookup already does.
render_mode: Option<Mesh3DRenderMode>-render flat|wireframe|gouraud|phong. None → default
(Mesh3DRenderMode::Flat). Only consulted by the 3D→raster
side-channel; ignored on every other input/output combination.
light: Option<LightSpec>-light AZIMUTH,ELEVATION,INTENSITY. None → renderer
default (LightSpec::default_light). Used by Gouraud / Phong
shading; Flat/Wireframe ignore the light entirely.
camera: Option<CameraSpec>-camera ELEVATION,AZIMUTH,DISTANCE. None → bbox-fit
auto-frame.
projection: Option<ProjectionMode>-projection orthographic|perspective. None →
ProjectionMode::Perspective.
fov_deg: Option<f32>-fov DEGREES — vertical field of view for perspective
projection. None → 60°. Ignored for orthographic projection.
Must be in (0, 180).
bg: Option<[u8; 4]>-bg COLOR — background fill for the render canvas. None →
transparent black [0, 0, 0, 0]. Distinct from -background
(which is the canvas-fill colour for -alpha remove and the
PDF runner) so callers can keep the two paint colours separate.
aa: Option<u32>-aa N — supersampling-anti-aliasing factor. The renderer
rasterises at N × output_w by N × output_h then box-filters
the framebuffer back down to the requested output. None or
Some(1) → no supersampling (every pixel is point-sampled,
matching the round-44 baseline). Values >= 2 trade memory and
CPU for cleaner triangle edges; 2× and 4× are typical. Hard
cap of 8 because at 8× a 1024² render is a 16M-pixel
framebuffer + an 8M f32 z-buffer (~80 MB) and that’s already
further than most users want to push a software renderer.
Trait Implementations§
Source§impl Clone for Mesh3DOptions
impl Clone for Mesh3DOptions
Source§fn clone(&self) -> Mesh3DOptions
fn clone(&self) -> Mesh3DOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more