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
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include <memory>
24#include <optional>
25#include <wx/string.h>
26
27#include <api/serializable.h>
28#include <geometry/eda_angle.h>
29#include <layer_ids.h>
30#include <lset.h>
31#include <math/vector2d.h>
32#include <properties/property.h>
33#include <zones.h>
34
35class BOARD_ITEM;
36class PCB_SHAPE;
37
38namespace kiapi::board::types
39{
40 class PadStack;
41 class PadStackLayer;
42}
43
44
50enum class PAD_SHAPE : int
51{
53 RECTANGLE, // do not use just RECT: it collides in a header on MSYS2
57
58 // Rectangle with a chamfered corner ( and with rounded other corners).
60 CUSTOM // A shape defined by user, using a set of basic shapes
61 // (thick segments, circles, arcs, polygons).
62};
63
73
81
89
95enum class PAD_ATTRIB
96{
104};
105
106
124
125
133
134
140
141
155class PADSTACK : public SERIALIZABLE
156{
157public:
160 enum class TYPE
161 {
165 };
166
174
177
179 static constexpr PCB_LAYER_ID ALL_LAYERS = F_Cu;
180
182 static constexpr PCB_LAYER_ID INNER_LAYERS = In1_Cu;
183
187 {
191
192 /*
193 * Most of the time the hole is the center of the shape (m_Offset = 0). But some designers
194 * use oblong/rect pads with a hole moved to one of the oblong/rect pad shape ends.
195 * In all cases the hole is at the pad position. This offset is from the hole to the center
196 * of the pad shape (ie: the copper area around the hole).
197 * ShapePos() returns the board shape position according to the offset and the pad rotation.
198 */
200
204
210
211 SHAPE_PROPS();
212 bool operator==( const SHAPE_PROPS& aOther ) const;
213 int Compare( const SHAPE_PROPS& aOther ) const;
214 };
215
229 {
231 std::optional<ZONE_CONNECTION> zone_connection;
232 std::optional<int> thermal_spoke_width;
233 std::optional<EDA_ANGLE> thermal_spoke_angle;
234 std::optional<int> thermal_gap;
235 std::optional<int> clearance;
236
237 /*
238 * Editing definitions of primitives for custom pad shapes. In local coordinates relative
239 * to m_Pos (NOT shapePos) at orient 0.
240 */
241 std::vector<std::shared_ptr<PCB_SHAPE>> custom_shapes;
242
243 bool operator==( const COPPER_LAYER_PROPS& aOther ) const;
244 int Compare( const COPPER_LAYER_PROPS& aOther ) const;
245
246 double Similarity( const COPPER_LAYER_PROPS& aOther ) const;
247 };
248
254 {
255 std::optional<int> solder_mask_margin;
256 std::optional<int> solder_paste_margin;
257 std::optional<double> solder_paste_margin_ratio;
258
259 std::optional<bool> has_solder_mask;
260 std::optional<bool> has_solder_paste;
261 std::optional<bool> has_covering;
262 std::optional<bool> has_plugging;
263
264 bool operator==( const MASK_LAYER_PROPS& aOther ) const;
265 int Compare( const MASK_LAYER_PROPS& aOther ) const;
266 };
267
272 {
277
278 std::optional<bool> is_filled;
279 std::optional<bool> is_capped;
280
281 bool operator==( const DRILL_PROPS& aOther ) const;
282 int Compare( const DRILL_PROPS& aOther ) const;
283 };
284
286 {
287 std::optional<PAD_DRILL_POST_MACHINING_MODE> mode;
288 int size = 0;
289 int depth = 0;
290 int angle = 0;
291
292 bool operator==( const POST_MACHINING_PROPS& aOther ) const;
293 int Compare( const POST_MACHINING_PROPS& aOther ) const;
294 };
295
296public:
297 PADSTACK( BOARD_ITEM* aParent );
298 virtual ~PADSTACK() = default;
299 PADSTACK( const PADSTACK& aOther );
300 PADSTACK& operator=( const PADSTACK &aOther );
301
302 bool operator==( const PADSTACK& aOther ) const;
303 bool operator!=( const PADSTACK& aOther ) const { return !operator==( aOther ); }
304
305 void Serialize( google::protobuf::Any &aContainer ) const override;
306 bool Deserialize( const google::protobuf::Any &aContainer ) override;
307
308 void Serialize( kiapi::board::types::PadStack& aOutput ) const;
309 bool Deserialize( const kiapi::board::types::PadStack& aInput );
310
317 static int Compare( const PADSTACK* aPadstackRef, const PADSTACK* aPadstackCmp );
318
323 bool HasExplicitDefinitionForLayer( PCB_LAYER_ID aLayer ) const;
324
329 double Similarity( const PADSTACK& aOther ) const;
330
331 const LSET& LayerSet() const { return m_layerSet; }
332 LSET& LayerSet() { return m_layerSet; }
333 void SetLayerSet( const LSET& aSet ) { m_layerSet = aSet; }
334
339 void FlipLayers( BOARD* aBoard );
340
341 PCB_LAYER_ID StartLayer() const;
342 PCB_LAYER_ID EndLayer() const;
343
344 MODE Mode() const { return m_mode; }
345 void SetMode( MODE aMode );
346
348 wxString Name() const;
349
350 const wxChar* CustomName() const;
351 void SetCustomName( const wxString& aCustomName );
352
354
356 {
357 m_orientation = aAngle;
358 m_orientation.Normalize();
359 }
360
361 DRILL_PROPS& Drill() { return m_drill; }
362 const DRILL_PROPS& Drill() const { return m_drill; }
363
365 const DRILL_PROPS& SecondaryDrill() const { return m_secondaryDrill; }
366
368 const DRILL_PROPS& TertiaryDrill() const { return m_tertiaryDrill; }
369
372
375
376 int GetMaxHoleSize() const;
377
380
381 COPPER_LAYER_PROPS& CopperLayer( PCB_LAYER_ID aLayer );
382 const COPPER_LAYER_PROPS& CopperLayer( PCB_LAYER_ID aLayer ) const;
383
386
389
396 std::optional<bool> IsTented( PCB_LAYER_ID aSide ) const;
397
398 std::optional<bool> IsCovered( PCB_LAYER_ID aSide ) const;
399
400 std::optional<bool> IsPlugged( PCB_LAYER_ID aSide ) const;
401
402 std::optional<bool> IsCapped() const;
403
404 std::optional<bool> IsFilled() const;
405
408
415 void ForEachUniqueLayer( const std::function<void( PCB_LAYER_ID )>& aMethod ) const;
416
417 std::vector<PCB_LAYER_ID> UniqueLayers() const;
418
429
435 LSET RelevantShapeLayers( const PADSTACK& aOther ) const;
436
437 // The following section has convenience getters for the padstack properties on a given layer.
438
439 PAD_SHAPE Shape( PCB_LAYER_ID aLayer ) const;
440 void SetShape( PAD_SHAPE aShape, PCB_LAYER_ID aLayer );
441
442 // Setter rather than direct access to enforce only positive sizes
443 void SetSize( const VECTOR2I& aSize, PCB_LAYER_ID aLayer );
444 const VECTOR2I& Size( PCB_LAYER_ID aLayer ) const;
445
447 void SetDrillShape( PAD_DRILL_SHAPE aShape );
448
449 VECTOR2I& Offset( PCB_LAYER_ID aLayer );
450 const VECTOR2I& Offset( PCB_LAYER_ID aLayer ) const;
451 void SetOffset( const VECTOR2I& aOffset, PCB_LAYER_ID aLayer );
452
453 PAD_SHAPE AnchorShape( PCB_LAYER_ID aLayer ) const;
454 void SetAnchorShape( PAD_SHAPE aShape, PCB_LAYER_ID aLayer );
455
457 const VECTOR2I& TrapezoidDeltaSize( PCB_LAYER_ID aLayer ) const;
458
459 double RoundRectRadiusRatio( PCB_LAYER_ID aLayer ) const;
460 void SetRoundRectRadiusRatio( double aRatio, PCB_LAYER_ID aLayer );
461
462 int RoundRectRadius( PCB_LAYER_ID aLayer ) const;
463 void SetRoundRectRadius( double aRadius, PCB_LAYER_ID aLayer );
464
465 double ChamferRatio( PCB_LAYER_ID aLayer ) const;
466 void SetChamferRatio( double aRatio, PCB_LAYER_ID aLayer );
467
468 int& ChamferPositions( PCB_LAYER_ID aLayer );
469 const int& ChamferPositions( PCB_LAYER_ID aLayer ) const;
470 void SetChamferPositions( int aPositions, PCB_LAYER_ID aLayer );
471
472 std::optional<int>& Clearance( PCB_LAYER_ID aLayer = F_Cu );
473 const std::optional<int>& Clearance( PCB_LAYER_ID aLayer = F_Cu ) const;
474
475 std::optional<int>& SolderMaskMargin( PCB_LAYER_ID aLayer = F_Cu );
476 const std::optional<int>& SolderMaskMargin( PCB_LAYER_ID aLayer = F_Cu ) const;
477
478 std::optional<int>& SolderPasteMargin( PCB_LAYER_ID aLayer = F_Cu );
479 const std::optional<int>& SolderPasteMargin( PCB_LAYER_ID aLayer = F_Cu ) const;
480
481 std::optional<double>& SolderPasteMarginRatio( PCB_LAYER_ID aLayer = F_Cu );
482 const std::optional<double>& SolderPasteMarginRatio( PCB_LAYER_ID aLayer = F_Cu ) const;
483
484 std::optional<ZONE_CONNECTION>& ZoneConnection( PCB_LAYER_ID aLayer = F_Cu );
485 const std::optional<ZONE_CONNECTION>& ZoneConnection( PCB_LAYER_ID aLayer = F_Cu ) const;
486
487 std::optional<int>& ThermalSpokeWidth( PCB_LAYER_ID aLayer = F_Cu );
488 const std::optional<int>& ThermalSpokeWidth( PCB_LAYER_ID aLayer = F_Cu ) const;
489
490 std::optional<int>& ThermalGap( PCB_LAYER_ID aLayer = F_Cu );
491 const std::optional<int>& ThermalGap( PCB_LAYER_ID aLayer = F_Cu ) const;
492
495 void SetThermalSpokeAngle( EDA_ANGLE aAngle, PCB_LAYER_ID aLayer = F_Cu );
496
497 std::vector<std::shared_ptr<PCB_SHAPE>>& Primitives( PCB_LAYER_ID aLayer );
498 const std::vector<std::shared_ptr<PCB_SHAPE>>& Primitives( PCB_LAYER_ID aLayer ) const;
499
505 void AddPrimitive( PCB_SHAPE* aShape, PCB_LAYER_ID aLayer );
506
512 void AppendPrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList, PCB_LAYER_ID aLayer );
513
520 void ReplacePrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList, PCB_LAYER_ID aLayer );
521
522 void ClearPrimitives( PCB_LAYER_ID aLayer );
523
525 void SetBackdrillMode( BACKDRILL_MODE aMode );
526
527 std::optional<int> GetBackdrillSize( bool aTop ) const;
528 void SetBackdrillSize( bool aTop, std::optional<int> aSize );
529
530 PCB_LAYER_ID GetBackdrillEndLayer( bool aTop ) const;
531 void SetBackdrillEndLayer( bool aTop, PCB_LAYER_ID aLayer );
532
533private:
540 const DRILL_PROPS* findBackdrillDrill( bool aTop ) const;
541 DRILL_PROPS* findBackdrillDrill( bool aTop );
542
545 DRILL_PROPS& backdrillWriteSlot( bool aTop );
546
549 void clearBackdrillSide( bool aTop );
550
551 bool unpackCopperLayer( const kiapi::board::types::PadStackLayer& aProto );
552
553private:
556
559
562
564 std::unique_ptr<wxString> m_customName;
565
568
569 std::unordered_map<PCB_LAYER_ID, COPPER_LAYER_PROPS> m_copperProps;
570
573
576
578
585
589
592
595
598};
599
603
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:84
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:409
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:156
std::optional< bool > IsFilled() const
const DRILL_PROPS & Drill() const
Definition padstack.h:362
bool operator==(const PADSTACK &aOther) const
Definition padstack.cpp:133
CUSTOM_SHAPE_ZONE_MODE CustomShapeInZoneMode() const
Definition padstack.h:406
void SetCustomShapeInZoneMode(CUSTOM_SHAPE_ZONE_MODE aM)
Definition padstack.h:407
std::optional< int > & Clearance(PCB_LAYER_ID aLayer=F_Cu)
Definition padstack.cpp:999
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:547
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition padstack.cpp:464
MASK_LAYER_PROPS & FrontOuterLayers()
Definition padstack.h:384
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:952
void SetDrillShape(PAD_DRILL_SHAPE aShape)
Definition padstack.cpp:892
int GetMaxHoleSize() const
std::optional< double > & SolderPasteMarginRatio(PCB_LAYER_ID aLayer=F_Cu)
void SetBackdrillSize(bool aTop, std::optional< int > aSize)
Definition padstack.cpp:580
DRILL_PROPS m_drill
!
Definition padstack.h:588
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:946
UNCONNECTED_LAYER_MODE m_unconnectedLayerMode
Definition padstack.h:577
void ClearPrimitives(PCB_LAYER_ID aLayer)
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
Definition padstack.h:379
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.
void SetMode(MODE aMode)
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
Definition padstack.h:597
void SetOrientation(EDA_ANGLE aAngle)
Definition padstack.h:355
const MASK_LAYER_PROPS & BackOuterLayers() const
Definition padstack.h:388
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 ...
Definition padstack.cpp:479
void SetChamferRatio(double aRatio, PCB_LAYER_ID aLayer)
Definition padstack.cpp:975
const LSET & LayerSet() const
Definition padstack.h:331
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:85
void SetOffset(const VECTOR2I &aOffset, PCB_LAYER_ID aLayer)
Definition padstack.cpp:910
void SetShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
Definition padstack.cpp:880
LSET & LayerSet()
Definition padstack.h:332
EDA_ANGLE DefaultThermalSpokeAngleForShape(PCB_LAYER_ID aLayer=F_Cu) const
VECTOR2I & TrapezoidDeltaSize(PCB_LAYER_ID aLayer)
Definition padstack.cpp:928
DRILL_PROPS m_secondaryDrill
! Secondary drill, used to define back-drilling starting from the bottom side
Definition padstack.h:591
void clearBackdrillSide(bool aTop)
Clear every slot whose start layer marks it as the given backdrill side, so a malformed padstack with...
Definition padstack.cpp:517
VECTOR2I & Offset(PCB_LAYER_ID aLayer)
Definition padstack.cpp:898
MASK_LAYER_PROPS m_backMaskProps
! The overrides applied to back outer technical layers
Definition padstack.h:575
COPPER_LAYER_PROPS & CopperLayer(PCB_LAYER_ID aLayer)
const POST_MACHINING_PROPS & BackPostMachining() const
Definition padstack.h:374
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 ...
Definition padstack.h:584
bool unpackCopperLayer(const kiapi::board::types::PadStackLayer &aProto)
Definition padstack.cpp:187
PAD_DRILL_SHAPE DrillShape() const
Definition padstack.cpp:886
void SetChamferPositions(int aPositions, PCB_LAYER_ID aLayer)
Definition padstack.cpp:993
POST_MACHINING_PROPS & FrontPostMachining()
Definition padstack.h:370
DRILL_PROPS m_tertiaryDrill
! Tertiary drill, used to define back-drilling starting from the top side
Definition padstack.h:594
void SetRoundRectRadius(double aRadius, PCB_LAYER_ID aLayer)
Definition padstack.cpp:959
std::optional< bool > IsPlugged(PCB_LAYER_ID aSide) const
const MASK_LAYER_PROPS & FrontOuterLayers() const
Definition padstack.h:385
UNCONNECTED_LAYER_MODE UnconnectedLayerMode() const
Definition padstack.h:378
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:367
PAD_SHAPE Shape(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:874
DRILL_PROPS & Drill()
Definition padstack.h:361
void SetAnchorShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
Definition padstack.cpp:922
BOARD_ITEM * m_parent
! The BOARD_ITEM this PADSTACK belongs to; will be used as the parent for owned shapes
Definition padstack.h:555
PADSTACK(BOARD_ITEM *aParent)
Definition padstack.cpp:44
const POST_MACHINING_PROPS & FrontPostMachining() const
Definition padstack.h:371
std::optional< bool > IsCapped() const
std::vector< PCB_LAYER_ID > UniqueLayers() const
void SetBackdrillEndLayer(bool aTop, PCB_LAYER_ID aLayer)
Definition padstack.cpp:605
LSET m_layerSet
! The board layers that this padstack is active on
Definition padstack.h:561
std::optional< int > GetBackdrillSize(bool aTop) const
Definition padstack.cpp:571
std::unordered_map< PCB_LAYER_ID, COPPER_LAYER_PROPS > m_copperProps
Definition padstack.h:569
BACKDRILL_MODE GetBackdrillMode() const
Definition padstack.cpp:529
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:365
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...
Definition padstack.cpp:499
int & ChamferPositions(PCB_LAYER_ID aLayer)
Definition padstack.cpp:981
MASK_LAYER_PROPS m_frontMaskProps
! The overrides applied to front outer technical layers
Definition padstack.h:572
const VECTOR2I & Size(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:868
virtual ~PADSTACK()=default
MODE
! Copper geometry mode: controls how many unique copper layer shapes this padstack has
Definition padstack.h:169
@ CUSTOM
Shapes can be defined on arbitrary layers.
Definition padstack.h:172
@ FRONT_INNER_BACK
Up to three shapes can be defined (F_Cu, inner copper layers, B_Cu)
Definition padstack.h:171
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:364
double RoundRectRadiusRatio(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:940
PCB_LAYER_ID GetBackdrillEndLayer(bool aTop) const
Definition padstack.cpp:596
PCB_LAYER_ID StartLayer() const
POST_MACHINING_PROPS & BackPostMachining()
Definition padstack.h:373
POST_MACHINING_PROPS m_frontPostMachining
Definition padstack.h:596
MODE Mode() const
Definition padstack.h:344
bool operator!=(const PADSTACK &aOther) const
Definition padstack.h:303
std::unique_ptr< wxString > m_customName
! An override for the IPC-7351 padstack name
Definition padstack.h:564
PAD_SHAPE AnchorShape(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:916
MASK_LAYER_PROPS & BackOuterLayers()
Definition padstack.h:387
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition padstack.cpp:846
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:854
const DRILL_PROPS & TertiaryDrill() const
Definition padstack.h:368
double ChamferRatio(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:969
static constexpr PCB_LAYER_ID ALL_LAYERS
! The layer identifier to use for the single defintion on normal padstacks
Definition padstack.h:179
const wxChar * CustomName() const
static constexpr PCB_LAYER_ID TEMP_ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
Definition padstack.h:176
EDA_ANGLE GetOrientation() const
Definition padstack.h:353
static constexpr PCB_LAYER_ID INNER_LAYERS
! The layer identifier to use for "inner layers" on top/inner/bottom padstacks
Definition padstack.h:182
void SetLayerSet(const LSET &aSet)
Definition padstack.h:333
std::optional< ZONE_CONNECTION > & ZoneConnection(PCB_LAYER_ID aLayer=F_Cu)
@ NORMAL
Padstack for a footprint pad.
Definition padstack.h:162
@ MOUNTING
A mounting hole (plated or unplated, not associated with a footprint)
Definition padstack.h:164
@ VIA
Padstack for a via.
Definition padstack.h:163
MODE m_mode
! The copper layer variation mode this padstack is in
Definition padstack.h:558
EDA_ANGLE m_orientation
! The rotation of the pad relative to an outer reference frame
Definition padstack.h:567
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:32
Interface for objects that can be serialized to Protobuf messages.
@ NONE
Definition eda_fill.h:42
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
@ UNDEFINED_LAYER
Definition layer_ids.h:57
@ In1_Cu
Definition layer_ids.h:62
@ F_Cu
Definition layer_ids.h:60
PAD_DRILL_POST_MACHINING_MODE
Definition padstack.h:75
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
Definition padstack.h:68
CUSTOM_SHAPE_ZONE_MODE
Definition padstack.h:136
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
Definition padstack.h:96
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
Definition padstack.h:102
@ PTH
Plated through hole pad.
Definition padstack.h:97
@ CONN
Like smd, does not appear on the solder paste layer (default) Note: also has a special attribute in G...
Definition padstack.h:99
BACKDRILL_MODE
Definition padstack.h:83
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
Definition padstack.h:51
@ CHAMFERED_RECT
Definition padstack.h:59
@ TRAPEZOID
Definition padstack.h:55
PAD_PROP
The set of pad properties used in Gerber files (Draw files, and P&P files) to define some properties ...
Definition padstack.h:113
@ FIDUCIAL_LOCAL
a fiducial (usually a smd) local to the parent footprint
Definition padstack.h:117
@ FIDUCIAL_GLBL
a fiducial (usually a smd) for the full board
Definition padstack.h:116
@ MECHANICAL
a pad used for mechanical support
Definition padstack.h:121
@ PRESSFIT
a PTH with a hole diameter with tight tolerances for press fit pin
Definition padstack.h:122
@ HEATSINK
a pad used as heat sink, usually in SMD footprints
Definition padstack.h:119
@ TESTPOINT
a test point pad
Definition padstack.h:118
@ CASTELLATED
a pad with a castellated through hole
Definition padstack.h:120
@ BGA
Smd pad, used in BGA footprints.
Definition padstack.h:115
UNCONNECTED_LAYER_MODE
Definition padstack.h:127
#define DECLARE_ENUM_TO_WXANY(type)
Definition property.h:838
The features of a padstack that can vary between copper layers All parameters are optional; leaving t...
Definition padstack.h:229
double Similarity(const COPPER_LAYER_PROPS &aOther) const
std::optional< ZONE_CONNECTION > zone_connection
Definition padstack.h:231
int Compare(const COPPER_LAYER_PROPS &aOther) const
std::optional< int > thermal_spoke_width
Definition padstack.h:232
std::vector< std::shared_ptr< PCB_SHAPE > > custom_shapes
Definition padstack.h:241
bool operator==(const COPPER_LAYER_PROPS &aOther) const
std::optional< EDA_ANGLE > thermal_spoke_angle
Definition padstack.h:233
std::optional< int > clearance
Definition padstack.h:235
std::optional< int > thermal_gap
Definition padstack.h:234
The properties of a padstack drill.
Definition padstack.h:272
PCB_LAYER_ID start
Definition padstack.h:275
PCB_LAYER_ID end
Definition padstack.h:276
bool operator==(const DRILL_PROPS &aOther) const
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
Definition padstack.h:273
std::optional< bool > is_capped
True if the drill hole should be capped.
Definition padstack.h:279
std::optional< bool > is_filled
True if the drill hole should be filled completely.
Definition padstack.h:278
PAD_DRILL_SHAPE shape
Definition padstack.h:274
int Compare(const DRILL_PROPS &aOther) const
The features of a padstack that can vary on outer layers.
Definition padstack.h:254
bool operator==(const MASK_LAYER_PROPS &aOther) const
std::optional< int > solder_mask_margin
Definition padstack.h:255
int Compare(const MASK_LAYER_PROPS &aOther) const
std::optional< bool > has_covering
True if the pad on this side should have covering.
Definition padstack.h:261
std::optional< int > solder_paste_margin
Definition padstack.h:256
std::optional< double > solder_paste_margin_ratio
Definition padstack.h:257
std::optional< bool > has_solder_mask
True if this outer layer has mask (is not tented)
Definition padstack.h:259
std::optional< bool > has_solder_paste
True if this outer layer has solder paste.
Definition padstack.h:260
std::optional< bool > has_plugging
True if the drill hole should be plugged on this side.
Definition padstack.h:262
std::optional< PAD_DRILL_POST_MACHINING_MODE > mode
Definition padstack.h:287
bool operator==(const POST_MACHINING_PROPS &aOther) const
int Compare(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:209
int Compare(const SHAPE_PROPS &aOther) const
VECTOR2I offset
Offset of the shape center from the pad center.
Definition padstack.h:199
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:190
double chamfered_rect_ratio
Size of chamfer: ratio of smallest of X,Y size.
Definition padstack.h:202
double round_rect_radius_ratio
Definition padstack.h:201
PAD_SHAPE shape
Shape of the pad.
Definition padstack.h:188
PAD_SHAPE anchor_shape
Shape of the anchor when shape == PAD_SHAPE::CUSTOM.
Definition padstack.h:189
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683