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

PcbGraphic

Struct PcbGraphic 

Source
pub struct PcbGraphic {
Show 22 fields pub kind: PcbGraphicKind, pub text: Option<String>, pub at: Option<PcbPoint>, pub start: Option<PcbPoint>, pub mid: Option<PcbPoint>, pub end: Option<PcbPoint>, pub center: Option<PcbPoint>, pub points: Vec<PcbPoint>, pub polygon_points: Vec<PcbPolygonPoint>, pub layer: Option<String>, pub layers: Option<Vec<String>>, pub net: Option<PcbNetRef>, pub radius: Option<f64>, pub solder_mask_margin: Option<f64>, pub stroke_width: Option<f64>, pub stroke_kind: Option<String>, pub extra_declarations: Vec<String>, pub fill: Option<String>, pub border: Option<bool>, pub locked: bool, pub uuid: Option<String>, pub source_range: Range<usize>,
}
Expand description

A producer-neutral typed view of one board graphic carrier.

Fields§

§kind: PcbGraphicKind§text: Option<String>§at: Option<PcbPoint>§start: Option<PcbPoint>§mid: Option<PcbPoint>§end: Option<PcbPoint>§center: Option<PcbPoint>§points: Vec<PcbPoint>

Compatibility projection containing only authored XY elements. Use polygon_points for complete polygon geometry, including embedded arcs.

§polygon_points: Vec<PcbPolygonPoint>§layer: Option<String>§layers: Option<Vec<String>>

Plural source selector, distinct from the singular layer field. Some([]) preserves an explicitly empty (layers) form.

§net: Option<PcbNetRef>

Authored association; absent and explicit unconnected net zero differ.

§radius: Option<f64>

Source rectangle corner radius in millimetres.

§solder_mask_margin: Option<f64>

Local solder-mask opening margin in millimetres, without rule resolution.

§stroke_width: Option<f64>§stroke_kind: Option<String>§extra_declarations: Vec<String>

Actual richer/unknown declarations outside the ordinary shape projection. Includes unknown stroke leaves; source order and multiplicity are retained.

§fill: Option<String>§border: Option<bool>

Optional gr_text_box border state, including bare/empty forms.

§locked: bool

Board graphic/text lock state. False when the source omits it.

§uuid: Option<String>§source_range: Range<usize>

Implementations§

Source§

impl PcbGraphic

Source

pub fn effective_fill_for_layer(&self, layer: &str) -> &str

Resolve omitted shape fill using KiCad 10.0.6 parsePCB_SHAPE defaults.

The caller supplies the resolved concrete layer; plural source selectors are intentionally not expanded here. Authored tokens (including hatch modes) are returned unchanged, and self.fill remains source evidence. This does not resolve the separate fallback width for unfilled shapes.

Source

pub fn effective_stroke_width_for_layer(&self, layer: &str) -> f64

The outline width in millimetres that pcbnew draws for this shape on layer. pcbnew loads an unfilled shape whose width is zero, negative or absent with its 0.1 mm default line width (parsePCB_SHAPE; seen in kicad-cli 10.0.5 pcb upgrade), and draws no outline for a filled shape (solid or hatched) whose width is not positive. stroke_width stays the stored value.

Trait Implementations§

Source§

impl Clone for PcbGraphic

Source§

fn clone(&self) -> PcbGraphic

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 PcbGraphic

Source§

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

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

impl PartialEq for PcbGraphic

Source§

fn eq(&self, other: &PcbGraphic) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PcbGraphic

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

Source§

type Output = T

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