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;
36class BOARD_ITEM;
37class BOARD_STACKUP;
38class PCB_SHAPE;
39
40namespace kiapi::board::types
41{
42 class PadStack;
43 class PadStackLayer;
44}
45
46
52enum class PAD_SHAPE : int
53{
55 RECTANGLE, // do not use just RECT: it collides in a header on MSYS2
59
60 // Rectangle with a chamfered corner ( and with rounded other corners).
62 CUSTOM // A shape defined by user, using a set of basic shapes
63 // (thick segments, circles, arcs, polygons).
64};
65
75
83
91
110
111
129
130
138
139
145
146
160class PADSTACK : public SERIALIZABLE
161{
162public:
165 enum class TYPE
166 {
170 };
171
179
182
184 static constexpr PCB_LAYER_ID ALL_LAYERS = F_Cu;
185
187 static constexpr PCB_LAYER_ID INNER_LAYERS = In1_Cu;
188
192 {
196
197 /*
198 * Most of the time the hole is the center of the shape (m_Offset = 0). But some designers
199 * use oblong/rect pads with a hole moved to one of the oblong/rect pad shape ends.
200 * In all cases the hole is at the pad position. This offset is from the hole to the center
201 * of the pad shape (ie: the copper area around the hole).
202 * ShapePos() returns the board shape position according to the offset and the pad rotation.
203 */
205
209
215
216 SHAPE_PROPS();
217 bool operator==( const SHAPE_PROPS& aOther ) const;
218 int Compare( const SHAPE_PROPS& aOther ) const;
219 };
220
234 {
236 std::optional<ZONE_CONNECTION> zone_connection;
237 std::optional<int> thermal_spoke_width;
238 std::optional<EDA_ORIENTATION> thermal_spoke_angle;
239 std::optional<int> thermal_gap;
240 std::optional<int> clearance;
241
242 /*
243 * Editing definitions of primitives for custom pad shapes. In local coordinates relative
244 * to m_Pos (NOT shapePos) at orient 0.
245 */
246 std::vector<std::shared_ptr<PCB_SHAPE>> custom_shapes;
247
248 bool operator==( const COPPER_LAYER_PROPS& aOther ) const;
249 int Compare( const COPPER_LAYER_PROPS& aOther ) const;
250
251 double Similarity( const COPPER_LAYER_PROPS& aOther ) const;
252 };
253
259 {
260 std::optional<int> solder_mask_margin;
261 std::optional<int> solder_paste_margin;
262 std::optional<double> solder_paste_margin_ratio;
263
264 std::optional<bool> has_solder_mask;
265 std::optional<bool> has_solder_paste;
266 std::optional<bool> has_covering;
267 std::optional<bool> has_plugging;
268
269 bool operator==( const MASK_LAYER_PROPS& aOther ) const;
270 int Compare( const MASK_LAYER_PROPS& aOther ) const;
271 };
272
277 {
282
283 std::optional<bool> is_filled;
284 std::optional<bool> is_capped;
285
286 bool operator==( const DRILL_PROPS& aOther ) const;
287 int Compare( const DRILL_PROPS& aOther ) const;
288 };
289
291 {
292 std::optional<PAD_DRILL_POST_MACHINING_MODE> mode;
293 int size = 0;
294 int depth = 0;
295 int angle = 0;
296
297 bool operator==( const POST_MACHINING_PROPS& aOther ) const;
298 int Compare( const POST_MACHINING_PROPS& aOther ) const;
299 };
300
301public:
302 PADSTACK( BOARD_ITEM* aParent );
303 virtual ~PADSTACK() = default;
304 PADSTACK( const PADSTACK& aOther );
305 PADSTACK& operator=( const PADSTACK &aOther );
306
307 bool operator==( const PADSTACK& aOther ) const;
308 bool operator!=( const PADSTACK& aOther ) const { return !operator==( aOther ); }
309
310 void Serialize( google::protobuf::Any &aContainer ) const override;
311 bool Deserialize( const google::protobuf::Any &aContainer ) override;
312
313 void Serialize( kiapi::board::types::PadStack& aOutput ) const;
314 bool Deserialize( const kiapi::board::types::PadStack& aInput );
315
322 static int Compare( const PADSTACK* aPadstackRef, const PADSTACK* aPadstackCmp );
323
328 bool HasExplicitDefinitionForLayer( PCB_LAYER_ID aLayer ) const;
329
334 double Similarity( const PADSTACK& aOther ) const;
335
336 const LSET& LayerSet() const { return m_layerSet; }
337 LSET& LayerSet() { return m_layerSet; }
338 void SetLayerSet( const LSET& aSet ) { m_layerSet = aSet; }
339
346 void FlipLayers( BOARD* aBoard );
347
348 PCB_LAYER_ID StartLayer() const;
349 PCB_LAYER_ID EndLayer() const;
350
351 MODE Mode() const { return m_mode; }
352 void SetMode( MODE aMode );
353
355 wxString Name() const;
356
357 const wxChar* CustomName() const;
358 void SetCustomName( const wxString& aCustomName );
359
360 EDA_ANGLE GetOrientation() const { return m_orientation.GetAngle(); }
361 void SetOrientation( const EDA_ANGLE& aAngle ) { m_orientation = aAngle; }
362
363 DRILL_PROPS& Drill() { return m_drill; }
364 const DRILL_PROPS& Drill() const { return m_drill; }
365
367 const DRILL_PROPS& SecondaryDrill() const { return m_secondaryDrill; }
368
370 const DRILL_PROPS& TertiaryDrill() const { return m_tertiaryDrill; }
371
374
377
378 int GetMaxHoleSize() const;
379
389 int PostMachiningKnockout( const BOARD_STACKUP& aStackup, PCB_LAYER_ID aLayer ) const;
390
402 int MachiningKnockout( const BOARD& aBoard, PCB_LAYER_ID aLayer ) const;
403
406
407 COPPER_LAYER_PROPS& CopperLayer( PCB_LAYER_ID aLayer );
408 const COPPER_LAYER_PROPS& CopperLayer( PCB_LAYER_ID aLayer ) const;
409
412
415
422 std::optional<bool> IsTented( PCB_LAYER_ID aSide ) const;
423
424 std::optional<bool> IsCovered( PCB_LAYER_ID aSide ) const;
425
426 std::optional<bool> IsPlugged( PCB_LAYER_ID aSide ) const;
427
428 std::optional<bool> IsCapped() const;
429
430 std::optional<bool> IsFilled() const;
431
434
441 void ForEachUniqueLayer( const std::function<void( PCB_LAYER_ID )>& aMethod ) const;
442
443 std::vector<PCB_LAYER_ID> UniqueLayers() const;
444
455
461 LSET RelevantShapeLayers( const PADSTACK& aOther ) const;
462
463 // The following section has convenience getters for the padstack properties on a given layer.
464
465 PAD_SHAPE Shape( PCB_LAYER_ID aLayer ) const;
466 void SetShape( PAD_SHAPE aShape, PCB_LAYER_ID aLayer );
467
468 // Setter rather than direct access to enforce only positive sizes
469 void SetSize( const VECTOR2I& aSize, PCB_LAYER_ID aLayer );
470 const VECTOR2I& Size( PCB_LAYER_ID aLayer ) const;
471
473 void SetDrillShape( PAD_DRILL_SHAPE aShape );
474
475 VECTOR2I& Offset( PCB_LAYER_ID aLayer );
476 const VECTOR2I& Offset( PCB_LAYER_ID aLayer ) const;
477 void SetOffset( const VECTOR2I& aOffset, PCB_LAYER_ID aLayer );
478
479 PAD_SHAPE AnchorShape( PCB_LAYER_ID aLayer ) const;
480 void SetAnchorShape( PAD_SHAPE aShape, PCB_LAYER_ID aLayer );
481
483 const VECTOR2I& TrapezoidDeltaSize( PCB_LAYER_ID aLayer ) const;
484
485 double RoundRectRadiusRatio( PCB_LAYER_ID aLayer ) const;
486 void SetRoundRectRadiusRatio( double aRatio, PCB_LAYER_ID aLayer );
487
488 int RoundRectRadius( PCB_LAYER_ID aLayer ) const;
489 void SetRoundRectRadius( double aRadius, PCB_LAYER_ID aLayer );
490
491 double ChamferRatio( PCB_LAYER_ID aLayer ) const;
492 void SetChamferRatio( double aRatio, PCB_LAYER_ID aLayer );
493
494 int& ChamferPositions( PCB_LAYER_ID aLayer );
495 const int& ChamferPositions( PCB_LAYER_ID aLayer ) const;
496 void SetChamferPositions( int aPositions, PCB_LAYER_ID aLayer );
497
498 std::optional<int>& Clearance( PCB_LAYER_ID aLayer = F_Cu );
499 const std::optional<int>& Clearance( PCB_LAYER_ID aLayer = F_Cu ) const;
500
501 std::optional<int>& SolderMaskMargin( PCB_LAYER_ID aLayer = F_Cu );
502 const std::optional<int>& SolderMaskMargin( PCB_LAYER_ID aLayer = F_Cu ) const;
503
504 std::optional<int>& SolderPasteMargin( PCB_LAYER_ID aLayer = F_Cu );
505 const std::optional<int>& SolderPasteMargin( PCB_LAYER_ID aLayer = F_Cu ) const;
506
507 std::optional<double>& SolderPasteMarginRatio( PCB_LAYER_ID aLayer = F_Cu );
508 const std::optional<double>& SolderPasteMarginRatio( PCB_LAYER_ID aLayer = F_Cu ) const;
509
510 std::optional<ZONE_CONNECTION>& ZoneConnection( PCB_LAYER_ID aLayer = F_Cu );
511 const std::optional<ZONE_CONNECTION>& ZoneConnection( PCB_LAYER_ID aLayer = F_Cu ) const;
512
513 std::optional<int>& ThermalSpokeWidth( PCB_LAYER_ID aLayer = F_Cu );
514 const std::optional<int>& ThermalSpokeWidth( PCB_LAYER_ID aLayer = F_Cu ) const;
515
516 std::optional<int>& ThermalGap( PCB_LAYER_ID aLayer = F_Cu );
517 const std::optional<int>& ThermalGap( PCB_LAYER_ID aLayer = F_Cu ) const;
518
521 void SetThermalSpokeAngle( EDA_ANGLE aAngle, PCB_LAYER_ID aLayer = F_Cu );
522
523 std::vector<std::shared_ptr<PCB_SHAPE>>& Primitives( PCB_LAYER_ID aLayer );
524 const std::vector<std::shared_ptr<PCB_SHAPE>>& Primitives( PCB_LAYER_ID aLayer ) const;
525
531 void AddPrimitive( PCB_SHAPE* aShape, PCB_LAYER_ID aLayer );
532
538 void AppendPrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList, PCB_LAYER_ID aLayer );
539
546 void ReplacePrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList, PCB_LAYER_ID aLayer );
547
548 void ClearPrimitives( PCB_LAYER_ID aLayer );
549
551 void SetBackdrillMode( BACKDRILL_MODE aMode );
552
553 std::optional<int> GetBackdrillSize( bool aTop ) const;
554 void SetBackdrillSize( bool aTop, std::optional<int> aSize );
555
556 PCB_LAYER_ID GetBackdrillEndLayer( bool aTop ) const;
557 void SetBackdrillEndLayer( bool aTop, PCB_LAYER_ID aLayer );
558
559private:
566 const DRILL_PROPS* findBackdrillDrill( bool aTop ) const;
567 DRILL_PROPS* findBackdrillDrill( bool aTop );
568
571 DRILL_PROPS& backdrillWriteSlot( bool aTop );
572
575 void clearBackdrillSide( bool aTop );
576
577 bool unpackCopperLayer( const kiapi::board::types::PadStackLayer& aProto );
578
579private:
582
585
588
590 std::unique_ptr<wxString> m_customName;
591
594
595 std::unordered_map<PCB_LAYER_ID, COPPER_LAYER_PROPS> m_copperProps;
596
599
602
604
611
615
618
621
624};
625
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:99
Manage layers needed to make a physical board.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:411
Represent basic circle geometry with utility geometry functions.
Definition circle.h:33
An "orientation", held as an angle constrained to the range [0, 360) degrees.
Definition eda_angle.h:497
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:161
std::optional< bool > IsFilled() const
const DRILL_PROPS & Drill() const
Definition padstack.h:364
bool operator==(const PADSTACK &aOther) const
Definition padstack.cpp:135
CUSTOM_SHAPE_ZONE_MODE CustomShapeInZoneMode() const
Definition padstack.h:432
void SetCustomShapeInZoneMode(CUSTOM_SHAPE_ZONE_MODE aM)
Definition padstack.h:433
std::optional< int > & Clearance(PCB_LAYER_ID aLayer=F_Cu)
void AddPrimitive(PCB_SHAPE *aShape, PCB_LAYER_ID aLayer)
Adds a custom shape primitive to the padstack.
void ReplacePrimitives(const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList, PCB_LAYER_ID aLayer)
Clears the existing primitive list (freeing the owned shapes) and adds copies of the given shapes to ...
void SetBackdrillMode(BACKDRILL_MODE aMode)
Definition padstack.cpp:558
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition padstack.cpp:475
MASK_LAYER_PROPS & FrontOuterLayers()
Definition padstack.h:410
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:971
void SetDrillShape(PAD_DRILL_SHAPE aShape)
Definition padstack.cpp:911
int GetMaxHoleSize() const
std::optional< double > & SolderPasteMarginRatio(PCB_LAYER_ID aLayer=F_Cu)
void SetBackdrillSize(bool aTop, std::optional< int > aSize)
Definition padstack.cpp:595
DRILL_PROPS m_drill
!
Definition padstack.h:614
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:965
UNCONNECTED_LAYER_MODE m_unconnectedLayerMode
Definition padstack.h:603
void ClearPrimitives(PCB_LAYER_ID aLayer)
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
Definition padstack.h:405
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)
int MachiningKnockout(const BOARD &aBoard, PCB_LAYER_ID aLayer) const
Get the diameter of copper removed from aLayer by backdrilling or post-machining.
std::optional< int > & ThermalSpokeWidth(PCB_LAYER_ID aLayer=F_Cu)
std::optional< int > & SolderPasteMargin(PCB_LAYER_ID aLayer=F_Cu)
void FlipLayers(BOARD *aBoard)
Flips the padstack layers in the case that the pad's parent footprint is flipped to the other side of...
POST_MACHINING_PROPS m_backPostMachining
Definition padstack.h:623
const MASK_LAYER_PROPS & BackOuterLayers() const
Definition padstack.h:414
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:490
void SetChamferRatio(double aRatio, PCB_LAYER_ID aLayer)
Definition padstack.cpp:994
const LSET & LayerSet() const
Definition padstack.h:336
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:87
void SetOffset(const VECTOR2I &aOffset, PCB_LAYER_ID aLayer)
Definition padstack.cpp:929
void SetShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
Definition padstack.cpp:899
LSET & LayerSet()
Definition padstack.h:337
EDA_ANGLE DefaultThermalSpokeAngleForShape(PCB_LAYER_ID aLayer=F_Cu) const
VECTOR2I & TrapezoidDeltaSize(PCB_LAYER_ID aLayer)
Definition padstack.cpp:947
DRILL_PROPS m_secondaryDrill
! A back-drill, whose side is given by its start layer rather than by which slot it occupies
Definition padstack.h:617
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:528
VECTOR2I & Offset(PCB_LAYER_ID aLayer)
Definition padstack.cpp:917
MASK_LAYER_PROPS m_backMaskProps
! The overrides applied to back outer technical layers
Definition padstack.h:601
COPPER_LAYER_PROPS & CopperLayer(PCB_LAYER_ID aLayer)
const POST_MACHINING_PROPS & BackPostMachining() const
Definition padstack.h:376
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:610
bool unpackCopperLayer(const kiapi::board::types::PadStackLayer &aProto)
Definition padstack.cpp:196
PAD_DRILL_SHAPE DrillShape() const
Definition padstack.cpp:905
void SetChamferPositions(int aPositions, PCB_LAYER_ID aLayer)
POST_MACHINING_PROPS & FrontPostMachining()
Definition padstack.h:372
DRILL_PROPS m_tertiaryDrill
! The other back-drill; see findBackdrillDrill() for why either slot may hold either side
Definition padstack.h:620
void SetRoundRectRadius(double aRadius, PCB_LAYER_ID aLayer)
Definition padstack.cpp:978
std::optional< bool > IsPlugged(PCB_LAYER_ID aSide) const
const MASK_LAYER_PROPS & FrontOuterLayers() const
Definition padstack.h:411
UNCONNECTED_LAYER_MODE UnconnectedLayerMode() const
Definition padstack.h:404
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:369
PAD_SHAPE Shape(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:893
DRILL_PROPS & Drill()
Definition padstack.h:363
void SetAnchorShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
Definition padstack.cpp:941
EDA_ORIENTATION m_orientation
! The rotation of the pad relative to an outer reference frame
Definition padstack.h:593
BOARD_ITEM * m_parent
! The BOARD_ITEM this PADSTACK belongs to; will be used as the parent for owned shapes
Definition padstack.h:581
PADSTACK(BOARD_ITEM *aParent)
Definition padstack.cpp:46
const POST_MACHINING_PROPS & FrontPostMachining() const
Definition padstack.h:373
std::optional< bool > IsCapped() const
std::vector< PCB_LAYER_ID > UniqueLayers() const
void SetBackdrillEndLayer(bool aTop, PCB_LAYER_ID aLayer)
Definition padstack.cpp:620
LSET m_layerSet
! The board layers that this padstack is active on
Definition padstack.h:587
std::optional< int > GetBackdrillSize(bool aTop) const
Definition padstack.cpp:586
std::unordered_map< PCB_LAYER_ID, COPPER_LAYER_PROPS > m_copperProps
Definition padstack.h:595
BACKDRILL_MODE GetBackdrillMode() const
Definition padstack.cpp:540
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:367
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:510
int & ChamferPositions(PCB_LAYER_ID aLayer)
MASK_LAYER_PROPS m_frontMaskProps
! The overrides applied to front outer technical layers
Definition padstack.h:598
int PostMachiningKnockout(const BOARD_STACKUP &aStackup, PCB_LAYER_ID aLayer) const
Get the diameter the front and back post-machining operations cut into aLayer.
const VECTOR2I & Size(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:887
virtual ~PADSTACK()=default
MODE
! Copper geometry mode: controls how many unique copper layer shapes this padstack has
Definition padstack.h:174
@ CUSTOM
Shapes can be defined on arbitrary layers.
Definition padstack.h:177
@ FRONT_INNER_BACK
Up to three shapes can be defined (F_Cu, inner copper layers, B_Cu)
Definition padstack.h:176
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:366
double RoundRectRadiusRatio(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:959
PCB_LAYER_ID GetBackdrillEndLayer(bool aTop) const
Definition padstack.cpp:611
PCB_LAYER_ID StartLayer() const
POST_MACHINING_PROPS & BackPostMachining()
Definition padstack.h:375
POST_MACHINING_PROPS m_frontPostMachining
Definition padstack.h:622
MODE Mode() const
Definition padstack.h:351
bool operator!=(const PADSTACK &aOther) const
Definition padstack.h:308
std::unique_ptr< wxString > m_customName
! An override for the IPC-7351 padstack name
Definition padstack.h:590
PAD_SHAPE AnchorShape(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:935
MASK_LAYER_PROPS & BackOuterLayers()
Definition padstack.h:413
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition padstack.cpp:863
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:873
const DRILL_PROPS & TertiaryDrill() const
Definition padstack.h:370
void SetOrientation(const EDA_ANGLE &aAngle)
Definition padstack.h:361
double ChamferRatio(PCB_LAYER_ID aLayer) const
Definition padstack.cpp:988
static constexpr PCB_LAYER_ID ALL_LAYERS
! The layer identifier to use for the single defintion on normal padstacks
Definition padstack.h:184
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:181
EDA_ANGLE GetOrientation() const
Definition padstack.h:360
static constexpr PCB_LAYER_ID INNER_LAYERS
! The layer identifier to use for "inner layers" on top/inner/bottom padstacks
Definition padstack.h:187
void SetLayerSet(const LSET &aSet)
Definition padstack.h:338
std::optional< ZONE_CONNECTION > & ZoneConnection(PCB_LAYER_ID aLayer=F_Cu)
@ NORMAL
Padstack for a footprint pad.
Definition padstack.h:167
@ MOUNTING
A mounting hole (plated or unplated, not associated with a footprint)
Definition padstack.h:169
@ VIA
Padstack for a via.
Definition padstack.h:168
MODE m_mode
! The copper layer variation mode this padstack is in
Definition padstack.h:584
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
@ FIDUCIAL_LOCAL
Definition fab_pin.h:32
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:77
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
Definition padstack.h:70
CUSTOM_SHAPE_ZONE_MODE
Definition padstack.h:141
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
Definition padstack.h:98
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
Definition padstack.h:104
@ NON_COMPONENT
Pad with no hole that does not connect to a physical component, but rather provides a connection poin...
Definition padstack.h:106
@ PTH
Plated through hole pad.
Definition padstack.h:99
@ CONN
Like smd, does not appear on the solder paste layer (default) Note: also has a special attribute in G...
Definition padstack.h:101
BACKDRILL_MODE
Definition padstack.h:85
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
Definition padstack.h:53
@ CHAMFERED_RECT
Definition padstack.h:61
@ TRAPEZOID
Definition padstack.h:57
PAD_PROP
The set of pad properties used in Gerber files (Draw files, and P&P files) to define some properties ...
Definition padstack.h:118
@ FIDUCIAL_GLBL
a fiducial (usually a smd) for the full board
Definition padstack.h:121
UNCONNECTED_LAYER_MODE
Definition padstack.h:132
#define DECLARE_ENUM_TO_WXANY(type)
Definition property.h:879
The features of a padstack that can vary between copper layers All parameters are optional; leaving t...
Definition padstack.h:234
double Similarity(const COPPER_LAYER_PROPS &aOther) const
std::optional< ZONE_CONNECTION > zone_connection
Definition padstack.h:236
int Compare(const COPPER_LAYER_PROPS &aOther) const
std::optional< int > thermal_spoke_width
Definition padstack.h:237
std::vector< std::shared_ptr< PCB_SHAPE > > custom_shapes
Definition padstack.h:246
bool operator==(const COPPER_LAYER_PROPS &aOther) const
std::optional< EDA_ORIENTATION > thermal_spoke_angle
Definition padstack.h:238
std::optional< int > clearance
Definition padstack.h:240
std::optional< int > thermal_gap
Definition padstack.h:239
The properties of a padstack drill.
Definition padstack.h:277
PCB_LAYER_ID start
Definition padstack.h:280
PCB_LAYER_ID end
Definition padstack.h:281
bool operator==(const DRILL_PROPS &aOther) const
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
Definition padstack.h:278
std::optional< bool > is_capped
True if the drill hole should be capped.
Definition padstack.h:284
std::optional< bool > is_filled
True if the drill hole should be filled completely.
Definition padstack.h:283
PAD_DRILL_SHAPE shape
Definition padstack.h:279
int Compare(const DRILL_PROPS &aOther) const
The features of a padstack that can vary on outer layers.
Definition padstack.h:259
bool operator==(const MASK_LAYER_PROPS &aOther) const
std::optional< int > solder_mask_margin
Definition padstack.h:260
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:266
std::optional< int > solder_paste_margin
Definition padstack.h:261
std::optional< double > solder_paste_margin_ratio
Definition padstack.h:262
std::optional< bool > has_solder_mask
True if this outer layer has mask (is not tented)
Definition padstack.h:264
std::optional< bool > has_solder_paste
True if this outer layer has solder paste.
Definition padstack.h:265
std::optional< bool > has_plugging
True if the drill hole should be plugged on this side.
Definition padstack.h:267
std::optional< PAD_DRILL_POST_MACHINING_MODE > mode
Definition padstack.h:292
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:214
int Compare(const SHAPE_PROPS &aOther) const
VECTOR2I offset
Offset of the shape center from the pad center.
Definition padstack.h:204
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:195
double chamfered_rect_ratio
Size of chamfer: ratio of smallest of X,Y size.
Definition padstack.h:207
double round_rect_radius_ratio
Definition padstack.h:206
PAD_SHAPE shape
Shape of the pad.
Definition padstack.h:193
PAD_SHAPE anchor_shape
Shape of the anchor when shape == PAD_SHAPE::CUSTOM.
Definition padstack.h:194
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708