Skip to main content

Pad

Struct Pad 

Source
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: String

Matches a symbol pin number. Empty for mechanical pads.

§at: Point§size: Point

Width (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: bool

Whether a drilled hole is plated. Unplated holes go to the NPTH drill file.

§corner_radius: i32

Corner radius of a PadShape::RoundRect pad, at most half its smaller side.

§back: bool

A 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: PadLayers

Mask and paste overrides of what the pad’s preset generates.

§trapezoid_delta: Point

A 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

Source

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.

Source

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.

Source

pub fn vias_problem(&self) -> Option<String>

Why the pad’s via grid cannot be built, if it cannot.

Source

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.

Source

pub fn corners(&self) -> Option<Vec<Point>>

A trapezoid or custom pad’s corners in footprint coordinates, else None.

Source

pub fn local_shape(&self) -> Shape

The pad’s copper in footprint coordinates.

Source

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.

Source

pub fn copper_sides(&self) -> (bool, bool)

Which sides of the FOOTPRINT the pad’s copper reaches: (front, back).

Source

pub fn mask_open(&self, front: bool) -> bool

Whether the pad gets a solder mask opening on the footprint’s front (or back).

Source

pub fn paste_open(&self, front: bool) -> bool

Whether the pad gets a paste aperture on the footprint’s front (or back).

Source

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.

Source

pub fn local_hole(&self) -> Option<Shape>

The hole in footprint coordinates: a circle, or a slot’s stadium.

Source

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.

Trait Implementations§

Source§

impl Clone for Pad

Source§

fn clone(&self) -> Self

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 Pad

Source§

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

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

impl<'de> Deserialize<'de> for Pad

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Pad

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for Pad

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Pad

Auto Trait Implementations§

§

impl Forget for Pad

§

impl Freeze for Pad

§

impl Move for Pad

§

impl RefUnwindSafe for Pad

§

impl Send for Pad

§

impl Sync for Pad

§

impl Unpin for Pad

§

impl UnsafeUnpin for Pad

§

impl UnwindSafe for Pad

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.