[][src]Enum wavefront_rs::obj::entity::Entity

pub enum Entity {
    Comment {
        content: String,
    },
    Object {
        name: String,
    },
    Group {
        name: String,
    },
    SmoothingGroup {
        name: String,
    },
    MergingGroup {
        name: String,
    },
    Mtllib {
        name: String,
    },
    Usemtl {
        name: String,
    },
    Vertex {
        x: f64,
        y: f64,
        z: f64,
        w: Option<f64>,
    },
    VertexNormal {
        x: f64,
        y: f64,
        z: f64,
    },
    VertexTexture {
        u: f64,
        v: Option<f64>,
        w: Option<f64>,
    },
    VertexParameter {
        u: f64,
        v: Option<f64>,
        w: Option<f64>,
    },
    Point {
        vertices: Vec<i64>,
    },
    Line {
        vertices: Vec<i64>,
    },
    Face {
        vertices: Vec<FaceVertex>,
    },
}

Contains all possible entities that can exist in an OBJ format.

Variants

Comment

Fields of Comment

content: String
Object

Fields of Object

name: String
Group

Fields of Group

name: String
SmoothingGroup

Fields of SmoothingGroup

name: String
MergingGroup

Fields of MergingGroup

name: String
Mtllib

Fields of Mtllib

name: String
Usemtl

Fields of Usemtl

name: String
Vertex

Vertex consists of x, y, z and w whereas w is optional.
Example xyzw: v 0.1 1.2 2.3 3.4
Example xyz: v 0.1 1.2 2.3

Fields of Vertex

x: f64y: f64z: f64w: Option<f64>
VertexNormal

VertexNormal consists of x, yand z. The normal will usually but is not required to be a unit vector.
Example: vn 0.1 1.2 2.3

Fields of VertexNormal

x: f64y: f64z: f64
VertexTexture

VertexTexture consists of u, v and w whereas u and w are optional.
Example uvw: vt 0.1 1.2 2.3
Example uv: vt 0.1 1.2
Example u: vt 0.1

Fields of VertexTexture

u: f64v: Option<f64>w: Option<f64>
VertexParameter

VertexParameter consists of u, v and w whereas v and w are optional.
u is a 1D control point in the parameter space of a curve. u + v is a 2D control point in the parameter space of a surface.
Control poins for non rational trimming curves require u + v.
Control points for rational trimming curves require u + v + w.
w defaults to 1.0 if not set.
Example uvw: vp 0.1 1.2 2.3
Example uv: vp 0.1 1.2
Example u: vp 0.1

Fields of VertexParameter

u: f64v: Option<f64>w: Option<f64>
Point

The point entity contains a list of points in space.
Example (3 points): p 0 1 2
Example (1 point): p 0

Fields of Point

vertices: Vec<i64>
Line

Line consists of an arbitrary number (whereas n >= 2) of vertices that describe the path.

Fields of Line

vertices: Vec<i64>
Face

Face consists of an arbitrary number (whereas n >= 3) of complex vertices that describe the polygon.
Example (vertex): f 0 3 6
Example (vertex+normal+texture): f 0/1/2 3/4/5 6/7/8
Example (vertex+normal): f 0/1 3/4 6/7
Example (vertex+texture): f 0//2 3//5 6//8

Fields of Face

vertices: Vec<FaceVertex>

Implementations

impl Entity[src]

pub fn token(&self) -> &str[src]

Trait Implementations

impl Clone for Entity[src]

impl Debug for Entity[src]

impl From<String> for Entity[src]

impl Into<String> for Entity[src]

impl PartialEq<Entity> for Entity[src]

impl StructuralPartialEq for Entity[src]

impl ToString for Entity[src]

Auto Trait Implementations

impl RefUnwindSafe for Entity

impl Send for Entity

impl Sync for Entity

impl Unpin for Entity

impl UnwindSafe for Entity

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.