Skip to main content

TopologicalParams

Struct TopologicalParams 

Source
#[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

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§axis_align_tol_rad: f32

Maximum 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: f32

Maximum 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: f32

Reject quads whose opposing edges differ in length by more than this factor (paper’s parallelogram test). Default: 1.5.

§edge_length_min_rel: f32

Lower 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: f32

Upper 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: usize

Discard labelled components with fewer than this many corners. Default: 4 (one quad of four corners).

§min_quads_per_component: usize

Discard 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: f32

Per-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

Source

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.

Source

pub fn with_axis_align_tol_rad(self, value: f32) -> Self

Builder-style override for Self::axis_align_tol_rad.

Source

pub fn with_max_axis_sigma_rad(self, value: f32) -> Self

Builder-style override for Self::max_axis_sigma_rad.

Source

pub fn with_opposing_edge_ratio_max(self, value: f32) -> Self

Builder-style override for Self::opposing_edge_ratio_max.

Source

pub fn with_edge_length_min_rel(self, value: f32) -> Self

Builder-style override for Self::edge_length_min_rel.

Source

pub fn with_edge_length_max_rel(self, value: f32) -> Self

Builder-style override for Self::edge_length_max_rel.

Source

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.

Source

pub fn with_min_corners_for_component(self, value: usize) -> Self

Builder-style override for Self::min_corners_for_component.

Source

pub fn with_min_quads_per_component(self, value: usize) -> Self

Builder-style override for Self::min_quads_per_component.

Source

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.

Source

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

Source§

fn clone(&self) -> TopologicalParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TopologicalParams

Source§

impl Debug for TopologicalParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TopologicalParams

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TopologicalParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TopologicalParams

Source§

fn eq(&self, other: &TopologicalParams) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for TopologicalParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TopologicalParams

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.