Skip to main content

CuttingConfig

Struct CuttingConfig 

Source
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: f64

Kerf width (cutting tool width) in the same units as geometry coordinates. Used for kerf compensation. Set to 0.0 to disable.

§pierce_weight: f64

Weight factor for pierce count in the cost function. Cost = total_rapid_distance + pierce_weight * pierce_count

§max_2opt_iterations: usize

Maximum number of 2-opt improvement iterations. Set to 0 to use only the nearest-neighbor solution.

§time_limit_ms: u64

Wall-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: f64

Machine rapid traverse speed (mm/s or units/s). Used only for time estimation, not for optimization.

§cut_speed: f64

Machine cutting speed (mm/s or units/s). Used only for time estimation, not for optimization.

§exterior_direction: CutDirectionPreference

Default cut direction for exterior contours.

§interior_direction: CutDirectionPreference

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

Number 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: f64

Tolerance for geometric comparisons.

§lead_in: LeadInConfig

Lead-in/lead-out configuration.

§bridge: BridgeConfig

Bridge/tab (micro-joint) configuration.

§thermal: ThermalConfig

Thermal model configuration.

Implementations§

Source§

impl CuttingConfig

Source

pub fn new() -> Self

Creates a new default configuration.

Source

pub fn with_kerf_width(self, width: f64) -> Self

Sets the kerf width.

Source

pub fn with_pierce_weight(self, weight: f64) -> Self

Sets the pierce weight factor.

Source

pub fn with_max_2opt_iterations(self, iterations: usize) -> Self

Sets the maximum 2-opt iterations.

Source

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.

Source

pub fn with_home_position(self, x: f64, y: f64) -> Self

Sets the home position.

Source

pub fn with_pierce_candidates(self, candidates: usize) -> Self

Sets the number of pierce candidates per contour.

Source

pub fn with_lead_in(self, lead_in: LeadInConfig) -> Self

Sets the lead-in/lead-out configuration.

Source

pub fn with_bridge(self, bridge: BridgeConfig) -> Self

Sets the bridge/tab configuration.

Source

pub fn with_thermal(self, thermal: ThermalConfig) -> Self

Sets the thermal model configuration.

Trait Implementations§

Source§

impl Clone for CuttingConfig

Source§

fn clone(&self) -> CuttingConfig

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 Debug for CuttingConfig

Source§

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

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

impl Default for CuttingConfig

Source§

fn default() -> Self

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

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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V