pub struct LevelSetReinit {
pub tol: f64,
pub max_iter: usize,
}Expand description
Level-set reinitialization via fast marching method (redistancing).
Converts an arbitrary level-set function into a proper signed distance function while preserving the zero-level-set location.
Fields§
§tol: f64Convergence tolerance for iterative reinitialization.
max_iter: usizeMaximum number of pseudo-time iterations.
Implementations§
Source§impl LevelSetReinit
impl LevelSetReinit
Sourcepub fn new(tol: f64, max_iter: usize) -> Self
pub fn new(tol: f64, max_iter: usize) -> Self
Create a new reinitialization solver with given tolerance and iteration limit.
§Arguments
tol– convergence tolerance (∞-norm of update)max_iter– maximum pseudo-time steps
Sourcepub fn reinitialize(&self, field: &mut LevelSetField)
pub fn reinitialize(&self, field: &mut LevelSetField)
Reinitialize a level-set field using the PDE-based Sussman scheme.
Integrates ∂φ/∂τ = sign(φ₀)(1 − |∇φ|) until steady state.
Modifies field.data in place.
§Arguments
field– the level-set field to reinitialize
Sourcepub fn fast_sweep(&self, field: &mut LevelSetField, n_sweeps: usize)
pub fn fast_sweep(&self, field: &mut LevelSetField, n_sweeps: usize)
Simple iterative fast marching sweep reinitialization (alternating directions).
Faster than the PDE approach for well-behaved fields; performs n_sweeps
alternating-direction passes of the first-order update.
§Arguments
field– the level-set field to reinitializen_sweeps– number of alternating-direction sweep passes
Auto Trait Implementations§
impl Freeze for LevelSetReinit
impl RefUnwindSafe for LevelSetReinit
impl Send for LevelSetReinit
impl Sync for LevelSetReinit
impl Unpin for LevelSetReinit
impl UnsafeUnpin for LevelSetReinit
impl UnwindSafe for LevelSetReinit
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.