Struct truck_polymesh::polygon_mesh::PolygonMeshEditor [−][src]
Editor of polygon mesh
It has mutable references to all member variables of the polygon mesh as public variables, allowing for any destructive changes for optimization. At drop time, the indices of each vertex are judged to be within the range of the array of attributes, and a panic occurs if there is one outside the range (boundary check).
Examples
use truck_polymesh::*; let positions = vec![ Point3::new(1.0, 0.0, 0.0), Point3::new(0.0, 1.0, 0.0), Point3::new(0.0, 0.0, 1.0), ]; let faces = Faces::from_iter(&[[0, 1, 2]]); let mut mesh = PolygonMesh::new(positions, Vec::new(), Vec::new(), faces); // create editor let editor = mesh.editor(); // destructive changes editor.uv_coords.push(Vector2::new(0.0, 0.0)); editor.faces.tri_faces_mut()[0][0].uv = Some(0);
ⓘ
use truck_polymesh::*; let positions = vec![ Point3::new(1.0, 0.0, 0.0), Point3::new(0.0, 1.0, 0.0), Point3::new(0.0, 0.0, 1.0), ]; let faces = Faces::from_iter(&[[0, 1, 2]]); let mut mesh = PolygonMesh::new(positions, Vec::new(), Vec::new(), faces); // create editor let editor = mesh.editor(); // destructive changes editor.faces.tri_faces_mut()[0][0].uv = Some(0); // Panic occurs since no uv coord is added.
Fields
positions: &'a mut Vec<Point3>
mutable reference to the vector of positions
uv_coords: &'a mut Vec<Vector2>
mutable reference to the vector of uv coordinates
normals: &'a mut Vec<Vector3>
mutable reference to the vector of normals
faces: &'a mut Faces
mutable reference to the faces of the polygon mesh
Trait Implementations
impl<'a> Debug for PolygonMeshEditor<'a>
[src]
impl<'a> Drop for PolygonMeshEditor<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for PolygonMeshEditor<'a>
impl<'a> Send for PolygonMeshEditor<'a>
impl<'a> Sync for PolygonMeshEditor<'a>
impl<'a> Unpin for PolygonMeshEditor<'a>
impl<'a> !UnwindSafe for PolygonMeshEditor<'a>
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,