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: f64Minimum laser power to evaluate (W).
power_max: f64Maximum laser power to evaluate (W).
speed_min: f64Minimum scan speed to evaluate (m/s).
speed_max: f64Maximum scan speed to evaluate (m/s).
layer_thickness: f64Layer thickness (m) — fixed during optimisation.
hatch_spacing: f64Hatch spacing (m) — fixed during optimisation.
e_low: f64Lower energy-density threshold for dense parts (J/m³).
e_high: f64Upper energy-density threshold before keyhole (J/m³).
Implementations§
Source§impl ProcessWindowOptimizer
impl ProcessWindowOptimizer
Sourcepub 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
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
Construct a ProcessWindowOptimizer.
Sourcepub fn energy_density(&self, power: f64, speed: f64) -> f64
pub fn energy_density(&self, power: f64, speed: f64) -> f64
Compute volumetric energy density for a (power, speed) pair (J/m³).
Sourcepub fn porosity_score(&self, ev: f64) -> f64
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.
Sourcepub fn roughness_score(&self, speed: f64) -> f64
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.
Trait Implementations§
Source§impl Clone for ProcessWindowOptimizer
impl Clone for ProcessWindowOptimizer
Source§fn clone(&self) -> ProcessWindowOptimizer
fn clone(&self) -> ProcessWindowOptimizer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more