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{
54 RECTANGLE, // do not use just RECT: it collides in a header on MSYS2
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
74
82
90
96enum class PAD_ATTRIB
97{
105};
106
107
125
126
134
135
141
142
156class PADSTACK : public SERIALIZABLE
157{
158public:
161 enum class TYPE
162 {
166 };
167
175
177 static constexpr PCB_LAYER_ID ALL_LAYERS = F_Cu;
178
180 static constexpr PCB_LAYER_ID INNER_LAYERS = In1_Cu;
181
185 {
189
190 /*
191 * Most of the time the hole is the center of the shape (m_Offset = 0). But some designers
192 * use oblong/rect pads with a hole moved to one of the oblong/rect pad shape ends.
193 * In all cases the hole is at the pad position. This offset is from the hole to the center
194 * of the pad shape (ie: the copper area around the hole).
195 * ShapePos() returns the board shape position according to the offset and the pad rotation.
196 */
198
202
208
209 SHAPE_PROPS();
210 bool operator==( const SHAPE_PROPS& aOther ) const;
211 };
212
226 {
228 std::optional<ZONE_CONNECTION> zone_connection;
229 std::optional<int> thermal_spoke_width;
230 std::optional<EDA_ANGLE> thermal_spoke_angle;
231 std::optional<int> thermal_gap;
232 std::optional<int> clearance;
233
234 /*
235 * Editing definitions of primitives for custom pad shapes. In local coordinates relative
236 * to m_Pos (NOT shapePos) at orient 0.
237 */
238 std::vector<std::shared_ptr<PCB_SHAPE>> custom_shapes;
239
240 bool operator==( const COPPER_LAYER_PROPS& aOther ) const;
241 };
242
246 {
247 std::optional<int> solder_mask_margin;
248 std::optional<int> solder_paste_margin;
249 std::optional<double> solder_paste_margin_ratio;
250
251 std::optional<bool> has_solder_mask;
252 std::optional<bool> has_solder_paste;
253 std::optional<bool> has_covering;
254 std::optional<bool> has_plugging;
255
256 bool operator==( const MASK_LAYER_PROPS& aOther ) const;
257 };
258
261 {
266
267 std::optional<bool> is_filled;
268 std::optional<bool> is_capped;
269
270 bool operator==( const DRILL_PROPS& aOther ) const;
271 };
272
274 {
275 std::optional<PAD_DRILL_POST_MACHINING_MODE> mode;
276 int size = 0;
277 int depth = 0;
278 int angle = 0;
279
280 bool operator==( const POST_MACHINING_PROPS& aOther ) const;
281 };
282
283public:
284 PADSTACK( BOARD_ITEM* aParent );
285 virtual ~PADSTACK() = default;
286 PADSTACK( const PADSTACK& aOther );
287 PADSTACK& operator=( const PADSTACK &aOther );
288
289 bool operator==( const PADSTACK& aOther ) const;
290 bool operator!=( const PADSTACK& aOther ) const { return !operator==( aOther ); }
291
292 void Serialize( google::protobuf::Any &aContainer ) const override;
293 bool Deserialize( const google::protobuf::Any &aContainer ) override;
294
301 static int Compare( const PADSTACK* aPadstackRef, const PADSTACK* aPadstackCmp );
302
307 double Similarity( const PADSTACK& aOther ) const;
308
309 const LSET& LayerSet() const { return m_layerSet; }
310 LSET& LayerSet() { return m_layerSet; }
311 void SetLayerSet( const LSET& aSet ) { m_layerSet = aSet; }
312
317 void FlipLayers( int aCopperLayerCount );
318
319 PCB_LAYER_ID StartLayer() const;
320 PCB_LAYER_ID EndLayer() const;
321
322 MODE Mode() const { return m_mode; }
323 void SetMode( MODE aMode );
324
326 wxString Name() const;
327
330 {
331 m_orientation = aAngle;
332 m_orientation.Normalize();
333 }
334
335 DRILL_PROPS& Drill() { return m_drill; }
336 const DRILL_PROPS& Drill() const { return m_drill; }
337
339 const DRILL_PROPS& SecondaryDrill() const { return m_secondaryDrill; }
340
342 const DRILL_PROPS& TertiaryDrill() const { return m_tertiaryDrill; }
343
346
349
352
353 COPPER_LAYER_PROPS& CopperLayer( PCB_LAYER_ID aLayer );
354 const COPPER_LAYER_PROPS& CopperLayer( PCB_LAYER_ID aLayer ) const;
355
358
361
368 std::optional<bool> IsTented( PCB_LAYER_ID aSide ) const;
369
370 std::optional<bool> IsCovered( PCB_LAYER_ID aSide ) const;
371
372 std::optional<bool> IsPlugged( PCB_LAYER_ID aSide ) const;
373
374 std::optional<bool> IsCapped() const;
375
376 std::optional<bool> IsFilled() const;
377
380
387 void ForEachUniqueLayer( const std::function<void( PCB_LAYER_ID )>& aMethod ) const;
388
389 std::vector<PCB_LAYER_ID> UniqueLayers() const;
390
401
407 LSET RelevantShapeLayers( const PADSTACK& aOther ) const;
408
409 // The following section has convenience getters for the padstack properties on a given layer.
410
411 PAD_SHAPE Shape( PCB_LAYER_ID aLayer ) const;
412 void SetShape( PAD_SHAPE aShape, PCB_LAYER_ID aLayer );
413
414 // Setter rather than direct access to enforce only positive sizes
415 void SetSize( const VECTOR2I& aSize, PCB_LAYER_ID aLayer );
416 const VECTOR2I& Size( PCB_LAYER_ID aLayer ) const;
417
419 void SetDrillShape( PAD_DRILL_SHAPE aShape );
420
421 VECTOR2I& Offset( PCB_LAYER_ID aLayer );
422 const VECTOR2I& Offset( PCB_LAYER_ID aLayer ) const;
423
424 PAD_SHAPE AnchorShape( PCB_LAYER_ID aLayer ) const;
425 void SetAnchorShape( PAD_SHAPE aShape, PCB_LAYER_ID aLayer );
426
428 const VECTOR2I& TrapezoidDeltaSize( PCB_LAYER_ID aLayer ) const;
429
430 double RoundRectRadiusRatio( PCB_LAYER_ID aLayer ) const;
431 void SetRoundRectRadiusRatio( double aRatio, PCB_LAYER_ID aLayer );
432
433 int RoundRectRadius( PCB_LAYER_ID aLayer ) const;
434 void SetRoundRectRadius( double aRadius, PCB_LAYER_ID aLayer );
435
436 double ChamferRatio( PCB_LAYER_ID aLayer ) const;
437 void SetChamferRatio( double aRatio, PCB_LAYER_ID aLayer );
438
439 int& ChamferPositions( PCB_LAYER_ID aLayer );
440 const int& ChamferPositions( PCB_LAYER_ID aLayer ) const;
441 void SetChamferPositions( int aPositions, PCB_LAYER_ID aLayer );
442
443 std::optional<int>& Clearance( PCB_LAYER_ID aLayer = F_Cu );
444 const std::optional<int>& Clearance( PCB_LAYER_ID aLayer = F_Cu ) const;
445
446 std::optional<int>& SolderMaskMargin( PCB_LAYER_ID aLayer = F_Cu );
447 const std::optional<int>& SolderMaskMargin( PCB_LAYER_ID aLayer = F_Cu ) const;
448
449 std::optional<int>& SolderPasteMargin( PCB_LAYER_ID aLayer = F_Cu );
450 const std::optional<int>& SolderPasteMargin( PCB_LAYER_ID aLayer = F_Cu ) const;
451
452 std::optional<double>& SolderPasteMarginRatio( PCB_LAYER_ID aLayer = F_Cu );
453 const std::optional<double>& SolderPasteMarginRatio( PCB_LAYER_ID aLayer = F_Cu ) const;
454
455 std::optional<ZONE_CONNECTION>& ZoneConnection( PCB_LAYER_ID aLayer = F_Cu );
456 const std::optional<ZONE_CONNECTION>& ZoneConnection( PCB_LAYER_ID aLayer = F_Cu ) const;
457
458 std::optional<int>& ThermalSpokeWidth( PCB_LAYER_ID aLayer = F_Cu );
459 const std::optional<int>& ThermalSpokeWidth( PCB_LAYER_ID aLayer = F_Cu ) const;
460
461 std::optional<int>& ThermalGap( PCB_LAYER_ID aLayer = F_Cu );
462 const std::optional<int>& ThermalGap( PCB_LAYER_ID aLayer = F_Cu ) const;
463
466 void SetThermalSpokeAngle( EDA_ANGLE aAngle, PCB_LAYER_ID aLayer = F_Cu );
467
468 std::vector<std::shared_ptr<PCB_SHAPE>>& Primitives( PCB_LAYER_ID aLayer );
469 const std::vector<std::shared_ptr<PCB_SHAPE>>& Primitives( PCB_LAYER_ID aLayer ) const;
470
476 void AddPrimitive( PCB_SHAPE* aShape, PCB_LAYER_ID aLayer );
477
483 void AppendPrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList,
484 PCB_LAYER_ID aLayer );
485
492 void ReplacePrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList,
493 PCB_LAYER_ID aLayer );
494
495 void ClearPrimitives( PCB_LAYER_ID aLayer );
496
498 void SetBackdrillMode( BACKDRILL_MODE aMode );
499
500 std::optional<int> GetBackdrillSize( bool aTop ) const;
501 void SetBackdrillSize( bool aTop, std::optional<int> aSize );
502
503 PCB_LAYER_ID GetBackdrillEndLayer( bool aTop ) const;
504 void SetBackdrillEndLayer( bool aTop, PCB_LAYER_ID aLayer );
505
506private:
507 void packCopperLayer( PCB_LAYER_ID aLayer, kiapi::board::types::PadStack& aProto ) const;
508
509 bool unpackCopperLayer( const kiapi::board::types::PadStackLayer& aProto );
510
513
516
519
521 wxString m_customName;
522
525
527 //COPPER_LAYER_PROPS m_defaultCopperProps;
528 std::unordered_map<PCB_LAYER_ID, COPPER_LAYER_PROPS> m_copperProps;
529
532
535
537
544
548
551
554
557};
558
559#ifndef SWIG
563#endif
564
565
566#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:83
Represent basic circle geometry with utility geometry functions.
Definition circle.h:33
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:157
std::optional< bool > IsFilled() const
const DRILL_PROPS & Drill() const
Definition padstack.h:336
bool operator==(const PADSTACK &aOther) const
Definition padstack.cpp:128
CUSTOM_SHAPE_ZONE_MODE CustomShapeInZoneMode() const
Definition padstack.h:378
void SetCustomShapeInZoneMode(CUSTOM_SHAPE_ZONE_MODE aM)
Definition padstack.h:379
std::optional< int > & Clearance(PCB_LAYER_ID aLayer=F_Cu)
Definition padstack.cpp:997
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)
Definition padstack.cpp:493
void packCopperLayer(PCB_LAYER_ID aLayer, kiapi::board::types::PadStack &aProto) const
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition padstack.cpp:233
MASK_LAYER_PROPS & FrontOuterLayers()
Definition padstack.h:356
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
Definition padstack.cpp:950
void SetDrillShape(PAD_DRILL_SHAPE aShape)
Definition padstack.cpp:896
std::optional< double > & SolderPasteMarginRatio(PCB_LAYER_ID aLayer=F_Cu)
wxString m_customName
! An override for the IPC-7351 padstack name
Definition padstack.h:521
void SetBackdrillSize(bool aTop, std::optional< int > aSize)
Definition padstack.cpp:553
DRILL_PROPS m_drill
!
Definition padstack.h:547
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)
Definition padstack.cpp:944
UNCONNECTED_LAYER_MODE m_unconnectedLayerMode
Definition padstack.h:536
void ClearPrimitives(PCB_LAYER_ID aLayer)
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
Definition padstack.h:351
std::optional< bool > IsTented(PCB_LAYER_ID aSide) const
Checks if this padstack is tented (covered in soldermask) on the given side.
void SetMode(MODE aMode)
std::optional< int > & ThermalSpokeWidth(PCB_LAYER_ID aLayer=F_Cu)
std::optional< int > & SolderPasteMargin(PCB_LAYER_ID aLayer=F_Cu)
POST_MACHINING_PROPS m_backPostMachining
Definition padstack.h:556
void SetOrientation(EDA_ANGLE aAngle)
Definition padstack.h:329
const MASK_LAYER_PROPS & BackOuterLayers() const
Definition padstack.h:360
std::optional< int > & SolderMaskMargin(PCB_LAYER_ID aLayer=F_Cu)
void SetChamferRatio(double aRatio, PCB_LAYER_ID aLayer)
Definition padstack.cpp:973
const LSET & LayerSet() const
Definition padstack.h:309
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)
Definition padstack.cpp:81
void SetShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
Definition padstack.cpp:884
LSET & LayerSet()
Definition padstack.h:310
EDA_ANGLE DefaultThermalSpokeAngleForShape(PCB_LAYER_ID aLayer=F_Cu) const
VECTOR2I & TrapezoidDeltaSize(PCB_LAYER_ID aLayer)
Definition padstack.cpp:926
DRILL_PROPS m_secondaryDrill
! Secondary drill, used to define back-drilling starting from the bottom side
Definition padstack.h:550
VECTOR2I & Offset(PCB_LAYER_ID aLayer)
Definition padstack.cpp:902
MASK_LAYER_PROPS m_backMaskProps
! The overrides applied to back outer technical layers
Definition padstack.h:534
COPPER_LAYER_PROPS & CopperLayer(PCB_LAYER_ID aLayer)
const POST_MACHINING_PROPS & BackPostMachining() const
Definition padstack.h:348
EDA_ANGLE ThermalSpokeAngle(PCB_LAYER_ID aLayer=F_Cu) const
void FlipLayers(int aCopperLayerCount)
Flips the padstack layers in the case that the pad's parent footprint is flipped to the other side of...
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:543
bool unpackCopperLayer(const kiapi::board::types::PadStackLayer &aProto)
Definition padstack.cpp:182
PAD_DRILL_SHAPE DrillShape() const
Definition padstack.cpp:890
void SetChamferPositions(int aPositions, PCB_LAYER_ID aLayer)
Definition padstack.cpp:991
POST_MACHINING_PROPS & FrontPostMachining()
Definition padstack.h:344
DRILL_PROPS m_tertiaryDrill
! Tertiary drill, used to define back-drilling starting from the top side
Definition padstack.h:553
void SetRoundRectRadius(double aRadius, PCB_LAYER_ID aLayer)
Definition padstack.cpp:957
std::optional< bool > IsPlugged(PCB_LAYER_ID aSide) const
const MASK_LAYER_PROPS & FrontOuterLayers() const
Definition padstack.h:357
UNCONNECTED_LAYER_MODE UnconnectedLayerMode() const
Definition padstack.h:350
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()
Definition padstack.h:341
PAD_SHAPE Shape(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:878
DRILL_PROPS & Drill()
Definition padstack.h:335
void SetAnchorShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
Definition padstack.cpp:920
BOARD_ITEM * m_parent
! The BOARD_ITEM this PADSTACK belongs to; will be used as the parent for owned shapes
Definition padstack.h:512
PADSTACK(BOARD_ITEM *aParent)
Definition padstack.cpp:40
const POST_MACHINING_PROPS & FrontPostMachining() const
Definition padstack.h:345
std::optional< bool > IsCapped() const
std::vector< PCB_LAYER_ID > UniqueLayers() const
void SetBackdrillEndLayer(bool aTop, PCB_LAYER_ID aLayer)
Definition padstack.cpp:610
LSET m_layerSet
! The board layers that this padstack is active on
Definition padstack.h:518
std::optional< int > GetBackdrillSize(bool aTop) const
Definition padstack.cpp:537
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:528
BACKDRILL_MODE GetBackdrillMode() const
Definition padstack.cpp:462
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
Definition padstack.h:339
std::optional< bool > IsCovered(PCB_LAYER_ID aSide) const
int & ChamferPositions(PCB_LAYER_ID aLayer)
Definition padstack.cpp:979
MASK_LAYER_PROPS m_frontMaskProps
! The overrides applied to front outer technical layers
Definition padstack.h:531
const VECTOR2I & Size(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:872
virtual ~PADSTACK()=default
MODE
! Copper geometry mode: controls how many unique copper layer shapes this padstack has
Definition padstack.h:170
@ CUSTOM
Shapes can be defined on arbitrary layers.
Definition padstack.h:173
@ FRONT_INNER_BACK
Up to three shapes can be defined (F_Cu, inner copper layers, B_Cu)
Definition padstack.h:172
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()
Definition padstack.h:338
double RoundRectRadiusRatio(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:938
PCB_LAYER_ID GetBackdrillEndLayer(bool aTop) const
Definition padstack.cpp:594
PCB_LAYER_ID StartLayer() const
POST_MACHINING_PROPS & BackPostMachining()
Definition padstack.h:347
POST_MACHINING_PROPS m_frontPostMachining
Definition padstack.h:555
MODE Mode() const
Definition padstack.h:322
bool operator!=(const PADSTACK &aOther) const
Definition padstack.h:290
PAD_SHAPE AnchorShape(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:914
MASK_LAYER_PROPS & BackOuterLayers()
Definition padstack.h:359
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition padstack.cpp:631
wxString Name() const
! Returns the name of this padstack in IPC-7351 format
void SetSize(const VECTOR2I &aSize, PCB_LAYER_ID aLayer)
Definition padstack.cpp:858
const DRILL_PROPS & TertiaryDrill() const
Definition padstack.h:342
double ChamferRatio(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:967
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
Definition padstack.h:177
EDA_ANGLE GetOrientation() const
Definition padstack.h:328
static constexpr PCB_LAYER_ID INNER_LAYERS
! The layer identifier to use for "inner layers" on top/inner/bottom padstacks
Definition padstack.h:180
void SetLayerSet(const LSET &aSet)
Definition padstack.h:311
std::optional< ZONE_CONNECTION > & ZoneConnection(PCB_LAYER_ID aLayer=F_Cu)
@ NORMAL
Padstack for a footprint pad.
Definition padstack.h:163
@ MOUNTING
A mounting hole (plated or unplated, not associated with a footprint)
Definition padstack.h:165
@ VIA
Padstack for a via.
Definition padstack.h:164
MODE m_mode
! The copper layer variation mode this padstack is in
Definition padstack.h:515
EDA_ANGLE m_orientation
! The rotation of the pad relative to an outer reference frame
Definition padstack.h:524
std::vector< std::shared_ptr< PCB_SHAPE > > & Primitives(PCB_LAYER_ID aLayer)
A round rectangle shape, based on a rectangle and a radius.
Definition roundrect.h:36
Interface for objects that can be serialized to Protobuf messages.
@ NONE
Definition eda_shape.h:69
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_POST_MACHINING_MODE
Definition padstack.h:76
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
Definition padstack.h:69
CUSTOM_SHAPE_ZONE_MODE
Definition padstack.h:137
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
Definition padstack.h:97
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
Definition padstack.h:103
@ SMD
Smd pad, appears on the solder paste layer (default)
Definition padstack.h:99
@ PTH
Plated through hole pad.
Definition padstack.h:98
@ CONN
Like smd, does not appear on the solder paste layer (default) Note: also has a special attribute in G...
Definition padstack.h:100
BACKDRILL_MODE
Definition padstack.h:84
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
Definition padstack.h:52
@ CHAMFERED_RECT
Definition padstack.h:60
@ TRAPEZOID
Definition padstack.h:56
PAD_PROP
The set of pad properties used in Gerber files (Draw files, and P&P files) to define some properties ...
Definition padstack.h:114
@ FIDUCIAL_LOCAL
a fiducial (usually a smd) local to the parent footprint
Definition padstack.h:118
@ FIDUCIAL_GLBL
a fiducial (usually a smd) for the full board
Definition padstack.h:117
@ MECHANICAL
a pad used for mechanical support
Definition padstack.h:122
@ PRESSFIT
a PTH with a hole diameter with tight tolerances for press fit pin
Definition padstack.h:123
@ HEATSINK
a pad used as heat sink, usually in SMD footprints
Definition padstack.h:120
@ TESTPOINT
a test point pad
Definition padstack.h:119
@ CASTELLATED
a pad with a castellated through hole
Definition padstack.h:121
@ BGA
Smd pad, used in BGA footprints.
Definition padstack.h:116
UNCONNECTED_LAYER_MODE
Definition padstack.h:128
#define DECLARE_ENUM_TO_WXANY(type)
Definition property.h:787
The features of a padstack that can vary between copper layers All parameters are optional; leaving t...
Definition padstack.h:226
std::optional< ZONE_CONNECTION > zone_connection
Definition padstack.h:228
std::optional< int > thermal_spoke_width
Definition padstack.h:229
std::vector< std::shared_ptr< PCB_SHAPE > > custom_shapes
Definition padstack.h:238
bool operator==(const COPPER_LAYER_PROPS &aOther) const
std::optional< EDA_ANGLE > thermal_spoke_angle
Definition padstack.h:230
std::optional< int > clearance
Definition padstack.h:232
std::optional< int > thermal_gap
Definition padstack.h:231
! The properties of a padstack drill. Drill position is always the pad position (origin).
Definition padstack.h:261
PCB_LAYER_ID start
Definition padstack.h:264
PCB_LAYER_ID end
Definition padstack.h:265
bool operator==(const DRILL_PROPS &aOther) const
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
Definition padstack.h:262
std::optional< bool > is_capped
True if the drill hole should be capped.
Definition padstack.h:268
std::optional< bool > is_filled
True if the drill hole should be filled completely.
Definition padstack.h:267
PAD_DRILL_SHAPE shape
Definition padstack.h:263
bool operator==(const MASK_LAYER_PROPS &aOther) const
std::optional< int > solder_mask_margin
Definition padstack.h:247
std::optional< bool > has_covering
True if the pad on this side should have covering.
Definition padstack.h:253
std::optional< int > solder_paste_margin
Definition padstack.h:248
std::optional< double > solder_paste_margin_ratio
Definition padstack.h:249
std::optional< bool > has_solder_mask
True if this outer layer has mask (is not tented)
Definition padstack.h:251
std::optional< bool > has_solder_paste
True if this outer layer has solder paste.
Definition padstack.h:252
std::optional< bool > has_plugging
True if the drill hole should be plugged on this side.
Definition padstack.h:254
std::optional< PAD_DRILL_POST_MACHINING_MODE > mode
Definition padstack.h:275
bool operator==(const POST_MACHINING_PROPS &aOther) const
VECTOR2I trapezoid_delta_size
Delta for PAD_SHAPE::TRAPEZOID; half the delta squeezes one end and half expands the other.
Definition padstack.h:207
VECTOR2I offset
Offset of the shape center from the pad center.
Definition padstack.h:197
bool operator==(const SHAPE_PROPS &aOther) const
VECTOR2I size
Size of the shape, or of the anchor pad for custom shape pads.
Definition padstack.h:188
double chamfered_rect_ratio
Size of chamfer: ratio of smallest of X,Y size.
Definition padstack.h:200
double round_rect_radius_ratio
Definition padstack.h:199
PAD_SHAPE shape
Shape of the pad.
Definition padstack.h:186
PAD_SHAPE anchor_shape
Shape of the anchor when shape == PAD_SHAPE::CUSTOM.
Definition padstack.h:187
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695