pub struct ClusteringSimplifier {
pub mode: ClusteringMode,
pub representative_strategy: RepresentativeStrategy,
pub preserve_boundary: bool,
pub feature_angle_threshold: f32,
}Expand description
Clustering-based mesh simplifier.
Uses vertex clustering (Rossignac & Borrel 1993) to rapidly simplify meshes. Supports uniform grid and adaptive octree clustering modes, multiple representative selection strategies, boundary preservation, and sharp feature maintenance.
Fields§
§mode: ClusteringModeClustering grid mode (uniform or adaptive octree).
representative_strategy: RepresentativeStrategyStrategy for choosing the representative position of each cluster.
preserve_boundary: boolIf true, boundary vertices are clustered only with other boundary vertices in the same cell, preventing boundary drift.
feature_angle_threshold: f32Dihedral angle threshold (in radians) for sharp feature detection. Edges with dihedral angles exceeding this are treated as features.
Implementations§
Source§impl ClusteringSimplifier
impl ClusteringSimplifier
pub fn new() -> Self
pub fn with_params( mode: ClusteringMode, representative_strategy: RepresentativeStrategy, preserve_boundary: bool, feature_angle_threshold: f32, ) -> Self
Trait Implementations§
Source§impl Default for ClusteringSimplifier
impl Default for ClusteringSimplifier
Source§impl MeshSimplifier for ClusteringSimplifier
impl MeshSimplifier for ClusteringSimplifier
Source§fn simplify(
&self,
mesh: &TriangleMesh,
reduction_ratio: f32,
) -> Result<TriangleMesh>
fn simplify( &self, mesh: &TriangleMesh, reduction_ratio: f32, ) -> Result<TriangleMesh>
Simplify mesh with target reduction ratio (0.0 = no reduction, 1.0 = maximum reduction)
Auto Trait Implementations§
impl Freeze for ClusteringSimplifier
impl RefUnwindSafe for ClusteringSimplifier
impl Send for ClusteringSimplifier
impl Sync for ClusteringSimplifier
impl Unpin for ClusteringSimplifier
impl UnsafeUnpin for ClusteringSimplifier
impl UnwindSafe for ClusteringSimplifier
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
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.