KiCad PCB EDA Suite
Loading...
Searching...
No Matches
padstack.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2024 Jon Evans <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef KICAD_PADSTACK_H
22#define KICAD_PADSTACK_H
23
24#include <memory>
25#include <optional>
26#include <wx/string.h>
27
28#include <api/serializable.h>
29#include <geometry/eda_angle.h>
30#include <layer_ids.h>
31#include <lset.h>
32#include <math/vector2d.h>
33#include <properties/property.h>
34#include <zones.h>
35
36class BOARD_ITEM;
37class PCB_SHAPE;
38
39namespace kiapi::board::types
40{
41 class PadStack;
42 class PadStackLayer;
43}
44
45
51enum class PAD_SHAPE : int
52{
53 CIRCLE,
54 RECTANGLE, // do not use just RECT: it collides in a header on MSYS2
55 OVAL,
58
59 // Rectangle with a chamfered corner ( and with rounded other corners).
61 CUSTOM // A shape defined by user, using a set of basic shapes
62 // (thick segments, circles, arcs, polygons).
63};
64
69{
71 CIRCLE,
72 OBLONG,
73};
74
80enum class PAD_ATTRIB
81{
82 PTH,
83 SMD,
84 CONN,
87 NPTH,
89};
90
91
97enum class PAD_PROP
98{
99 NONE,
100 BGA,
103 TESTPOINT,
104 HEATSINK,
106 MECHANICAL,
107 PRESSFIT
108};
109
110
124class PADSTACK : public SERIALIZABLE
125{
126public:
129 enum class TYPE
130 {
131 NORMAL,
132 VIA,
133 MOUNTING
134 };
135
137 enum class MODE
138 {
139 NORMAL,
141 CUSTOM
142 };
143
145 static constexpr PCB_LAYER_ID ALL_LAYERS = F_Cu;
146
148 static constexpr PCB_LAYER_ID INNER_LAYERS = In1_Cu;
149
152 {
153 KEEP_ALL,
157 };
158
160 {
161 OUTLINE,
163 };
164
167 {
171
172 /*
173 * Most of the time the hole is the center of the shape (m_Offset = 0). But some designers
174 * use oblong/rect pads with a hole moved to one of the oblong/rect pad shape ends.
175 * In all cases the hole is at the pad position. This offset is from the hole to the center
176 * of the pad shape (ie: the copper area around the hole).
177 * ShapePos() returns the board shape position according to the offset and the pad rotation.
178 */
180
185
191
192 SHAPE_PROPS();
193 bool operator==( const SHAPE_PROPS& aOther ) const;
194 };
195
209 {
211 std::optional<ZONE_CONNECTION> zone_connection;
212 std::optional<int> thermal_spoke_width;
213 std::optional<EDA_ANGLE> thermal_spoke_angle;
214 std::optional<int> thermal_gap;
215 std::optional<int> clearance;
216
217 /*
218 * Editing definitions of primitives for custom pad shapes. In local coordinates relative
219 * to m_Pos (NOT shapePos) at orient 0.
220 */
221 std::vector<std::shared_ptr<PCB_SHAPE>> custom_shapes;
222
223 bool operator==( const COPPER_LAYER_PROPS& aOther ) const;
224 };
225
229 {
230 std::optional<int> solder_mask_margin;
231 std::optional<int> solder_paste_margin;
232 std::optional<double> solder_paste_margin_ratio;
233
234 std::optional<bool> has_solder_mask;
235 std::optional<bool> has_solder_paste;
236 std::optional<bool> has_covering;
237 std::optional<bool> has_plugging;
238
239 bool operator==( const MASK_LAYER_PROPS& aOther ) const;
240 };
241
244 {
249
250 std::optional<bool> is_filled;
251 std::optional<bool> is_capped;
252
253 bool operator==( const DRILL_PROPS& aOther ) const;
254 };
255
256public:
257 PADSTACK( BOARD_ITEM* aParent );
258 virtual ~PADSTACK() = default;
259 PADSTACK( const PADSTACK& aOther );
260 PADSTACK& operator=( const PADSTACK &aOther );
261
262 bool operator==( const PADSTACK& aOther ) const;
263 bool operator!=( const PADSTACK& aOther ) const { return !operator==( aOther ); }
264
265 void Serialize( google::protobuf::Any &aContainer ) const override;
266 bool Deserialize( const google::protobuf::Any &aContainer ) override;
267
274 static int Compare( const PADSTACK* aPadstackRef, const PADSTACK* aPadstackCmp );
275
280 double Similarity( const PADSTACK& aOther ) const;
281
282 const LSET& LayerSet() const { return m_layerSet; }
283 LSET& LayerSet() { return m_layerSet; }
284 void SetLayerSet( const LSET& aSet ) { m_layerSet = aSet; }
285
290 void FlipLayers( int aCopperLayerCount );
291
292 PCB_LAYER_ID StartLayer() const;
293 PCB_LAYER_ID EndLayer() const;
294
295 MODE Mode() const { return m_mode; }
296 void SetMode( MODE aMode );
297
299 wxString Name() const;
300
303 {
304 m_orientation = aAngle;
306 }
307
308 DRILL_PROPS& Drill() { return m_drill; }
309 const DRILL_PROPS& Drill() const { return m_drill; }
310
312 const DRILL_PROPS& SecondaryDrill() const { return m_secondaryDrill; }
313
316
317 COPPER_LAYER_PROPS& CopperLayer( PCB_LAYER_ID aLayer );
318 const COPPER_LAYER_PROPS& CopperLayer( PCB_LAYER_ID aLayer ) const;
319
322
325
332 std::optional<bool> IsTented( PCB_LAYER_ID aSide ) const;
333
334 std::optional<bool> IsCovered( PCB_LAYER_ID aSide ) const;
335
336 std::optional<bool> IsPlugged( PCB_LAYER_ID aSide ) const;
337
338 std::optional<bool> IsCapped() const;
339
340 std::optional<bool> IsFilled() const;
341
344
351 void ForEachUniqueLayer( const std::function<void( PCB_LAYER_ID )>& aMethod ) const;
352
353 std::vector<PCB_LAYER_ID> UniqueLayers() const;
354
365
371 LSET RelevantShapeLayers( const PADSTACK& aOther ) const;
372
373 // The following section has convenience getters for the padstack properties on a given layer.
374
375 PAD_SHAPE Shape( PCB_LAYER_ID aLayer ) const;
376 void SetShape( PAD_SHAPE aShape, PCB_LAYER_ID aLayer );
377
378 // Setter rather than direct access to enforce only positive sizes
379 void SetSize( const VECTOR2I& aSize, PCB_LAYER_ID aLayer );
380 const VECTOR2I& Size( PCB_LAYER_ID aLayer ) const;
381
383 void SetDrillShape( PAD_DRILL_SHAPE aShape );
384
385 VECTOR2I& Offset( PCB_LAYER_ID aLayer );
386 const VECTOR2I& Offset( PCB_LAYER_ID aLayer ) const;
387
388 PAD_SHAPE AnchorShape( PCB_LAYER_ID aLayer ) const;
389 void SetAnchorShape( PAD_SHAPE aShape, PCB_LAYER_ID aLayer );
390
392 const VECTOR2I& TrapezoidDeltaSize( PCB_LAYER_ID aLayer ) const;
393
394 double RoundRectRadiusRatio( PCB_LAYER_ID aLayer ) const;
395 void SetRoundRectRadiusRatio( double aRatio, PCB_LAYER_ID aLayer );
396
397 int RoundRectRadius( PCB_LAYER_ID aLayer ) const;
398 void SetRoundRectRadius( double aRadius, PCB_LAYER_ID aLayer );
399
400 double ChamferRatio( PCB_LAYER_ID aLayer ) const;
401 void SetChamferRatio( double aRatio, PCB_LAYER_ID aLayer );
402
403 int& ChamferPositions( PCB_LAYER_ID aLayer );
404 const int& ChamferPositions( PCB_LAYER_ID aLayer ) const;
405 void SetChamferPositions( int aPositions, PCB_LAYER_ID aLayer );
406
407 std::optional<int>& Clearance( PCB_LAYER_ID aLayer = F_Cu );
408 const std::optional<int>& Clearance( PCB_LAYER_ID aLayer = F_Cu ) const;
409
410 std::optional<int>& SolderMaskMargin( PCB_LAYER_ID aLayer = F_Cu );
411 const std::optional<int>& SolderMaskMargin( PCB_LAYER_ID aLayer = F_Cu ) const;
412
413 std::optional<int>& SolderPasteMargin( PCB_LAYER_ID aLayer = F_Cu );
414 const std::optional<int>& SolderPasteMargin( PCB_LAYER_ID aLayer = F_Cu ) const;
415
416 std::optional<double>& SolderPasteMarginRatio( PCB_LAYER_ID aLayer = F_Cu );
417 const std::optional<double>& SolderPasteMarginRatio( PCB_LAYER_ID aLayer = F_Cu ) const;
418
419 std::optional<ZONE_CONNECTION>& ZoneConnection( PCB_LAYER_ID aLayer = F_Cu );
420 const std::optional<ZONE_CONNECTION>& ZoneConnection( PCB_LAYER_ID aLayer = F_Cu ) const;
421
422 std::optional<int>& ThermalSpokeWidth( PCB_LAYER_ID aLayer = F_Cu );
423 const std::optional<int>& ThermalSpokeWidth( PCB_LAYER_ID aLayer = F_Cu ) const;
424
425 std::optional<int>& ThermalGap( PCB_LAYER_ID aLayer = F_Cu );
426 const std::optional<int>& ThermalGap( PCB_LAYER_ID aLayer = F_Cu ) const;
427
430 void SetThermalSpokeAngle( EDA_ANGLE aAngle, PCB_LAYER_ID aLayer = F_Cu );
431
432 std::vector<std::shared_ptr<PCB_SHAPE>>& Primitives( PCB_LAYER_ID aLayer );
433 const std::vector<std::shared_ptr<PCB_SHAPE>>& Primitives( PCB_LAYER_ID aLayer ) const;
434
440 void AddPrimitive( PCB_SHAPE* aShape, PCB_LAYER_ID aLayer );
441
447 void AppendPrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList,
448 PCB_LAYER_ID aLayer );
449
456 void ReplacePrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList,
457 PCB_LAYER_ID aLayer );
458
459 void ClearPrimitives( PCB_LAYER_ID aLayer );
460
461private:
462 void packCopperLayer( PCB_LAYER_ID aLayer, kiapi::board::types::PadStack& aProto ) const;
463
464 bool unpackCopperLayer( const kiapi::board::types::PadStackLayer& aProto );
465
468
471
474
476 wxString m_customName;
477
480
482 //COPPER_LAYER_PROPS m_defaultCopperProps;
483 std::unordered_map<PCB_LAYER_ID, COPPER_LAYER_PROPS> m_copperProps;
484
487
490
492
499
503
506};
507
508#ifndef SWIG
510#endif
511
512
513#endif //KICAD_PADSTACK_H
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
EDA_ANGLE Normalize()
Definition: eda_angle.h:229
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:37
A PADSTACK defines the characteristics of a single or multi-layer pad, in the IPC sense of the word.
Definition: padstack.h:125
std::optional< bool > IsFilled() const
Definition: padstack.cpp:1391
const DRILL_PROPS & Drill() const
Definition: padstack.h:309
bool operator==(const PADSTACK &aOther) const
Definition: padstack.cpp:116
CUSTOM_SHAPE_ZONE_MODE CustomShapeInZoneMode() const
Definition: padstack.h:342
void SetCustomShapeInZoneMode(CUSTOM_SHAPE_ZONE_MODE aM)
Definition: padstack.h:343
std::optional< int > & Clearance(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1196
void AddPrimitive(PCB_SHAPE *aShape, PCB_LAYER_ID aLayer)
Adds a custom shape primitive to the padstack.
Definition: padstack.cpp:1322
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 ...
Definition: padstack.cpp:1337
void packCopperLayer(PCB_LAYER_ID aLayer, kiapi::board::types::PadStack &aProto) const
Definition: padstack.cpp:373
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition: padstack.cpp:212
MASK_LAYER_PROPS & FrontOuterLayers()
Definition: padstack.h:320
double Similarity(const PADSTACK &aOther) const
Return a measure of how likely the other object is to represent the same object.
Definition: padstack.cpp:617
int RoundRectRadius(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1149
void SetDrillShape(PAD_DRILL_SHAPE aShape)
Definition: padstack.cpp:1095
std::optional< double > & SolderPasteMarginRatio(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1235
wxString m_customName
! An override for the IPC-7351 padstack name
Definition: padstack.h:476
DRILL_PROPS m_drill
! The primary drill parameters, which also define the start and end layers for through-hole vias and ...
Definition: padstack.h:502
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::...
Definition: padstack.cpp:882
void SetThermalSpokeAngle(EDA_ANGLE aAngle, PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1304
void SetRoundRectRadiusRatio(double aRatio, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1143
UNCONNECTED_LAYER_MODE m_unconnectedLayerMode
Definition: padstack.h:491
void ClearPrimitives(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1347
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
Definition: padstack.h:315
std::optional< bool > IsTented(PCB_LAYER_ID aSide) const
Checks if this padstack is tented (covered in soldermask) on the given side.
Definition: padstack.cpp:1353
void SetMode(MODE aMode)
Definition: padstack.cpp:833
std::optional< int > & ThermalSpokeWidth(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1261
std::optional< int > & SolderPasteMargin(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1222
void SetOrientation(EDA_ANGLE aAngle)
Definition: padstack.h:302
const MASK_LAYER_PROPS & BackOuterLayers() const
Definition: padstack.h:324
std::optional< int > & SolderMaskMargin(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1208
void SetChamferRatio(double aRatio, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1172
const LSET & LayerSet() const
Definition: padstack.h:282
PCB_LAYER_ID EffectiveLayerFor(PCB_LAYER_ID aLayer) const
Determines which geometry layer should be used for the given input layer.
Definition: padstack.cpp:934
PADSTACK & operator=(const PADSTACK &aOther)
Definition: padstack.cpp:72
void SetShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1068
LSET & LayerSet()
Definition: padstack.h:283
EDA_ANGLE DefaultThermalSpokeAngleForShape(PCB_LAYER_ID aLayer=F_Cu) const
Definition: padstack.cpp:1285
VECTOR2I & TrapezoidDeltaSize(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1125
DRILL_PROPS m_secondaryDrill
! Secondary drill, used to define back-drilling
Definition: padstack.h:505
VECTOR2I & Offset(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1101
MASK_LAYER_PROPS m_backMaskProps
! The overrides applied to back outer technical layers
Definition: padstack.h:489
COPPER_LAYER_PROPS & CopperLayer(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1040
EDA_ANGLE ThermalSpokeAngle(PCB_LAYER_ID aLayer=F_Cu) const
Definition: padstack.cpp:1296
void FlipLayers(int aCopperLayerCount)
Flips the padstack layers in the case that the pad's parent footprint is flipped to the other side of...
Definition: padstack.cpp:720
CUSTOM_SHAPE_ZONE_MODE m_customShapeInZoneMode
How to build the custom shape in zone, to create the clearance area: CUSTOM_SHAPE_ZONE_MODE::OUTLINE ...
Definition: padstack.h:498
bool unpackCopperLayer(const kiapi::board::types::PadStackLayer &aProto)
Definition: padstack.cpp:161
PAD_DRILL_SHAPE DrillShape() const
Definition: padstack.cpp:1089
void SetChamferPositions(int aPositions, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1190
void SetRoundRectRadius(double aRadius, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1156
std::optional< bool > IsPlugged(PCB_LAYER_ID aSide) const
Definition: padstack.cpp:1375
const MASK_LAYER_PROPS & FrontOuterLayers() const
Definition: padstack.h:321
UNCONNECTED_LAYER_MODE UnconnectedLayerMode() const
Definition: padstack.h:314
LSET RelevantShapeLayers(const PADSTACK &aOther) const
Returns the set of layers that must be considered if checking one padstack against another.
Definition: padstack.cpp:1020
std::optional< int > & ThermalGap(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1273
PAD_SHAPE Shape(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1062
DRILL_PROPS & Drill()
Definition: padstack.h:308
void SetAnchorShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1119
BOARD_ITEM * m_parent
! The BOARD_ITEM this PADSTACK belongs to; will be used as the parent for owned shapes
Definition: padstack.h:467
std::optional< bool > IsCapped() const
Definition: padstack.cpp:1386
std::vector< PCB_LAYER_ID > UniqueLayers() const
Definition: padstack.cpp:909
LSET m_layerSet
! The board layers that this padstack is active on
Definition: padstack.h:473
std::unordered_map< PCB_LAYER_ID, COPPER_LAYER_PROPS > m_copperProps
! The properties applied to copper layers if they aren't overridden
Definition: padstack.h:483
CUSTOM_SHAPE_ZONE_MODE
Definition: padstack.h:160
static int Compare(const PADSTACK *aPadstackRef, const PADSTACK *aPadstackCmp)
Compare two padstacks and return 0 if they are equal.
Definition: padstack.cpp:536
PCB_LAYER_ID EndLayer() const
Definition: padstack.cpp:714
const DRILL_PROPS & SecondaryDrill() const
Definition: padstack.h:312
std::optional< bool > IsCovered(PCB_LAYER_ID aSide) const
Definition: padstack.cpp:1364
int & ChamferPositions(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1178
MASK_LAYER_PROPS m_frontMaskProps
! The overrides applied to front outer technical layers
Definition: padstack.h:486
const VECTOR2I & Size(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1083
virtual ~PADSTACK()=default
MODE
! Copper geometry mode: controls how many unique copper layer shapes this padstack has
Definition: padstack.h:138
@ 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.
Definition: padstack.cpp:1329
DRILL_PROPS & SecondaryDrill()
Definition: padstack.h:311
double RoundRectRadiusRatio(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1137
UNCONNECTED_LAYER_MODE
! Whether or not to remove the copper shape for unconnected layers
Definition: padstack.h:152
PCB_LAYER_ID StartLayer() const
Definition: padstack.cpp:708
MODE Mode() const
Definition: padstack.h:295
bool operator!=(const PADSTACK &aOther) const
Definition: padstack.h:263
PAD_SHAPE AnchorShape(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1113
MASK_LAYER_PROPS & BackOuterLayers()
Definition: padstack.h:323
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition: padstack.cpp:414
wxString Name() const
! Returns the name of this padstack in IPC-7351 format
Definition: padstack.cpp:701
void SetSize(const VECTOR2I &aSize, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1074
double ChamferRatio(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1166
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
Definition: padstack.h:145
EDA_ANGLE GetOrientation() const
Definition: padstack.h:301
static constexpr PCB_LAYER_ID INNER_LAYERS
! The layer identifier to use for "inner layers" on top/inner/bottom padstacks
Definition: padstack.h:148
void SetLayerSet(const LSET &aSet)
Definition: padstack.h:284
std::optional< ZONE_CONNECTION > & ZoneConnection(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1249
TYPE
! Padstack type, mostly for IPC-7351 naming and attributes Note that TYPE::MOUNTING is probably not c...
Definition: padstack.h:130
@ NORMAL
Padstack for a footprint pad.
@ MOUNTING
A mounting hole (plated or unplated, not associated with a footprint)
@ VIA
Padstack for a via.
MODE m_mode
! The copper layer variation mode this padstack is in
Definition: padstack.h:470
EDA_ANGLE m_orientation
! The rotation of the pad relative to an outer reference frame
Definition: padstack.h:479
std::vector< std::shared_ptr< PCB_SHAPE > > & Primitives(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1310
Interface for objects that can be serialized to Protobuf messages.
Definition: serializable.h:37
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ In1_Cu
Definition: layer_ids.h:66
@ F_Cu
Definition: layer_ids.h:64
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
Definition: padstack.h:69
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
Definition: padstack.h:81
@ 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()
Definition: padstack.h:52
PAD_PROP
The set of pad properties used in Gerber files (Draw files, and P&P files) to define some properties ...
Definition: padstack.h:98
@ 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
@ PRESSFIT
a PTH with a hole diameter with tight tolerances for press fit pin
@ 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)
Definition: property.h:763
The features of a padstack that can vary between copper layers All parameters are optional; leaving t...
Definition: padstack.h:209
std::optional< ZONE_CONNECTION > zone_connection
Definition: padstack.h:211
std::optional< int > thermal_spoke_width
Definition: padstack.h:212
std::vector< std::shared_ptr< PCB_SHAPE > > custom_shapes
Definition: padstack.h:221
bool operator==(const COPPER_LAYER_PROPS &aOther) const
Definition: padstack.cpp:781
std::optional< EDA_ANGLE > thermal_spoke_angle
Definition: padstack.h:213
std::optional< int > clearance
Definition: padstack.h:215
std::optional< int > thermal_gap
Definition: padstack.h:214
! The properties of a padstack drill. Drill position is always the pad position (origin).
Definition: padstack.h:244
PCB_LAYER_ID start
Definition: padstack.h:247
PCB_LAYER_ID end
Definition: padstack.h:248
bool operator==(const DRILL_PROPS &aOther) const
Definition: padstack.cpp:826
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
Definition: padstack.h:245
std::optional< bool > is_capped
True if the drill hole should be capped.
Definition: padstack.h:251
std::optional< bool > is_filled
True if the drill hole should be filled completely.
Definition: padstack.h:250
PAD_DRILL_SHAPE shape
Definition: padstack.h:246
! The features of a padstack that can vary on outer layers.
Definition: padstack.h:229
bool operator==(const MASK_LAYER_PROPS &aOther) const
Definition: padstack.cpp:816
std::optional< int > solder_mask_margin
Definition: padstack.h:230
std::optional< bool > has_covering
True if the pad on this side should have covering.
Definition: padstack.h:236
std::optional< int > solder_paste_margin
Definition: padstack.h:231
std::optional< double > solder_paste_margin_ratio
Definition: padstack.h:232
std::optional< bool > has_solder_mask
True if this outer layer has mask (is not tented)
Definition: padstack.h:234
std::optional< bool > has_solder_paste
True if this outer layer has solder paste.
Definition: padstack.h:235
std::optional< bool > has_plugging
True if the drill hole should be plugged on this side.
Definition: padstack.h:237
! The set of properties that define a pad's shape on a given layer
Definition: padstack.h:167
VECTOR2I trapezoid_delta_size
Delta for PAD_SHAPE::TRAPEZOID; half the delta squeezes one end and half expands the other.
Definition: padstack.h:190
double round_rect_corner_radius
Definition: padstack.h:181
VECTOR2I offset
Offset of the shape center from the pad center.
Definition: padstack.h:179
bool operator==(const SHAPE_PROPS &aOther) const
Definition: padstack.cpp:771
VECTOR2I size
Size of the shape, or of the anchor pad for custom shape pads.
Definition: padstack.h:170
double chamfered_rect_ratio
Size of chamfer: ratio of smallest of X,Y size.
Definition: padstack.h:183
double round_rect_radius_ratio
Definition: padstack.h:182
PAD_SHAPE shape
Shape of the pad.
Definition: padstack.h:168
PAD_SHAPE anchor_shape
Shape of the anchor when shape == PAD_SHAPE::CUSTOM.
Definition: padstack.h:169