292 std::optional<PAD_DRILL_POST_MACHINING_MODE>
mode;
310 void Serialize( google::protobuf::Any &aContainer )
const override;
311 bool Deserialize(
const google::protobuf::Any &aContainer )
override;
313 void Serialize( kiapi::board::types::PadStack& aOutput )
const;
314 bool Deserialize(
const kiapi::board::types::PadStack& aInput );
355 wxString
Name()
const;
428 std::optional<bool>
IsCapped()
const;
430 std::optional<bool>
IsFilled()
const;
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Manage layers needed to make a physical board.
Information pertinent to a Pcbnew printed circuit board.
Represent basic circle geometry with utility geometry functions.
An "orientation", held as an angle constrained to the range [0, 360) degrees.
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.
std::optional< bool > IsFilled() const
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)
void AddPrimitive(PCB_SHAPE *aShape, PCB_LAYER_ID aLayer)
Adds a custom shape primitive to the padstack.
void ReplacePrimitives(const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList, PCB_LAYER_ID aLayer)
Clears the existing primitive list (freeing the owned shapes) and adds copies of the given shapes to ...
void SetBackdrillMode(BACKDRILL_MODE aMode)
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
MASK_LAYER_PROPS & FrontOuterLayers()
double Similarity(const PADSTACK &aOther) const
Return a measure of how likely the other object is to represent the same object.
int RoundRectRadius(PCB_LAYER_ID aLayer) const
void SetDrillShape(PAD_DRILL_SHAPE aShape)
int GetMaxHoleSize() const
std::optional< double > & SolderPasteMarginRatio(PCB_LAYER_ID aLayer=F_Cu)
void SetBackdrillSize(bool aTop, std::optional< int > aSize)
void ForEachUniqueLayer(const std::function< void(PCB_LAYER_ID)> &aMethod) const
Runs the given callable for each active unique copper layer in this padstack, meaning F_Cu for MODE::...
void SetThermalSpokeAngle(EDA_ANGLE aAngle, PCB_LAYER_ID aLayer=F_Cu)
void SetRoundRectRadiusRatio(double aRatio, PCB_LAYER_ID aLayer)
UNCONNECTED_LAYER_MODE m_unconnectedLayerMode
void ClearPrimitives(PCB_LAYER_ID aLayer)
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
void SetCustomName(const wxString &aCustomName)
bool HasExplicitDefinitionForLayer(PCB_LAYER_ID aLayer) const
Check if the padstack has an explicit definition for the given layer.
std::optional< bool > IsTented(PCB_LAYER_ID aSide) const
Checks if this padstack is tented (covered in soldermask) on the given side.
int MachiningKnockout(const BOARD &aBoard, PCB_LAYER_ID aLayer) const
Get the diameter of copper removed from aLayer by backdrilling or post-machining.
std::optional< int > & ThermalSpokeWidth(PCB_LAYER_ID aLayer=F_Cu)
std::optional< int > & SolderPasteMargin(PCB_LAYER_ID aLayer=F_Cu)
void FlipLayers(BOARD *aBoard)
Flips the padstack layers in the case that the pad's parent footprint is flipped to the other side of...
POST_MACHINING_PROPS m_backPostMachining
const MASK_LAYER_PROPS & BackOuterLayers() const
std::optional< int > & SolderMaskMargin(PCB_LAYER_ID aLayer=F_Cu)
const DRILL_PROPS * findBackdrillDrill(bool aTop) const
Return the drill slot holding the top (aTop true) or bottom backdrill, identified by its start layer ...
void SetChamferRatio(double aRatio, PCB_LAYER_ID aLayer)
const LSET & LayerSet() const
PCB_LAYER_ID EffectiveLayerFor(PCB_LAYER_ID aLayer) const
Determines which geometry layer should be used for the given input layer.
PADSTACK & operator=(const PADSTACK &aOther)
void SetOffset(const VECTOR2I &aOffset, PCB_LAYER_ID aLayer)
void SetShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
EDA_ANGLE DefaultThermalSpokeAngleForShape(PCB_LAYER_ID aLayer=F_Cu) const
VECTOR2I & TrapezoidDeltaSize(PCB_LAYER_ID aLayer)
DRILL_PROPS m_secondaryDrill
! A back-drill, whose side is given by its start layer rather than by which slot it occupies
void clearBackdrillSide(bool aTop)
Clear every slot whose start layer marks it as the given backdrill side, so a malformed padstack with...
VECTOR2I & Offset(PCB_LAYER_ID aLayer)
MASK_LAYER_PROPS m_backMaskProps
! The overrides applied to back outer technical layers
COPPER_LAYER_PROPS & CopperLayer(PCB_LAYER_ID aLayer)
const POST_MACHINING_PROPS & BackPostMachining() const
EDA_ANGLE ThermalSpokeAngle(PCB_LAYER_ID aLayer=F_Cu) const
CUSTOM_SHAPE_ZONE_MODE m_customShapeInZoneMode
How to build the custom shape in zone, to create the clearance area: CUSTOM_SHAPE_ZONE_MODE::OUTLINE ...
bool unpackCopperLayer(const kiapi::board::types::PadStackLayer &aProto)
PAD_DRILL_SHAPE DrillShape() const
void SetChamferPositions(int aPositions, PCB_LAYER_ID aLayer)
POST_MACHINING_PROPS & FrontPostMachining()
DRILL_PROPS m_tertiaryDrill
! The other back-drill; see findBackdrillDrill() for why either slot may hold either side
void SetRoundRectRadius(double aRadius, PCB_LAYER_ID aLayer)
std::optional< bool > IsPlugged(PCB_LAYER_ID aSide) const
const MASK_LAYER_PROPS & FrontOuterLayers() const
UNCONNECTED_LAYER_MODE UnconnectedLayerMode() const
LSET RelevantShapeLayers(const PADSTACK &aOther) const
Returns the set of layers that must be considered if checking one padstack against another.
std::optional< int > & ThermalGap(PCB_LAYER_ID aLayer=F_Cu)
DRILL_PROPS & TertiaryDrill()
PAD_SHAPE Shape(PCB_LAYER_ID aLayer) const
void SetAnchorShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
EDA_ORIENTATION m_orientation
! The rotation of the pad relative to an outer reference frame
BOARD_ITEM * m_parent
! The BOARD_ITEM this PADSTACK belongs to; will be used as the parent for owned shapes
PADSTACK(BOARD_ITEM *aParent)
const POST_MACHINING_PROPS & FrontPostMachining() const
std::optional< bool > IsCapped() const
std::vector< PCB_LAYER_ID > UniqueLayers() const
void SetBackdrillEndLayer(bool aTop, PCB_LAYER_ID aLayer)
LSET m_layerSet
! The board layers that this padstack is active on
std::optional< int > GetBackdrillSize(bool aTop) const
std::unordered_map< PCB_LAYER_ID, COPPER_LAYER_PROPS > m_copperProps
BACKDRILL_MODE GetBackdrillMode() const
static int Compare(const PADSTACK *aPadstackRef, const PADSTACK *aPadstackCmp)
Compare two padstacks and return 0 if they are equal.
PCB_LAYER_ID EndLayer() const
const DRILL_PROPS & SecondaryDrill() const
std::optional< bool > IsCovered(PCB_LAYER_ID aSide) const
DRILL_PROPS & backdrillWriteSlot(bool aTop)
Return the slot to write a backdrill side into, reusing the slot already holding that side or otherwi...
int & ChamferPositions(PCB_LAYER_ID aLayer)
MASK_LAYER_PROPS m_frontMaskProps
! The overrides applied to front outer technical layers
int PostMachiningKnockout(const BOARD_STACKUP &aStackup, PCB_LAYER_ID aLayer) const
Get the diameter the front and back post-machining operations cut into aLayer.
const VECTOR2I & Size(PCB_LAYER_ID aLayer) const
virtual ~PADSTACK()=default
MODE
! Copper geometry mode: controls how many unique copper layer shapes this padstack has
@ CUSTOM
Shapes can be defined on arbitrary layers.
@ FRONT_INNER_BACK
Up to three shapes can be defined (F_Cu, inner copper layers, B_Cu)
void AppendPrimitives(const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList, PCB_LAYER_ID aLayer)
Appends a copy of each shape in the given list to this padstack's custom shape list.
DRILL_PROPS & SecondaryDrill()
double RoundRectRadiusRatio(PCB_LAYER_ID aLayer) const
PCB_LAYER_ID GetBackdrillEndLayer(bool aTop) const
PCB_LAYER_ID StartLayer() const
POST_MACHINING_PROPS & BackPostMachining()
POST_MACHINING_PROPS m_frontPostMachining
bool operator!=(const PADSTACK &aOther) const
std::unique_ptr< wxString > m_customName
! An override for the IPC-7351 padstack name
PAD_SHAPE AnchorShape(PCB_LAYER_ID aLayer) 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
void SetSize(const VECTOR2I &aSize, PCB_LAYER_ID aLayer)
const DRILL_PROPS & TertiaryDrill() const
void SetOrientation(const EDA_ANGLE &aAngle)
double ChamferRatio(PCB_LAYER_ID aLayer) const
static constexpr PCB_LAYER_ID ALL_LAYERS
! The layer identifier to use for the single defintion on normal padstacks
const wxChar * CustomName() const
static constexpr PCB_LAYER_ID TEMP_ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
EDA_ANGLE GetOrientation() const
static constexpr PCB_LAYER_ID INNER_LAYERS
! The layer identifier to use for "inner layers" on top/inner/bottom padstacks
void SetLayerSet(const LSET &aSet)
std::optional< ZONE_CONNECTION > & ZoneConnection(PCB_LAYER_ID aLayer=F_Cu)
@ 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
std::vector< std::shared_ptr< PCB_SHAPE > > & Primitives(PCB_LAYER_ID aLayer)
A round rectangle shape, based on a rectangle and a radius.
Interface for objects that can be serialized to Protobuf messages.
PCB_LAYER_ID
A quick note on layer IDs:
PAD_DRILL_POST_MACHINING_MODE
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
@ NON_COMPONENT
Pad with no hole that does not connect to a physical component, but rather provides a connection poin...
@ 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_GLBL
a fiducial (usually a smd) for the full board
@ REMOVE_EXCEPT_START_AND_END
#define DECLARE_ENUM_TO_WXANY(type)
The features of a padstack that can vary between copper layers All parameters are optional; leaving t...
double Similarity(const COPPER_LAYER_PROPS &aOther) const
std::optional< ZONE_CONNECTION > zone_connection
int Compare(const COPPER_LAYER_PROPS &aOther) const
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_ORIENTATION > thermal_spoke_angle
std::optional< int > clearance
std::optional< int > thermal_gap
The properties of a padstack drill.
bool operator==(const DRILL_PROPS &aOther) const
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
std::optional< bool > is_capped
True if the drill hole should be capped.
std::optional< bool > is_filled
True if the drill hole should be filled completely.
int Compare(const DRILL_PROPS &aOther) const
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
int Compare(const MASK_LAYER_PROPS &aOther) const
std::optional< bool > has_covering
True if the pad on this side should have covering.
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.
std::optional< bool > has_plugging
True if the drill hole should be plugged on this side.
std::optional< PAD_DRILL_POST_MACHINING_MODE > mode
bool operator==(const POST_MACHINING_PROPS &aOther) const
int Compare(const POST_MACHINING_PROPS &aOther) const
int chamfered_rect_positions
VECTOR2I trapezoid_delta_size
Delta for PAD_SHAPE::TRAPEZOID; half the delta squeezes one end and half expands the other.
int Compare(const SHAPE_PROPS &aOther) const
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.
VECTOR2< int32_t > VECTOR2I