KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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 <jon@craftyjon.com>
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
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};
108
109
123class PADSTACK : public SERIALIZABLE
124{
125public:
128 enum class TYPE
129 {
130 NORMAL,
131 VIA,
132 MOUNTING
133 };
134
136 enum class MODE
137 {
138 NORMAL,
140 CUSTOM
141 };
142
144 static constexpr PCB_LAYER_ID ALL_LAYERS = F_Cu;
145
147 static constexpr PCB_LAYER_ID INNER_LAYERS = In1_Cu;
148
151 {
152 KEEP_ALL,
155 };
156
158 {
159 OUTLINE,
161 };
162
165 {
169
170 /*
171 * Most of the time the hole is the center of the shape (m_Offset = 0). But some designers
172 * use oblong/rect pads with a hole moved to one of the oblong/rect pad shape ends.
173 * In all cases the hole is at the pad position. This offset is from the hole to the center
174 * of the pad shape (ie: the copper area around the hole).
175 * ShapePos() returns the board shape position according to the offset and the pad rotation.
176 */
178
183
189
190 SHAPE_PROPS();
191 bool operator==( const SHAPE_PROPS& aOther ) const;
192 };
193
207 {
209 std::optional<ZONE_CONNECTION> zone_connection;
210 std::optional<int> thermal_spoke_width;
211 std::optional<EDA_ANGLE> thermal_spoke_angle;
212 std::optional<int> thermal_gap;
213 std::optional<int> clearance;
214
215 /*
216 * Editing definitions of primitives for custom pad shapes. In local coordinates relative
217 * to m_Pos (NOT shapePos) at orient 0.
218 */
219 std::vector<std::shared_ptr<PCB_SHAPE>> custom_shapes;
220
221 bool operator==( const COPPER_LAYER_PROPS& aOther ) const;
222 };
223
227 {
228 std::optional<int> solder_mask_margin;
229 std::optional<int> solder_paste_margin;
230 std::optional<double> solder_paste_margin_ratio;
231
232 std::optional<bool> has_solder_mask;
233 std::optional<bool> has_solder_paste;
234 std::optional<bool> has_covering;
235 std::optional<bool> has_plugging;
236
237 bool operator==( const MASK_LAYER_PROPS& aOther ) const;
238 };
239
242 {
247
248 std::optional<bool> is_filled;
249 std::optional<bool> is_capped;
250
251 bool operator==( const DRILL_PROPS& aOther ) const;
252 };
253
254public:
255 PADSTACK( BOARD_ITEM* aParent );
256 virtual ~PADSTACK() = default;
257 PADSTACK( const PADSTACK& aOther );
258 PADSTACK& operator=( const PADSTACK &aOther );
259
260 bool operator==( const PADSTACK& aOther ) const;
261 bool operator!=( const PADSTACK& aOther ) const { return !operator==( aOther ); }
262
263 void Serialize( google::protobuf::Any &aContainer ) const override;
264 bool Deserialize( const google::protobuf::Any &aContainer ) override;
265
272 static int Compare( const PADSTACK* aPadstackRef, const PADSTACK* aPadstackCmp );
273
278 double Similarity( const PADSTACK& aOther ) const;
279
280 const LSET& LayerSet() const { return m_layerSet; }
281 LSET& LayerSet() { return m_layerSet; }
282 void SetLayerSet( const LSET& aSet ) { m_layerSet = aSet; }
283
288 void FlipLayers( int aCopperLayerCount );
289
290 PCB_LAYER_ID StartLayer() const;
291 PCB_LAYER_ID EndLayer() const;
292
293 MODE Mode() const { return m_mode; }
294 void SetMode( MODE aMode );
295
297 wxString Name() const;
298
301 {
302 m_orientation = aAngle;
304 }
305
306 DRILL_PROPS& Drill() { return m_drill; }
307 const DRILL_PROPS& Drill() const { return m_drill; }
308
310 const DRILL_PROPS& SecondaryDrill() const { return m_secondaryDrill; }
311
314
315 COPPER_LAYER_PROPS& CopperLayer( PCB_LAYER_ID aLayer );
316 const COPPER_LAYER_PROPS& CopperLayer( PCB_LAYER_ID aLayer ) const;
317
320
323
330 std::optional<bool> IsTented( PCB_LAYER_ID aSide ) const;
331
332 std::optional<bool> IsCovered( PCB_LAYER_ID aSide ) const;
333
334 std::optional<bool> IsPlugged( PCB_LAYER_ID aSide ) const;
335
336 std::optional<bool> IsCapped() const;
337
338 std::optional<bool> IsFilled() const;
339
342
349 void ForEachUniqueLayer( const std::function<void( PCB_LAYER_ID )>& aMethod ) const;
350
351 std::vector<PCB_LAYER_ID> UniqueLayers() const;
352
363
369 LSET RelevantShapeLayers( const PADSTACK& aOther ) const;
370
371 // The following section has convenience getters for the padstack properties on a given layer.
372
373 PAD_SHAPE Shape( PCB_LAYER_ID aLayer ) const;
374 void SetShape( PAD_SHAPE aShape, PCB_LAYER_ID aLayer );
375
376 // Setter rather than direct access to enforce only positive sizes
377 void SetSize( const VECTOR2I& aSize, PCB_LAYER_ID aLayer );
378 const VECTOR2I& Size( PCB_LAYER_ID aLayer ) const;
379
381 void SetDrillShape( PAD_DRILL_SHAPE aShape );
382
383 VECTOR2I& Offset( PCB_LAYER_ID aLayer );
384 const VECTOR2I& Offset( PCB_LAYER_ID aLayer ) const;
385
386 PAD_SHAPE AnchorShape( PCB_LAYER_ID aLayer ) const;
387 void SetAnchorShape( PAD_SHAPE aShape, PCB_LAYER_ID aLayer );
388
390 const VECTOR2I& TrapezoidDeltaSize( PCB_LAYER_ID aLayer ) const;
391
392 double RoundRectRadiusRatio( PCB_LAYER_ID aLayer ) const;
393 void SetRoundRectRadiusRatio( double aRatio, PCB_LAYER_ID aLayer );
394
395 int RoundRectRadius( PCB_LAYER_ID aLayer ) const;
396 void SetRoundRectRadius( double aRadius, PCB_LAYER_ID aLayer );
397
398 double ChamferRatio( PCB_LAYER_ID aLayer ) const;
399 void SetChamferRatio( double aRatio, PCB_LAYER_ID aLayer );
400
401 int& ChamferPositions( PCB_LAYER_ID aLayer );
402 const int& ChamferPositions( PCB_LAYER_ID aLayer ) const;
403 void SetChamferPositions( int aPositions, PCB_LAYER_ID aLayer );
404
405 std::optional<int>& Clearance( PCB_LAYER_ID aLayer = F_Cu );
406 const std::optional<int>& Clearance( PCB_LAYER_ID aLayer = F_Cu ) const;
407
408 std::optional<int>& SolderMaskMargin( PCB_LAYER_ID aLayer = F_Cu );
409 const std::optional<int>& SolderMaskMargin( PCB_LAYER_ID aLayer = F_Cu ) const;
410
411 std::optional<int>& SolderPasteMargin( PCB_LAYER_ID aLayer = F_Cu );
412 const std::optional<int>& SolderPasteMargin( PCB_LAYER_ID aLayer = F_Cu ) const;
413
414 std::optional<double>& SolderPasteMarginRatio( PCB_LAYER_ID aLayer = F_Cu );
415 const std::optional<double>& SolderPasteMarginRatio( PCB_LAYER_ID aLayer = F_Cu ) const;
416
417 std::optional<ZONE_CONNECTION>& ZoneConnection( PCB_LAYER_ID aLayer = F_Cu );
418 const std::optional<ZONE_CONNECTION>& ZoneConnection( PCB_LAYER_ID aLayer = F_Cu ) const;
419
420 std::optional<int>& ThermalSpokeWidth( PCB_LAYER_ID aLayer = F_Cu );
421 const std::optional<int>& ThermalSpokeWidth( PCB_LAYER_ID aLayer = F_Cu ) const;
422
423 std::optional<int>& ThermalGap( PCB_LAYER_ID aLayer = F_Cu );
424 const std::optional<int>& ThermalGap( PCB_LAYER_ID aLayer = F_Cu ) const;
425
428 void SetThermalSpokeAngle( EDA_ANGLE aAngle, PCB_LAYER_ID aLayer = F_Cu );
429
430 std::vector<std::shared_ptr<PCB_SHAPE>>& Primitives( PCB_LAYER_ID aLayer );
431 const std::vector<std::shared_ptr<PCB_SHAPE>>& Primitives( PCB_LAYER_ID aLayer ) const;
432
438 void AddPrimitive( PCB_SHAPE* aShape, PCB_LAYER_ID aLayer );
439
445 void AppendPrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList,
446 PCB_LAYER_ID aLayer );
447
454 void ReplacePrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList,
455 PCB_LAYER_ID aLayer );
456
457 void ClearPrimitives( PCB_LAYER_ID aLayer );
458
459private:
460 void packCopperLayer( PCB_LAYER_ID aLayer, kiapi::board::types::PadStack& aProto ) const;
461
462 bool unpackCopperLayer( const kiapi::board::types::PadStackLayer& aProto );
463
466
469
472
474 wxString m_customName;
475
478
480 //COPPER_LAYER_PROPS m_defaultCopperProps;
481 std::unordered_map<PCB_LAYER_ID, COPPER_LAYER_PROPS> m_copperProps;
482
485
488
490
497
501
504};
505
506#ifndef SWIG
508#endif
509
510
511#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:78
EDA_ANGLE Normalize()
Definition: eda_angle.h:221
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:124
std::optional< bool > IsFilled() const
Definition: padstack.cpp:1376
const DRILL_PROPS & Drill() const
Definition: padstack.h:307
bool operator==(const PADSTACK &aOther) const
Definition: padstack.cpp:115
CUSTOM_SHAPE_ZONE_MODE CustomShapeInZoneMode() const
Definition: padstack.h:340
void SetCustomShapeInZoneMode(CUSTOM_SHAPE_ZONE_MODE aM)
Definition: padstack.h:341
std::optional< int > & Clearance(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1181
void AddPrimitive(PCB_SHAPE *aShape, PCB_LAYER_ID aLayer)
Adds a custom shape primitive to the padstack.
Definition: padstack.cpp:1307
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:1322
void packCopperLayer(PCB_LAYER_ID aLayer, kiapi::board::types::PadStack &aProto) const
Definition: padstack.cpp:372
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition: padstack.cpp:211
MASK_LAYER_PROPS & FrontOuterLayers()
Definition: padstack.h:318
double Similarity(const PADSTACK &aOther) const
Return a measure of how likely the other object is to represent the same object.
Definition: padstack.cpp:614
int RoundRectRadius(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1134
void SetDrillShape(PAD_DRILL_SHAPE aShape)
Definition: padstack.cpp:1080
std::optional< double > & SolderPasteMarginRatio(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1220
wxString m_customName
! An override for the IPC-7351 padstack name
Definition: padstack.h:474
DRILL_PROPS m_drill
! The primary drill parameters, which also define the start and end layers for through-hole vias and ...
Definition: padstack.h:500
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:879
void SetThermalSpokeAngle(EDA_ANGLE aAngle, PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1289
void SetRoundRectRadiusRatio(double aRatio, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1128
UNCONNECTED_LAYER_MODE m_unconnectedLayerMode
Definition: padstack.h:489
void ClearPrimitives(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1332
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
Definition: padstack.h:313
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:1338
void SetMode(MODE aMode)
Definition: padstack.cpp:830
std::optional< int > & ThermalSpokeWidth(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1246
std::optional< int > & SolderPasteMargin(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1207
void SetOrientation(EDA_ANGLE aAngle)
Definition: padstack.h:300
const MASK_LAYER_PROPS & BackOuterLayers() const
Definition: padstack.h:322
std::optional< int > & SolderMaskMargin(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1193
void SetChamferRatio(double aRatio, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1157
const LSET & LayerSet() const
Definition: padstack.h:280
PCB_LAYER_ID EffectiveLayerFor(PCB_LAYER_ID aLayer) const
Determines which geometry layer should be used for the given input layer.
Definition: padstack.cpp:931
PADSTACK & operator=(const PADSTACK &aOther)
Definition: padstack.cpp:71
void SetShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1053
LSET & LayerSet()
Definition: padstack.h:281
EDA_ANGLE DefaultThermalSpokeAngleForShape(PCB_LAYER_ID aLayer=F_Cu) const
Definition: padstack.cpp:1270
VECTOR2I & TrapezoidDeltaSize(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1110
DRILL_PROPS m_secondaryDrill
! Secondary drill, used to define back-drilling
Definition: padstack.h:503
VECTOR2I & Offset(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1086
MASK_LAYER_PROPS m_backMaskProps
! The overrides applied to back outer technical layers
Definition: padstack.h:487
COPPER_LAYER_PROPS & CopperLayer(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1027
EDA_ANGLE ThermalSpokeAngle(PCB_LAYER_ID aLayer=F_Cu) const
Definition: padstack.cpp:1281
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:717
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:496
bool unpackCopperLayer(const kiapi::board::types::PadStackLayer &aProto)
Definition: padstack.cpp:160
PAD_DRILL_SHAPE DrillShape() const
Definition: padstack.cpp:1074
void SetChamferPositions(int aPositions, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1175
void SetRoundRectRadius(double aRadius, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1141
std::optional< bool > IsPlugged(PCB_LAYER_ID aSide) const
Definition: padstack.cpp:1360
const MASK_LAYER_PROPS & FrontOuterLayers() const
Definition: padstack.h:319
UNCONNECTED_LAYER_MODE UnconnectedLayerMode() const
Definition: padstack.h:312
LSET RelevantShapeLayers(const PADSTACK &aOther) const
Returns the set of layers that must be considered if checking one padstack against another.
Definition: padstack.cpp:1007
std::optional< int > & ThermalGap(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1258
PAD_SHAPE Shape(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1047
DRILL_PROPS & Drill()
Definition: padstack.h:306
void SetAnchorShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1104
BOARD_ITEM * m_parent
! The BOARD_ITEM this PADSTACK belongs to; will be used as the parent for owned shapes
Definition: padstack.h:465
std::optional< bool > IsCapped() const
Definition: padstack.cpp:1371
std::vector< PCB_LAYER_ID > UniqueLayers() const
Definition: padstack.cpp:906
LSET m_layerSet
! The board layers that this padstack is active on
Definition: padstack.h:471
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:481
CUSTOM_SHAPE_ZONE_MODE
Definition: padstack.h:158
static int Compare(const PADSTACK *aPadstackRef, const PADSTACK *aPadstackCmp)
Compare two padstacks and return 0 if they are equal.
Definition: padstack.cpp:535
PCB_LAYER_ID EndLayer() const
Definition: padstack.cpp:711
const DRILL_PROPS & SecondaryDrill() const
Definition: padstack.h:310
std::optional< bool > IsCovered(PCB_LAYER_ID aSide) const
Definition: padstack.cpp:1349
int & ChamferPositions(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1163
MASK_LAYER_PROPS m_frontMaskProps
! The overrides applied to front outer technical layers
Definition: padstack.h:484
const VECTOR2I & Size(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1068
virtual ~PADSTACK()=default
MODE
! Copper geometry mode: controls how many unique copper layer shapes this padstack has
Definition: padstack.h:137
@ 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:1314
DRILL_PROPS & SecondaryDrill()
Definition: padstack.h:309
double RoundRectRadiusRatio(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1122
UNCONNECTED_LAYER_MODE
! Whether or not to remove the copper shape for unconnected layers
Definition: padstack.h:151
PCB_LAYER_ID StartLayer() const
Definition: padstack.cpp:705
MODE Mode() const
Definition: padstack.h:293
bool operator!=(const PADSTACK &aOther) const
Definition: padstack.h:261
PAD_SHAPE AnchorShape(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1098
MASK_LAYER_PROPS & BackOuterLayers()
Definition: padstack.h:321
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition: padstack.cpp:413
wxString Name() const
! Returns the name of this padstack in IPC-7351 format
Definition: padstack.cpp:698
void SetSize(const VECTOR2I &aSize, PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1059
double ChamferRatio(PCB_LAYER_ID aLayer) const
Definition: padstack.cpp:1151
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
Definition: padstack.h:144
EDA_ANGLE GetOrientation() const
Definition: padstack.h:299
static constexpr PCB_LAYER_ID INNER_LAYERS
! The layer identifier to use for "inner layers" on top/inner/bottom padstacks
Definition: padstack.h:147
void SetLayerSet(const LSET &aSet)
Definition: padstack.h:282
std::optional< ZONE_CONNECTION > & ZoneConnection(PCB_LAYER_ID aLayer=F_Cu)
Definition: padstack.cpp:1234
TYPE
! Padstack type, mostly for IPC-7351 naming and attributes Note that TYPE::MOUNTING is probably not c...
Definition: padstack.h:129
@ 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:468
EDA_ANGLE m_orientation
! The rotation of the pad relative to an outer reference frame
Definition: padstack.h:477
std::vector< std::shared_ptr< PCB_SHAPE > > & Primitives(PCB_LAYER_ID aLayer)
Definition: padstack.cpp:1295
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
@ 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:746
The features of a padstack that can vary between copper layers All parameters are optional; leaving t...
Definition: padstack.h:207
std::optional< ZONE_CONNECTION > zone_connection
Definition: padstack.h:209
std::optional< int > thermal_spoke_width
Definition: padstack.h:210
std::vector< std::shared_ptr< PCB_SHAPE > > custom_shapes
Definition: padstack.h:219
bool operator==(const COPPER_LAYER_PROPS &aOther) const
Definition: padstack.cpp:778
std::optional< EDA_ANGLE > thermal_spoke_angle
Definition: padstack.h:211
std::optional< int > clearance
Definition: padstack.h:213
std::optional< int > thermal_gap
Definition: padstack.h:212
! The properties of a padstack drill. Drill position is always the pad position (origin).
Definition: padstack.h:242
PCB_LAYER_ID start
Definition: padstack.h:245
PCB_LAYER_ID end
Definition: padstack.h:246
bool operator==(const DRILL_PROPS &aOther) const
Definition: padstack.cpp:823
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
Definition: padstack.h:243
std::optional< bool > is_capped
True if the drill hole should be capped.
Definition: padstack.h:249
std::optional< bool > is_filled
True if the drill hole should be filled completely.
Definition: padstack.h:248
PAD_DRILL_SHAPE shape
Definition: padstack.h:244
! The features of a padstack that can vary on outer layers.
Definition: padstack.h:227
bool operator==(const MASK_LAYER_PROPS &aOther) const
Definition: padstack.cpp:813
std::optional< int > solder_mask_margin
Definition: padstack.h:228
std::optional< bool > has_covering
True if the pad on this side should have covering.
Definition: padstack.h:234
std::optional< int > solder_paste_margin
Definition: padstack.h:229
std::optional< double > solder_paste_margin_ratio
Definition: padstack.h:230
std::optional< bool > has_solder_mask
True if this outer layer has mask (is not tented)
Definition: padstack.h:232
std::optional< bool > has_solder_paste
True if this outer layer has solder paste.
Definition: padstack.h:233
std::optional< bool > has_plugging
True if the drill hole should be plugged on this side.
Definition: padstack.h:235
! The set of properties that define a pad's shape on a given layer
Definition: padstack.h:165
VECTOR2I trapezoid_delta_size
Delta for PAD_SHAPE::TRAPEZOID; half the delta squeezes one end and half expands the other.
Definition: padstack.h:188
double round_rect_corner_radius
Definition: padstack.h:179
VECTOR2I offset
Offset of the shape center from the pad center.
Definition: padstack.h:177
bool operator==(const SHAPE_PROPS &aOther) const
Definition: padstack.cpp:768
VECTOR2I size
Size of the shape, or of the anchor pad for custom shape pads.
Definition: padstack.h:168
double chamfered_rect_ratio
Size of chamfer: ratio of smallest of X,Y size.
Definition: padstack.h:181
double round_rect_radius_ratio
Definition: padstack.h:180
PAD_SHAPE shape
Shape of the pad.
Definition: padstack.h:166
PAD_SHAPE anchor_shape
Shape of the anchor when shape == PAD_SHAPE::CUSTOM.
Definition: padstack.h:167