Struct truck_polymesh::StructuredMesh
source · pub struct StructuredMesh { /* private fields */ }
Expand description
structured quadrangle mesh
Implementations§
source§impl StructuredMesh
impl StructuredMesh
sourcepub fn from_surface<S>(
surface: &S,
range: ((f64, f64), (f64, f64)),
tol: f64,
) -> StructuredMeshwhere
S: ParametricSurface3D + ParameterDivision2D,
pub fn from_surface<S>(
surface: &S,
range: ((f64, f64), (f64, f64)),
tol: f64,
) -> StructuredMeshwhere
S: ParametricSurface3D + ParameterDivision2D,
meshing the surface
§Arguments
bspsurface
- bspline surface to meshedtol
- standard tolerance for meshing
source§impl StructuredMesh
impl StructuredMesh
sourcepub fn from_positions(positions: Vec<Vec<Point3>>) -> StructuredMesh
pub fn from_positions(positions: Vec<Vec<Point3>>) -> StructuredMesh
Creates a structured polygon without uv_division
and normal
.
sourcepub fn try_from_positions(
positions: Vec<Vec<Point3>>,
) -> Result<StructuredMesh, Error>
pub fn try_from_positions( positions: Vec<Vec<Point3>>, ) -> Result<StructuredMesh, Error>
Creates a structured polygon without uv_division
and normal
.
sourcepub const fn from_positions_unchecked(
positions: Vec<Vec<Point3>>,
) -> StructuredMesh
pub const fn from_positions_unchecked( positions: Vec<Vec<Point3>>, ) -> StructuredMesh
Creates a structured polygon without uv_division
and normal
.
sourcepub fn from_positions_and_uvs(
positions: Vec<Vec<Point3>>,
(u_div, v_div): (Vec<f64>, Vec<f64>),
) -> StructuredMesh
pub fn from_positions_and_uvs( positions: Vec<Vec<Point3>>, (u_div, v_div): (Vec<f64>, Vec<f64>), ) -> StructuredMesh
Creates a structured polygon without normals.
sourcepub fn try_from_positions_and_uvs(
positions: Vec<Vec<Point3>>,
(u_div, v_div): (Vec<f64>, Vec<f64>),
) -> Result<StructuredMesh, Error>
pub fn try_from_positions_and_uvs( positions: Vec<Vec<Point3>>, (u_div, v_div): (Vec<f64>, Vec<f64>), ) -> Result<StructuredMesh, Error>
Creates a structured polygon without normals.
sourcepub const fn from_positions_and_uvs_unchecked(
positions: Vec<Vec<Point3>>,
uv_divisions: (Vec<f64>, Vec<f64>),
) -> StructuredMesh
pub const fn from_positions_and_uvs_unchecked( positions: Vec<Vec<Point3>>, uv_divisions: (Vec<f64>, Vec<f64>), ) -> StructuredMesh
Creates a structured polygon without normals.
sourcepub fn from_positions_and_normals(
positions: Vec<Vec<Point3>>,
normals: Vec<Vec<Vector3>>,
) -> StructuredMesh
pub fn from_positions_and_normals( positions: Vec<Vec<Point3>>, normals: Vec<Vec<Vector3>>, ) -> StructuredMesh
Creates a structured polygon without uv divisions.
sourcepub fn try_from_positions_and_normals(
positions: Vec<Vec<Point3>>,
normals: Vec<Vec<Vector3>>,
) -> Result<StructuredMesh, Error>
pub fn try_from_positions_and_normals( positions: Vec<Vec<Point3>>, normals: Vec<Vec<Vector3>>, ) -> Result<StructuredMesh, Error>
Creates a structured polygon without uv divisions.
sourcepub const fn from_positions_and_normals_unchecked(
positions: Vec<Vec<Point3>>,
normals: Vec<Vec<Vector3>>,
) -> StructuredMesh
pub const fn from_positions_and_normals_unchecked( positions: Vec<Vec<Point3>>, normals: Vec<Vec<Vector3>>, ) -> StructuredMesh
Creates a structured polygon without uv divisions.
sourcepub fn new(
positions: Vec<Vec<Point3>>,
uv_division: (Vec<f64>, Vec<f64>),
normals: Vec<Vec<Vector3>>,
) -> StructuredMesh
pub fn new( positions: Vec<Vec<Point3>>, uv_division: (Vec<f64>, Vec<f64>), normals: Vec<Vec<Vector3>>, ) -> StructuredMesh
Creates new structured mesh. Checks whether the size of vectors are compatible before creation.
sourcepub fn try_new(
positions: Vec<Vec<Point3>>,
(u_div, v_div): (Vec<f64>, Vec<f64>),
normals: Vec<Vec<Vector3>>,
) -> Result<StructuredMesh, Error>
pub fn try_new( positions: Vec<Vec<Point3>>, (u_div, v_div): (Vec<f64>, Vec<f64>), normals: Vec<Vec<Vector3>>, ) -> Result<StructuredMesh, Error>
Creates new structured mesh. Checks whether the size of vectors are compatible before creation.
sourcepub const fn new_unchecked(
positions: Vec<Vec<Point3>>,
uv_division: (Vec<f64>, Vec<f64>),
normals: Vec<Vec<Vector3>>,
) -> StructuredMesh
pub const fn new_unchecked( positions: Vec<Vec<Point3>>, uv_division: (Vec<f64>, Vec<f64>), normals: Vec<Vec<Vector3>>, ) -> StructuredMesh
Creates new structured mesh. Does not check whether the size of vectors are compatible before creation.
sourcepub fn positions_mut(&mut self) -> Vec<&mut [Point3]>
pub fn positions_mut(&mut self) -> Vec<&mut [Point3]>
Returns the vector of the mutable references to the rows of the positions matrix.
sourcepub fn uv_division(&self) -> Option<(&Vec<f64>, &Vec<f64>)>
pub fn uv_division(&self) -> Option<(&Vec<f64>, &Vec<f64>)>
Returns the divisions of uv coordinates.
sourcepub fn uv_division_mut(&mut self) -> Option<(&mut [f64], &mut [f64])>
pub fn uv_division_mut(&mut self) -> Option<(&mut [f64], &mut [f64])>
Returns the mutable slice of uv coordinates division.
sourcepub fn normals_mut(&mut self) -> Option<Vec<&mut [Vector3]>>
pub fn normals_mut(&mut self) -> Option<Vec<&mut [Vector3]>>
Returns the vector of the mutable references to the rows of the normals matrix.
sourcepub fn destruct(self) -> PolygonMesh
pub fn destruct(self) -> PolygonMesh
Creates new polygon mesh by destructing self
.
Trait Implementations§
source§impl Clone for StructuredMesh
impl Clone for StructuredMesh
source§fn clone(&self) -> StructuredMesh
fn clone(&self) -> StructuredMesh
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StructuredMesh
impl Debug for StructuredMesh
source§impl<'de> Deserialize<'de> for StructuredMesh
impl<'de> Deserialize<'de> for StructuredMesh
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for StructuredMesh
impl RefUnwindSafe for StructuredMesh
impl Send for StructuredMesh
impl Sync for StructuredMesh
impl Unpin for StructuredMesh
impl UnwindSafe for StructuredMesh
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more