pub struct CuttingConfig {Show 14 fields
pub kerf_width: f64,
pub pierce_weight: f64,
pub max_2opt_iterations: usize,
pub time_limit_ms: u64,
pub rapid_speed: f64,
pub cut_speed: f64,
pub exterior_direction: CutDirectionPreference,
pub interior_direction: CutDirectionPreference,
pub home_position: (f64, f64),
pub pierce_candidates: usize,
pub tolerance: f64,
pub lead_in: LeadInConfig,
pub bridge: BridgeConfig,
pub thermal: ThermalConfig,
}Expand description
Configuration parameters for cutting path optimization.
Fields§
§kerf_width: f64Kerf width (cutting tool width) in the same units as geometry coordinates. Used for kerf compensation. Set to 0.0 to disable.
pierce_weight: f64Weight factor for pierce count in the cost function. Cost = total_rapid_distance + pierce_weight * pierce_count
max_2opt_iterations: usizeMaximum number of 2-opt improvement iterations. Set to 0 to use only the nearest-neighbor solution.
time_limit_ms: u64Wall-clock budget (in milliseconds) for the 2-opt improvement phase.
The 2-opt neighborhood is O(n^2) candidate moves per pass, and each
pass may repeat up to max_2opt_iterations times, so on large inputs
the iteration cap alone can still run for many seconds — blocking the
(browser main) thread. When this budget is exceeded the optimizer stops
and returns the best sequence found so far; cut-path order is a
heuristic, so early termination never invalidates the result.
Set to 0 for no wall-clock limit (bounded only by
max_2opt_iterations). Default: 5000 (5 seconds).
rapid_speed: f64Machine rapid traverse speed (mm/s or units/s). Used only for time estimation, not for optimization.
cut_speed: f64Machine cutting speed (mm/s or units/s). Used only for time estimation, not for optimization.
exterior_direction: CutDirectionPreferenceDefault cut direction for exterior contours.
interior_direction: CutDirectionPreferenceDefault cut direction for interior contours (holes).
home_position: (f64, f64)Home position for the cutting head (start/end point). Default is (0.0, 0.0).
pierce_candidates: usizeNumber of candidate pierce points to evaluate per contour. Higher values give better pierce point selection but slower optimization. Default: 1 (use nearest point on contour to previous endpoint).
tolerance: f64Tolerance for geometric comparisons.
lead_in: LeadInConfigLead-in/lead-out configuration.
bridge: BridgeConfigBridge/tab (micro-joint) configuration.
thermal: ThermalConfigThermal model configuration.
Implementations§
Source§impl CuttingConfig
impl CuttingConfig
Sourcepub fn with_kerf_width(self, width: f64) -> Self
pub fn with_kerf_width(self, width: f64) -> Self
Sets the kerf width.
Sourcepub fn with_pierce_weight(self, weight: f64) -> Self
pub fn with_pierce_weight(self, weight: f64) -> Self
Sets the pierce weight factor.
Sourcepub fn with_max_2opt_iterations(self, iterations: usize) -> Self
pub fn with_max_2opt_iterations(self, iterations: usize) -> Self
Sets the maximum 2-opt iterations.
Sourcepub fn with_time_limit_ms(self, time_limit_ms: u64) -> Self
pub fn with_time_limit_ms(self, time_limit_ms: u64) -> Self
Sets the wall-clock budget (ms) for the 2-opt phase. 0 = unlimited.
Sourcepub fn with_home_position(self, x: f64, y: f64) -> Self
pub fn with_home_position(self, x: f64, y: f64) -> Self
Sets the home position.
Sourcepub fn with_pierce_candidates(self, candidates: usize) -> Self
pub fn with_pierce_candidates(self, candidates: usize) -> Self
Sets the number of pierce candidates per contour.
Sourcepub fn with_lead_in(self, lead_in: LeadInConfig) -> Self
pub fn with_lead_in(self, lead_in: LeadInConfig) -> Self
Sets the lead-in/lead-out configuration.
Sourcepub fn with_bridge(self, bridge: BridgeConfig) -> Self
pub fn with_bridge(self, bridge: BridgeConfig) -> Self
Sets the bridge/tab configuration.
Sourcepub fn with_thermal(self, thermal: ThermalConfig) -> Self
pub fn with_thermal(self, thermal: ThermalConfig) -> Self
Sets the thermal model configuration.
Trait Implementations§
Source§impl Clone for CuttingConfig
impl Clone for CuttingConfig
Source§fn clone(&self) -> CuttingConfig
fn clone(&self) -> CuttingConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CuttingConfig
impl Debug for CuttingConfig
Auto Trait Implementations§
impl Freeze for CuttingConfig
impl RefUnwindSafe for CuttingConfig
impl Send for CuttingConfig
impl Sync for CuttingConfig
impl Unpin for CuttingConfig
impl UnsafeUnpin for CuttingConfig
impl UnwindSafe for CuttingConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.