Skip to main content
← Back to kicad-monkey Rust Docs kicad-monkey Rust Crate API Reference

DesignatorFitSession

Struct DesignatorFitSession 

Source
pub struct DesignatorFitSession {
    pub requests: usize,
    pub hits: usize,
    pub misses: usize,
    /* private fields */
}
Expand description

Relative-fit memoization session for fitting designators across a board.

Fields§

§requests: usize§hits: usize§misses: usize

Implementations§

Source§

impl DesignatorFitSession

Source

pub fn fit( &mut self, designator: &str, region: &MultiPolygon<f64>, fill_ratio: f64, maximum_font_size_mm: f64, auto_base_rotation_degrees: f64, manual_rotation_degrees: Option<f64>, ) -> Option<DesignatorFit>

Fit designator inside region (preserving voids/holes) using DEFAULT_OBLIQUE_MIN_ASPECT_RATIO.

Source

pub fn fit_with_oblique_min_aspect_ratio( &mut self, designator: &str, region: &MultiPolygon<f64>, fill_ratio: f64, maximum_font_size_mm: f64, auto_base_rotation_degrees: f64, manual_rotation_degrees: Option<f64>, oblique_min_aspect_ratio: f64, ) -> Option<DesignatorFit>

Fit designator inside region (preserving voids/holes) with an explicit oblique_min_aspect_ratio threshold (<= 1.0 always aligns oblique parts with the component axes).

Trait Implementations§

Source§

impl Default for DesignatorFitSession

Source§

fn default() -> DesignatorFitSession

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

Source§

type Output = T

Should always be Self
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.
§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

§

fn is_within(&self, b: &G2) -> bool