Struct truck_rendimpl::polymesh::PolygonMesh [−][src]
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]
positions: Vec<Point3<f64>, Global>,
uv_coords: Vec<Vector2<f64>, Global>,
normals: Vec<Vector3<f64>, Global>,
faces: Faces
) -> PolygonMesh
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]
positions: Vec<Point3<f64>, Global>,
uv_coords: Vec<Vector2<f64>, Global>,
normals: Vec<Vector3<f64>, Global>,
faces: Faces
) -> Result<PolygonMesh, Error>
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>ⓘ
[src]
Returns the vector of all positions.
pub fn positions_mut(&mut self) -> &mut [Point3<f64>]ⓘ
[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]
I: IntoIterator<Item = Point3<f64>>,
Extend positions by iterator.
pub fn uv_coords(&self) -> &Vec<Vector2<f64>, Global>ⓘ
[src]
Returns the vector of all uv (texture) coordinates.
pub fn uv_coords_mut(&mut self) -> &mut [Vector2<f64>]ⓘ
[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]
I: IntoIterator<Item = Vector2<f64>>,
Extend uv (texture) coordinates by iterator.
pub fn normals(&self) -> &Vec<Vector3<f64>, Global>ⓘ
[src]
Returns the vector of all normals.
pub fn normals_mut(&mut self) -> &mut [Vector3<f64>]ⓘ
[src]
Returns the mutable slice of all normals.
pub fn extend_normals<I>(&mut self, iter: I) where
I: IntoIterator<Item = Vector3<f64>>,
[src]
I: IntoIterator<Item = Vector3<f64>>,
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>ⓘ
[src]
Returns the vector of all triangles of the polygon.
pub fn tri_faces_mut(&mut self) -> &mut [[Vertex; 3]]ⓘ
[src]
Returns the mutable slice of all triangles.
pub fn quad_faces(&self) -> &Vec<[Vertex; 4], Global>ⓘ
[src]
Returns the vector of all quadrangles.
pub fn quad_faces_mut(&mut self) -> &mut [[Vertex; 4]]ⓘ
[src]
Returns the mutable slice of all quadrangles.
pub fn other_faces(&self) -> &[Vec<Vertex, Global>]ⓘ
[src]
Returns the vector of n-gons (n > 4).
pub fn other_faces_mut(&mut self) -> &mut [Vec<Vertex, Global>]ⓘ
[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]
pub fn clone(&self) -> PolygonMesh
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PolygonMesh
[src]
impl<'de> Deserialize<'de> for PolygonMesh
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<PolygonMesh, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<PolygonMesh, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl NormalFilters for PolygonMesh
[src]
pub fn normalize_normals(&mut self) -> &mut PolygonMesh
[src]
pub fn add_naive_normals(&mut self, overwrite: bool) -> &mut PolygonMesh
[src]
pub fn add_smooth_normals(
&mut self,
tol_ang: f64,
overwrite: bool
) -> &mut PolygonMesh
[src]
&mut self,
tol_ang: f64,
overwrite: bool
) -> &mut PolygonMesh
impl OptimizingFilter for PolygonMesh
[src]
pub fn remove_unused_attrs(&mut self) -> &mut PolygonMesh
[src]
pub fn remove_degenerate_faces(&mut self) -> &mut PolygonMesh
[src]
pub fn put_together_same_attrs(&mut self) -> &mut PolygonMesh
[src]
impl PartialEq<PolygonMesh> for PolygonMesh
[src]
pub fn eq(&self, other: &PolygonMesh) -> bool
[src]
pub fn ne(&self, other: &PolygonMesh) -> bool
[src]
impl Polygon for PolygonMesh
[src]
fn buffers(
&self,
vertex_usage: BufferUsage,
index_usage: BufferUsage,
device: &Device
) -> (BufferHandler, BufferHandler)
[src]
&self,
vertex_usage: BufferUsage,
index_usage: BufferUsage,
device: &Device
) -> (BufferHandler, BufferHandler)
fn into_instance(
&self,
creator: &InstanceCreator,
desc: &PolygonInstanceDescriptor
) -> PolygonInstance
[src]
&self,
creator: &InstanceCreator,
desc: &PolygonInstanceDescriptor
) -> PolygonInstance
impl Serialize for PolygonMesh
[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl Splitting for PolygonMesh
[src]
pub fn create_mesh_by_face_indices(&self, indices: &[usize]) -> PolygonMesh
[src]
pub fn extract_planes(
&self,
tol: f64
) -> (Vec<usize, Global>, Vec<usize, Global>)
[src]
&self,
tol: f64
) -> (Vec<usize, Global>, Vec<usize, Global>)
pub fn into_components(&self) -> Vec<Vec<usize, Global>, Global>ⓘ
[src]
impl StructuralPartialEq for PolygonMesh
[src]
impl StructuringFilter for PolygonMesh
[src]
pub fn triangulate(&mut self) -> &mut PolygonMesh
[src]
pub fn quadrangulate(
&mut self,
plane_tol: f64,
score_tol: f64
) -> &mut PolygonMesh
[src]
&mut self,
plane_tol: f64,
score_tol: f64
) -> &mut PolygonMesh
Auto Trait Implementations
impl RefUnwindSafe for PolygonMesh
impl Send for PolygonMesh
impl Sync for PolygonMesh
impl Unpin for PolygonMesh
impl UnwindSafe for PolygonMesh
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,