#[non_exhaustive]pub struct TopologicalParams {
pub axis_align_tol_rad: f32,
pub max_axis_sigma_rad: f32,
pub opposing_edge_ratio_max: f32,
pub edge_length_min_rel: f32,
pub edge_length_max_rel: f32,
pub min_corners_for_component: usize,
pub min_quads_per_component: usize,
pub axis_cluster_centers: Option<[f32; 2]>,
pub cluster_axis_tol_rad: f32,
}Expand description
Tuning knobs for the axis-driven topological pipeline.
Defaults are conservative values pinned by the crate’s regression tests.
Adding new fields is non-breaking via #[non_exhaustive];
literal-construction from outside the crate goes through Self::default
- struct-update syntax or
Self::new.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.axis_align_tol_rad: f32Maximum angular distance, in radians, between an edge’s direction and a corner’s axis for the edge to classify as a grid edge at that corner. Default: 15° = 0.262 rad.
max_axis_sigma_rad: f32Maximum 1σ axis uncertainty (radians) for a feature axis to be
considered informative. Features whose both axes have
sigma_rad ≥ max_axis_sigma_rad are excluded from Delaunay;
classification skips individual axes above the threshold.
Default: 0.6 ≈ 34°. sigma_rad = None is treated as informative.
opposing_edge_ratio_max: f32Reject quads whose opposing edges differ in length by more than
this factor (paper’s parallelogram test). Default: 1.5.
edge_length_min_rel: f32Lower bound on a quad’s perimeter edge length, expressed as a
fraction of the per-component median quad edge length. Quads
with any edge shorter than edge_length_min_rel * component_median
are rejected as “below local cell scale”. Default: 0.4.
Set to 0.0 to disable the lower bound entirely.
edge_length_max_rel: f32Upper bound on a quad’s perimeter edge length, expressed as a
fraction of the per-component median quad edge length. Quads
with any edge longer than edge_length_max_rel * component_median
are rejected as “above local cell scale” (typically a quad formed
across a missing corner). Default: 2.5. Set to +inf to
disable the upper bound entirely.
min_corners_for_component: usizeDiscard labelled components with fewer than this many corners.
Default: 4 (one quad of four corners).
min_quads_per_component: usizeDiscard connected quad-mesh components below this size. Default:
1 (keep all). Set higher to reject isolated noise quads.
axis_cluster_centers: Option<[f32; 2]>Optional global grid-direction centers, in radians, interpreted
modulo π. When Some([θ₀, θ₁]), a feature is admitted to
Delaunay only if at least one of its informative axes is within
Self::cluster_axis_tol_rad of one of the centers. When
None, the gate is skipped.
cluster_axis_tol_rad: f32Per-axis admission tolerance against
Self::axis_cluster_centers, in radians. Only consulted when
axis_cluster_centers.is_some(). Default: 16° = 0.279.
Implementations§
Source§impl TopologicalParams
impl TopologicalParams
Sourcepub fn new(axis_align_tol_rad: f32, max_axis_sigma_rad: f32) -> Self
pub fn new(axis_align_tol_rad: f32, max_axis_sigma_rad: f32) -> Self
Construct topological params from the two most commonly tuned knobs; the remaining fields take their defaults.
Sourcepub fn with_axis_align_tol_rad(self, value: f32) -> Self
pub fn with_axis_align_tol_rad(self, value: f32) -> Self
Builder-style override for Self::axis_align_tol_rad.
Sourcepub fn with_max_axis_sigma_rad(self, value: f32) -> Self
pub fn with_max_axis_sigma_rad(self, value: f32) -> Self
Builder-style override for Self::max_axis_sigma_rad.
Sourcepub fn with_opposing_edge_ratio_max(self, value: f32) -> Self
pub fn with_opposing_edge_ratio_max(self, value: f32) -> Self
Builder-style override for Self::opposing_edge_ratio_max.
Sourcepub fn with_edge_length_min_rel(self, value: f32) -> Self
pub fn with_edge_length_min_rel(self, value: f32) -> Self
Builder-style override for Self::edge_length_min_rel.
Sourcepub fn with_edge_length_max_rel(self, value: f32) -> Self
pub fn with_edge_length_max_rel(self, value: f32) -> Self
Builder-style override for Self::edge_length_max_rel.
Sourcepub fn with_edge_length_band(self, min_rel: f32, max_rel: f32) -> Self
pub fn with_edge_length_band(self, min_rel: f32, max_rel: f32) -> Self
Set both edge-length bounds in one call. Equivalent to
.with_edge_length_min_rel(min_rel).with_edge_length_max_rel(max_rel).
Pass min_rel = 0.0 to disable the lower bound; pass
max_rel = f32::INFINITY to disable the upper bound.
Sourcepub fn with_min_corners_for_component(self, value: usize) -> Self
pub fn with_min_corners_for_component(self, value: usize) -> Self
Builder-style override for Self::min_corners_for_component.
Sourcepub fn with_min_quads_per_component(self, value: usize) -> Self
pub fn with_min_quads_per_component(self, value: usize) -> Self
Builder-style override for Self::min_quads_per_component.
Sourcepub fn with_axis_cluster_centers(self, centers: [f32; 2]) -> Self
pub fn with_axis_cluster_centers(self, centers: [f32; 2]) -> Self
Builder-style override for Self::axis_cluster_centers. The
two centers are stored as supplied; the caller is responsible
for wrapping them into [0, π) if their source might emit
signed angles. The internal alignment check works modulo π so
either convention is accepted.
Sourcepub fn with_cluster_axis_tol_rad(self, tol_rad: f32) -> Self
pub fn with_cluster_axis_tol_rad(self, tol_rad: f32) -> Self
Builder-style override for Self::cluster_axis_tol_rad.
Trait Implementations§
Source§impl Clone for TopologicalParams
impl Clone for TopologicalParams
Source§fn clone(&self) -> TopologicalParams
fn clone(&self) -> TopologicalParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TopologicalParams
Source§impl Debug for TopologicalParams
impl Debug for TopologicalParams
Source§impl Default for TopologicalParams
impl Default for TopologicalParams
Source§impl<'de> Deserialize<'de> for TopologicalParams
impl<'de> Deserialize<'de> for TopologicalParams
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>,
Source§impl PartialEq for TopologicalParams
impl PartialEq for TopologicalParams
Source§impl Serialize for TopologicalParams
impl Serialize for TopologicalParams
impl StructuralPartialEq for TopologicalParams
Auto Trait Implementations§
impl Freeze for TopologicalParams
impl RefUnwindSafe for TopologicalParams
impl Send for TopologicalParams
impl Sync for TopologicalParams
impl Unpin for TopologicalParams
impl UnsafeUnpin for TopologicalParams
impl UnwindSafe for TopologicalParams
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
impl<T> Scalar for T
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
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>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.