pub struct Pad {Show 13 fields
pub number: String,
pub at: Point,
pub size: Point,
pub shape: PadShape,
pub drill: Option<i32>,
pub drill_height: Option<i32>,
pub plated: bool,
pub corner_radius: i32,
pub back: bool,
pub layers: PadLayers,
pub trapezoid_delta: Point,
pub polygon: Vec<Point>,
pub vias: Option<PadVias>,
}Fields§
§number: StringMatches a symbol pin number. Empty for mechanical pads.
at: Point§size: PointWidth (x) and height (y) in footprint coordinates.
shape: PadShape§drill: Option<i32>Through-hole drill diameter; None for surface-mount pads. For an OVAL
(slotted) hole, its width along the pad’s x (Pad::drill_height).
drill_height: Option<i32>An oval (slotted) hole’s height along the pad’s y, KiCad’s
(drill oval <width> <height>); None for a round hole of Pad::drill.
plated: boolWhether a drilled hole is plated. Unplated holes go to the NPTH drill file.
corner_radius: i32Corner radius of a PadShape::RoundRect pad, at most half its smaller side.
back: boolA surface-mount pad on the footprint’s BACK copper (B.Cu) rather than its front. A part mounted on the bottom flips this with the rest of the part. Ignored for a drilled pad, which spans every copper layer.
layers: PadLayersMask and paste overrides of what the pad’s preset generates.
trapezoid_delta: PointA PadShape::Trapezoid pad’s taper, KiCad’s rect_delta: x
lengthens the left side and shortens the right by as much, y
lengthens the bottom and shortens the top.
polygon: Vec<Point>A PadShape::Custom pad’s copper: a closed polygon of corners relative
to Pad::at, which it covers.
vias: Option<PadVias>A grid of through vias in a surface-mount pad (a thermal pad’s), owned by the footprint: on a board each is a via on every layer, joined to the pad’s copper.
Implementations§
Source§impl Pad
impl Pad
Sourcepub fn smd(
number: impl Into<String>,
at: Point,
size: Point,
shape: PadShape,
) -> Self
pub fn smd( number: impl Into<String>, at: Point, size: Point, shape: PadShape, ) -> Self
A pad of the given number, place, size and shape with every other property at its default: surface mount, front, no overrides.
Sourcepub fn via_points(&self) -> Vec<Point>
pub fn via_points(&self) -> Vec<Point>
The centres of the pad’s vias in footprint coordinates, row by row from the top left; none without a grid.
Sourcepub fn vias_problem(&self) -> Option<String>
pub fn vias_problem(&self) -> Option<String>
Why the pad’s via grid cannot be built, if it cannot.
Sourcepub fn effective_corner_radius(&self) -> i32
pub fn effective_corner_radius(&self) -> i32
The corner radius actually drawn: the stored one for a rounded rectangle, clamped to half the smaller side, a custom pad’s rounding, else 0.
Sourcepub fn corners(&self) -> Option<Vec<Point>>
pub fn corners(&self) -> Option<Vec<Point>>
A trapezoid or custom pad’s corners in footprint coordinates, else None.
Sourcepub fn local_shape(&self) -> Shape
pub fn local_shape(&self) -> Shape
The pad’s copper in footprint coordinates.
Sourcepub fn outline_problem(&self) -> Option<String>
pub fn outline_problem(&self) -> Option<String>
Why a trapezoid’s taper or a custom pad’s polygon is not copper, if it is not.
Sourcepub fn copper_sides(&self) -> (bool, bool)
pub fn copper_sides(&self) -> (bool, bool)
Which sides of the FOOTPRINT the pad’s copper reaches: (front, back).
Sourcepub fn mask_open(&self, front: bool) -> bool
pub fn mask_open(&self, front: bool) -> bool
Whether the pad gets a solder mask opening on the footprint’s front (or back).
Sourcepub fn paste_open(&self, front: bool) -> bool
pub fn paste_open(&self, front: bool) -> bool
Whether the pad gets a paste aperture on the footprint’s front (or back).
Sourcepub fn hole_size(&self) -> Option<Point>
pub fn hole_size(&self) -> Option<Point>
The hole’s extent, width (x) and height (y) in footprint coordinates: a
round hole’s diameter both ways, a slot’s own two. None with no drill.
Sourcepub fn local_hole(&self) -> Option<Shape>
pub fn local_hole(&self) -> Option<Shape>
The hole in footprint coordinates: a circle, or a slot’s stadium.
Sourcepub fn annular_ring(&self) -> Option<i32>
pub fn annular_ring(&self) -> Option<i32>
The plated copper ring left round the drill, at its narrowest. None for
a pad with no drill or an unplated hole; negative where the hole breaks
out of the copper.