Skip to main content

ProcessWindowOptimizer

Struct ProcessWindowOptimizer 

Source
pub struct ProcessWindowOptimizer {
    pub power_min: f64,
    pub power_max: f64,
    pub speed_min: f64,
    pub speed_max: f64,
    pub layer_thickness: f64,
    pub hatch_spacing: f64,
    pub e_low: f64,
    pub e_high: f64,
}
Expand description

Scan-speed vs laser-power optimiser for minimal porosity and good surface.

Sweeps a discrete grid of (power, speed) pairs and scores each point using a combined porosity-and-surface-roughness cost function.

Fields§

§power_min: f64

Minimum laser power to evaluate (W).

§power_max: f64

Maximum laser power to evaluate (W).

§speed_min: f64

Minimum scan speed to evaluate (m/s).

§speed_max: f64

Maximum scan speed to evaluate (m/s).

§layer_thickness: f64

Layer thickness (m) — fixed during optimisation.

§hatch_spacing: f64

Hatch spacing (m) — fixed during optimisation.

§e_low: f64

Lower energy-density threshold for dense parts (J/m³).

§e_high: f64

Upper energy-density threshold before keyhole (J/m³).

Implementations§

Source§

impl ProcessWindowOptimizer

Source

pub fn new( power_min: f64, power_max: f64, speed_min: f64, speed_max: f64, layer_thickness: f64, hatch_spacing: f64, e_low: f64, e_high: f64, ) -> Self

Source

pub fn energy_density(&self, power: f64, speed: f64) -> f64

Compute volumetric energy density for a (power, speed) pair (J/m³).

Source

pub fn porosity_score(&self, ev: f64) -> f64

Porosity score for a given energy density (lower is better, 0 = optimal).

Uses a quadratic penalty outside the [e_low, e_high] window.

Source

pub fn roughness_score(&self, speed: f64) -> f64

Surface roughness score for a given scan speed (lower is better).

Higher scan speeds produce rougher surfaces (balling) above a threshold.

Source

pub fn cost(&self, power: f64, speed: f64) -> f64

Combined cost for a (power, speed) pair.

Source

pub fn optimise(&self, n_points: usize) -> (f64, f64)

Sweep n_points × n_points grid and return the (power, speed) with the lowest combined cost.

Trait Implementations§

Source§

impl Clone for ProcessWindowOptimizer

Source§

fn clone(&self) -> ProcessWindowOptimizer

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 ProcessWindowOptimizer

Source§

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

Formats the value using the given formatter. 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<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> 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.