Skip to main content

IoObjWriter

Struct IoObjWriter 

Source
pub struct IoObjWriter<W: Write, F: ObjFloat = f64> { /* private fields */ }

Implementations§

Source§

impl<W: Write, F: ObjFloat> IoObjWriter<W, F>

Source

pub fn new(writer: W) -> Self

Creates a new OBJ writer with default formatting (full precision).

Source

pub fn into_inner(self) -> W

Consume the writer and return the underlying sink.

Trait Implementations§

Source§

impl<W: Write, F: ObjFloat> ObjWriter<F> for IoObjWriter<W, F>

Source§

fn write_comment<S: AsRef<str>>(&mut self, comment: S) -> Result<()>

Source§

fn write_object_name<S: AsRef<str>>(&mut self, name: S) -> Result<()>

Source§

fn write_vertex(&mut self, x: F, y: F, z: F, w: Option<F>) -> Result<()>

Source§

fn write_texture_coordinate( &mut self, u: F, v: Option<F>, w: Option<F>, ) -> Result<()>

Source§

fn write_normal(&mut self, nx: F, ny: F, nz: F) -> Result<()>

Source§

fn write_face( &mut self, vertex_indices: &[(usize, Option<usize>, Option<usize>)], ) -> Result<()>

Source§

fn write_material_lib<S: AsRef<str>>(&mut self, names: &[S]) -> Result<()>

mtllib lib1.mtl lib2.mtl ... - reference one or more material libraries.
Source§

fn write_use_material<S: AsRef<str>>(&mut self, name: S) -> Result<()>

usemtl name - select a material from a previously declared library.
Source§

fn write_group<S: AsRef<str>>(&mut self, names: &[S]) -> Result<()>

g name1 name2 ... - assign subsequent elements to one or more groups.
Source§

fn write_smoothing_group(&mut self, group: SmoothingGroup) -> Result<()>

s 0|off|<n> - select a smoothing group for subsequent faces.
Source§

fn write_line_element( &mut self, indices: &[(usize, Option<usize>)], ) -> Result<()>

l v1[/vt1] v2[/vt2] ... - polyline element. Each index is a vertex, optionally with a texture coordinate.
Source§

fn write_point_element(&mut self, indices: &[usize]) -> Result<()>

p v1 v2 ... - point element.

Auto Trait Implementations§

§

impl<W, F> Freeze for IoObjWriter<W, F>
where W: Freeze,

§

impl<W, F> RefUnwindSafe for IoObjWriter<W, F>

§

impl<W, F> Send for IoObjWriter<W, F>
where W: Send, F: Send,

§

impl<W, F> Sync for IoObjWriter<W, F>
where W: Sync, F: Sync,

§

impl<W, F> Unpin for IoObjWriter<W, F>
where W: Unpin, F: Unpin,

§

impl<W, F> UnsafeUnpin for IoObjWriter<W, F>
where W: UnsafeUnpin,

§

impl<W, F> UnwindSafe for IoObjWriter<W, F>
where W: UnwindSafe, F: UnwindSafe,

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.