Skip to main content

Mesh3DOptions

Struct Mesh3DOptions 

Source
#[non_exhaustive]
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 (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§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.

Implementations§

Source§

impl Mesh3DOptions

Source

pub fn with_stl_format(self, v: impl Into<Option<StlFormatChoice>>) -> Self

-stl-format.

Source

pub fn with_gltf_format(self, v: impl Into<Option<GltfFormatChoice>>) -> Self

-gltf-format.

Source

pub fn with_render_mode(self, v: impl Into<Option<Mesh3DRenderMode>>) -> Self

-render.

Source

pub fn with_light(self, v: impl Into<Option<LightSpec>>) -> Self

-light.

Source

pub fn with_camera(self, v: impl Into<Option<CameraSpec>>) -> Self

-camera.

Source

pub fn with_projection(self, v: impl Into<Option<ProjectionMode>>) -> Self

-projection.

Source

pub fn with_fov_deg(self, v: impl Into<Option<f32>>) -> Self

-fov DEGREES.

Source

pub fn with_bg(self, v: impl Into<Option<[u8; 4]>>) -> Self

-bg COLOR (RGBA).

Source

pub fn with_aa(self, v: impl Into<Option<u32>>) -> Self

-aa N.

Trait Implementations§

Source§

impl Clone for Mesh3DOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mesh3DOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Mesh3DOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Mesh3DOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Mesh3DOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V