pub enum Target {
Triangles(usize),
Error(f64),
Verified {
tolerance: f64,
share: f64,
max_triangles: Option<usize>,
},
}Expand description
How far to decimate.
Variants§
Triangles(usize)
Stop once the mesh is down to this many triangles, whatever the error.
Error(f64)
Collapse only while the error stays within this distance.
The honest option: the caller says how wrong the mesh may be and gets however few triangles that allows, rather than naming a count and discovering the error afterwards.
Verified
Collapse within tolerance, then measure the result against the
source both ways and hold whatever the measurement refuses.
Each source vertex is measured to the result, and each result vertex
and triangle centre to the source. A collapse is made only where
every point it moves stays within tolerance, and only where its
triangles meet no other triangle but at the corners they share, so a
mesh that bounded a solid still does. Where a point is farther than
tolerance all the same, which rounding alone can cause, the source
vertices behind it are pinned and the decimation is run again from
the source, until at least share of the points on each side are
within tolerance. The measurement is reported in
Simplified::deviation.
With max_triangles, a result still larger than that is decimated
further, pins released, and the deviation reported is the one
measured on what came out, however far past tolerance it is.
Trait Implementations§
impl Copy for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
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,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.