Struct truck_rendimpl::polymesh::PolygonMesh[][src]

pub struct PolygonMesh { /* fields omitted */ }

Polygon mesh

The polygon data is held in a method compliant with wavefront obj. Position, uv (texture) coordinates, and normal vectors are held in separate arrays, and each face vertex accesses those values by an indices triple.

Implementations

impl PolygonMesh[src]

pub fn new(
    positions: Vec<Point3<f64>, Global>,
    uv_coords: Vec<Vector2<f64>, Global>,
    normals: Vec<Vector3<f64>, Global>,
    faces: Faces
) -> PolygonMesh
[src]

complete constructor

Panics

Panic occurs if there is an index is out of range.

Remarks

This method does not check whether the normal is normalized or not.

pub fn try_new(
    positions: Vec<Point3<f64>, Global>,
    uv_coords: Vec<Vector2<f64>, Global>,
    normals: Vec<Vector3<f64>, Global>,
    faces: Faces
) -> Result<PolygonMesh, Error>
[src]

complete constructor

Errors

Returns Error::OutOfRange if there is an index is out of range.

Remarks

This method does not check whether the normal is normalized or not.

pub fn positions(&self) -> &Vec<Point3<f64>, Global>

Notable traits for Vec<u8, Global>

impl Write for Vec<u8, Global>
[src]

Returns the vector of all positions.

pub fn positions_mut(&mut self) -> &mut [Point3<f64>]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the mutable slice of all positions.

pub fn push_position(&mut self, position: Point3<f64>)[src]

Adds a position.

pub fn extend_positions<I>(&mut self, iter: I) where
    I: IntoIterator<Item = Point3<f64>>, 
[src]

Extend positions by iterator.

pub fn uv_coords(&self) -> &Vec<Vector2<f64>, Global>

Notable traits for Vec<u8, Global>

impl Write for Vec<u8, Global>
[src]

Returns the vector of all uv (texture) coordinates.

pub fn uv_coords_mut(&mut self) -> &mut [Vector2<f64>]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the mutable slice of all uv (texture) coordinates.

pub fn push_uv_coord(&mut self, uv_coord: Vector2<f64>)[src]

Adds a uv (texture) coordinate.

pub fn extend_uv_coords<I>(&mut self, iter: I) where
    I: IntoIterator<Item = Vector2<f64>>, 
[src]

Extend uv (texture) coordinates by iterator.

pub fn normals(&self) -> &Vec<Vector3<f64>, Global>

Notable traits for Vec<u8, Global>

impl Write for Vec<u8, Global>
[src]

Returns the vector of all normals.

pub fn normals_mut(&mut self) -> &mut [Vector3<f64>]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the mutable slice of all normals.

pub fn extend_normals<I>(&mut self, iter: I) where
    I: IntoIterator<Item = Vector3<f64>>, 
[src]

Extend normals by iterator

pub fn faces(&self) -> &Faces[src]

Returns the faces of the polygon.

pub fn tri_faces(&self) -> &Vec<[Vertex; 3], Global>

Notable traits for Vec<u8, Global>

impl Write for Vec<u8, Global>
[src]

Returns the vector of all triangles of the polygon.

pub fn tri_faces_mut(&mut self) -> &mut [[Vertex; 3]]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the mutable slice of all triangles.

pub fn quad_faces(&self) -> &Vec<[Vertex; 4], Global>

Notable traits for Vec<u8, Global>

impl Write for Vec<u8, Global>
[src]

Returns the vector of all quadrangles.

pub fn quad_faces_mut(&mut self) -> &mut [[Vertex; 4]]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the mutable slice of all quadrangles.

pub fn other_faces(&self) -> &[Vec<Vertex, Global>]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the vector of n-gons (n > 4).

pub fn other_faces_mut(&mut self) -> &mut [Vec<Vertex, Global>]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the mutable iterator of n-gons (n > 4).

pub fn face_iter(&'a self) -> impl Iterator<Item = &'a [Vertex]>[src]

Returns the iterator of the slice.

By the internal optimization, this iterator does not runs in the simple order in which they are registered, but runs order: triangle, square, and the others. cf: Faces::face_iter

pub fn face_iter_mut(&'a mut self) -> impl Iterator<Item = &'a mut [Vertex]>[src]

Returns the iterator of the slice.

By the internal optimization, this iterator does not runs in the simple order in which they are registered, but runs order: triangle, square, and the others. cf: Faces::face_iter

pub fn editor(&mut self) -> PolygonMeshEditor<'_>[src]

Creates an editor that performs boundary checking on dropped.

pub fn uncheck_editor(&mut self) -> PolygonMeshEditor<'_>[src]

Creates an editor that does NOT perform boundary checking on dropped.

pub fn debug_editor(&mut self) -> PolygonMeshEditor<'_>[src]

Creates an editor that performs boundary checking on dropped ONLY in debug build.

pub fn merge(&mut self, mesh: PolygonMesh)[src]

Returns polygonmesh merged self and mesh.

pub fn bounding_box(&self) -> BoundingBox<Point3<f64>>[src]

Creates the bounding box of the polygon mesh.

Trait Implementations

impl Clone for PolygonMesh[src]

impl Debug for PolygonMesh[src]

impl<'de> Deserialize<'de> for PolygonMesh[src]

impl NormalFilters for PolygonMesh[src]

impl OptimizingFilter for PolygonMesh[src]

impl PartialEq<PolygonMesh> for PolygonMesh[src]

impl Polygon for PolygonMesh[src]

impl Serialize for PolygonMesh[src]

impl Splitting for PolygonMesh[src]

impl StructuralPartialEq for PolygonMesh[src]

impl StructuringFilter for PolygonMesh[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

impl<T> Instrument for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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

type Owned = T

The resulting type after obtaining ownership.

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.