21#ifndef KICAD_PADSTACK_H
22#define KICAD_PADSTACK_H
243 void Serialize( google::protobuf::Any &aContainer )
const override;
244 bool Deserialize(
const google::protobuf::Any &aContainer )
override;
257 wxString
Name()
const;
368 void AppendPrimitives(
const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList,
377 void ReplacePrimitives(
const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList,
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
LSET is a set of PCB_LAYER_IDs.
A PADSTACK defines the characteristics of a single or multi-layer pad, in the IPC sense of the word.
void SetRoundRectRadius(double aRadius, PCB_LAYER_ID aLayer=F_Cu)
const DRILL_PROPS & Drill() const
bool operator==(const PADSTACK &aOther) const
CUSTOM_SHAPE_ZONE_MODE CustomShapeInZoneMode() const
void SetCustomShapeInZoneMode(CUSTOM_SHAPE_ZONE_MODE aM)
std::optional< int > & Clearance(PCB_LAYER_ID aLayer=F_Cu)
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void SetChamferRatio(double aRatio, PCB_LAYER_ID aLayer=F_Cu)
MASK_LAYER_PROPS & FrontOuterLayers()
std::vector< std::shared_ptr< PCB_SHAPE > > & Primitives(PCB_LAYER_ID aLayer=F_Cu)
void SetChamferPositions(int aPositions, PCB_LAYER_ID aLayer=F_Cu)
std::optional< double > & SolderPasteMarginRatio(PCB_LAYER_ID aLayer=F_Cu)
wxString m_customName
! An override for the IPC-7351 padstack name
void SetAnchorShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer=F_Cu)
void SetRoundRectRadiusRatio(double aRatio, PCB_LAYER_ID aLayer=F_Cu)
DRILL_PROPS m_drill
! The primary drill parameters, which also define the start and end layers for through-hole vias and ...
void SetThermalSpokeAngle(EDA_ANGLE aAngle, PCB_LAYER_ID aLayer=F_Cu)
UNCONNECTED_LAYER_MODE m_unconnectedLayerMode
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
COPPER_LAYER_PROPS & CopperLayerDefaults()
std::optional< bool > IsTented(PCB_LAYER_ID aSide) const
Checks if this padstack is tented (covered in soldermask) on the given side.
std::optional< int > & ThermalSpokeWidth(PCB_LAYER_ID aLayer=F_Cu)
std::optional< int > & SolderPasteMargin(PCB_LAYER_ID aLayer=F_Cu)
void SetOrientation(EDA_ANGLE aAngle)
const MASK_LAYER_PROPS & BackOuterLayers() const
std::optional< int > & SolderMaskMargin(PCB_LAYER_ID aLayer=F_Cu)
const LSET & LayerSet() const
PADSTACK & operator=(const PADSTACK &aOther)
std::unordered_map< PCB_LAYER_ID, COPPER_LAYER_PROPS > m_copperOverrides
! Any entries here override the copper layer settings on the given copper layer.
EDA_ANGLE DefaultThermalSpokeAngleForShape(PCB_LAYER_ID aLayer=F_Cu) const
DRILL_PROPS m_secondaryDrill
! Secondary drill, used to define back-drilling
PAD_SHAPE AnchorShape(PCB_LAYER_ID aLayer=F_Cu) const
MASK_LAYER_PROPS m_backMaskProps
! The overrides applied to back outer technical layers
COPPER_LAYER_PROPS m_defaultCopperProps
! The properties applied to copper layers if they aren't overridden
int RoundRectRadius(PCB_LAYER_ID aLayer=F_Cu) const
const COPPER_LAYER_PROPS & CopperLayerDefaults() const
EDA_ANGLE ThermalSpokeAngle(PCB_LAYER_ID aLayer=F_Cu) const
void AppendPrimitives(const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList, PCB_LAYER_ID aLayer=F_Cu)
Appends a copy of each shape in the given list to this padstack's custom shape list.
CUSTOM_SHAPE_ZONE_MODE m_customShapeInZoneMode
How to build the custom shape in zone, to create the clearance area: CUSTOM_SHAPE_ZONE_MODE::OUTLINE ...
void AddPrimitive(PCB_SHAPE *aShape, PCB_LAYER_ID aLayer=F_Cu)
Adds a custom shape primitive to the padstack.
int & ChamferPositions(PCB_LAYER_ID aLayer=F_Cu)
const MASK_LAYER_PROPS & FrontOuterLayers() const
UNCONNECTED_LAYER_MODE UnconnectedLayerMode() const
std::optional< int > & ThermalGap(PCB_LAYER_ID aLayer=F_Cu)
BOARD_ITEM * m_parent
! The BOARD_ITEM this PADSTACK belongs to; will be used as the parent for owned shapes
LSET m_layerSet
! The board layers that this padstack is active on
double RoundRectRadiusRatio(PCB_LAYER_ID aLayer=F_Cu) const
VECTOR2I & TrapezoidDeltaSize(PCB_LAYER_ID aLayer=F_Cu)
PCB_LAYER_ID EndLayer() const
const DRILL_PROPS & SecondaryDrill() const
PAD_DRILL_SHAPE DrillShape(PCB_LAYER_ID aLayer=F_Cu) const
MASK_LAYER_PROPS m_frontMaskProps
! The overrides applied to front outer technical layers
VECTOR2I & Offset(PCB_LAYER_ID aLayer=F_Cu)
void ClearPrimitives(PCB_LAYER_ID aLayer=F_Cu)
virtual ~PADSTACK()=default
@ CUSTOM
Shapes can be defined on arbitrary layers.
@ TOP_INNER_BOTTOM
Up to three shapes can be defined (top, inner, bottom)
DRILL_PROPS & SecondaryDrill()
VECTOR2I & Size(PCB_LAYER_ID aLayer=F_Cu)
void SetDrillShape(PAD_DRILL_SHAPE aShape, PCB_LAYER_ID aLayer=F_Cu)
UNCONNECTED_LAYER_MODE
! Whether or not to remove the copper shape for unconnected layers
@ REMOVE_EXCEPT_START_AND_END
PCB_LAYER_ID StartLayer() const
bool operator!=(const PADSTACK &aOther) const
MASK_LAYER_PROPS & BackOuterLayers()
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
wxString Name() const
! Returns the name of this padstack in IPC-7351 format
double ChamferRatio(PCB_LAYER_ID aLayer=F_Cu) const
PAD_SHAPE Shape(PCB_LAYER_ID aLayer=F_Cu) const
void ReplacePrimitives(const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList, PCB_LAYER_ID aLayer=F_Cu)
Clears the existing primitive list (freeing the owned shapes) and adds copies of the given shapes to ...
EDA_ANGLE GetOrientation() const
void SetLayerSet(const LSET &aSet)
std::optional< ZONE_CONNECTION > & ZoneConnection(PCB_LAYER_ID aLayer=F_Cu)
TYPE
! Padstack type, mostly for IPC-7351 naming and attributes Note that TYPE::MOUNTING is probably not c...
@ NORMAL
Padstack for a footprint pad.
@ MOUNTING
A mounting hole (plated or unplated, not associated with a footprint)
MODE m_mode
! The copper layer variation mode this padstack is in
void SetShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer=F_Cu)
EDA_ANGLE m_orientation
! The rotation of the pad relative to an outer reference frame
Interface for objects that can be serialized to Protobuf messages.
PCB_LAYER_ID
A quick note on layer IDs:
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ SMD
Smd pad, appears on the solder paste layer (default)
@ PTH
Plated through hole pad.
@ CONN
Like smd, does not appear on the solder paste layer (default) Note: also has a special attribute in G...
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
PAD_PROP
The set of pad properties used in Gerber files (Draw files, and P&P files) to define some properties ...
@ FIDUCIAL_LOCAL
a fiducial (usually a smd) local to the parent footprint
@ FIDUCIAL_GLBL
a fiducial (usually a smd) for the full board
@ MECHANICAL
a pad used for mechanical support
@ HEATSINK
a pad used as heat sink, usually in SMD footprints
@ NONE
no special fabrication property
@ TESTPOINT
a test point pad
@ CASTELLATED
a pad with a castellated through hole
@ BGA
Smd pad, used in BGA footprints.
#define DECLARE_ENUM_TO_WXANY(type)
The features of a padstack that can vary between copper layers All parameters are optional; leaving t...
std::optional< ZONE_CONNECTION > zone_connection
std::optional< int > thermal_spoke_width
std::vector< std::shared_ptr< PCB_SHAPE > > custom_shapes
bool operator==(const COPPER_LAYER_PROPS &aOther) const
std::optional< EDA_ANGLE > thermal_spoke_angle
std::optional< int > clearance
std::optional< int > thermal_gap
! The properties of a padstack drill. Drill position is always the pad position (origin).
bool operator==(const DRILL_PROPS &aOther) const
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
! The features of a padstack that can vary on outer layers.
bool operator==(const MASK_LAYER_PROPS &aOther) const
std::optional< int > solder_mask_margin
std::optional< int > solder_paste_margin
std::optional< double > solder_paste_margin_ratio
std::optional< bool > has_solder_mask
True if this outer layer has mask (is not tented)
std::optional< bool > has_solder_paste
True if this outer layer has solder paste.
! The set of properties that define a pad's shape on a given layer
int chamfered_rect_positions
VECTOR2I trapezoid_delta_size
Delta for PAD_SHAPE::TRAPEZOID; half the delta squeezes one end and half expands the other.
double round_rect_corner_radius
VECTOR2I offset
Offset of the shape center from the pad center.
bool operator==(const SHAPE_PROPS &aOther) const
VECTOR2I size
Size of the shape, or of the anchor pad for custom shape pads.
double chamfered_rect_ratio
Size of chamfer: ratio of smallest of X,Y size.
double round_rect_radius_ratio
PAD_SHAPE shape
Shape of the pad.
PAD_SHAPE anchor_shape
Shape of the anchor when shape == PAD_SHAPE::CUSTOM.