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: boolBoard graphic/text lock state. False when the source omits it.
uuid: Option<String>§source_range: Range<usize>Implementations§
Source§impl PcbGraphic
impl PcbGraphic
Sourcepub fn effective_fill_for_layer(&self, layer: &str) -> &str
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.
Sourcepub fn effective_stroke_width_for_layer(&self, layer: &str) -> f64
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
impl Clone for PcbGraphic
Source§fn clone(&self) -> PcbGraphic
fn clone(&self) -> PcbGraphic
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more