KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pads_parser.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) 2025 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#pragma once
25
26#include <string>
27#include <vector>
28#include <map>
29#include <optional>
30#include <wx/string.h>
31#include <wx/gdicmn.h> // For wxPoint if needed, or use VECTOR2I
32#include <math/vector2d.h>
33
34namespace PADS_IO
35{
36
37enum class UNIT_TYPE
38{
42};
43
44struct POINT
45{
46 double x;
47 double y;
48};
49
56struct ARC
57{
58 double cx;
59 double cy;
60 double radius;
61 double start_angle;
62 double delta_angle;
63};
64
72{
73 double x;
74 double y;
75 bool is_arc;
77
78 ARC_POINT() : x( 0 ), y( 0 ), is_arc( false ), arc{ 0, 0, 0, 0, 0 } {}
79 ARC_POINT( double aX, double aY ) : x( aX ), y( aY ), is_arc( false ), arc{ 0, 0, 0, 0, 0 } {}
80 ARC_POINT( double aX, double aY, const ARC& aArc ) : x( aX ), y( aY ), is_arc( true ), arc( aArc ) {}
81};
82
97
99{
100 std::string product;
101 std::string version;
102 std::string units;
103 std::string mode;
104 std::string encoding;
106};
107
109{
111 int layer_count = 2;
112 POINT origin = {0, 0};
113 double user_grid = 0.0;
114
115 // Thermal relief settings (global defaults)
116 double thermal_line_width = 30.0;
117 double thermal_smd_width = 20.0;
121
122 // Drill parameters
123 double drill_oversize = 0.0;
124
125 // Via defaults extracted from file
126 std::string default_signal_via;
127};
128
133{
134 double min_clearance = 8.0;
135 double default_clearance = 10.0;
136 double min_track_width = 6.0;
137 double default_track_width = 10.0;
138 double min_via_size = 20.0;
139 double default_via_size = 40.0;
140 double min_via_drill = 10.0;
141 double default_via_drill = 20.0;
142 double hole_to_hole = 10.0;
143 double silk_clearance = 5.0;
144 double mask_clearance = 3.0;
145 double copper_edge_clearance = 10.0;
146};
147
149{
150 // Line 1
151 bool visible = true;
152 double x = 0.0;
153 double y = 0.0;
154 double orientation = 0.0;
155 int level = 0;
156 double height = 0.0;
157 double width = 0.0;
158 bool mirrored = false;
159 std::string hjust;
160 std::string vjust;
161 bool right_reading = false;
162
163 // Line 2
164 std::string font_info;
165
166 // Line 3
167 std::string name; // "Ref.Des.", "Part Type", "VALUE", etc.
168};
169
170struct PART
171{
172 std::string name;
173 std::string decal;
174 std::string part_type;
175 std::vector<std::string> alternate_decals;
177 std::string value;
178 std::string units;
180 double rotation = 0.0;
181 bool bottom_layer = false;
182 bool glued = false;
183 bool explicit_decal = false;
184 std::vector<ATTRIBUTE> attributes;
185 std::string reuse_instance;
186 std::string reuse_part;
187};
188
190{
191 std::string ref_des;
192 std::string pin_name;
193 std::string reuse_instance;
194 std::string reuse_signal;
195};
196
197struct NET
198{
199 std::string name;
200 std::vector<NET_PIN> pins;
201};
202
207{
208 std::string name;
209 double clearance = 0.0;
210 double track_width = 0.0;
211 double via_size = 0.0;
212 double via_drill = 0.0;
213 double diff_pair_gap = 0.0;
214 double diff_pair_width = 0.0;
215 std::vector<std::string> net_names;
216};
217
222{
223 std::string name;
224 std::string positive_net;
225 std::string negative_net;
226 double gap = 0.0;
227 double width = 0.0;
228};
229
234{
235 double pad_width = 0.0;
236 double pad_length = 0.0;
237 int pad_flags = 0;
238 double net_width = 0.0;
239 double net_length = 0.0;
240 int net_flags = 0;
241 bool has_pad_teardrop = false;
242 bool has_net_teardrop = false;
243};
244
249{
250 std::string name;
251 bool is_start = false;
252 double x = 0.0;
253 double y = 0.0;
254};
255
263{
264 std::string name;
265 bool via_enabled = false;
266 bool wirebond = false;
267 bool display_silk = false;
268 bool glued = false;
269 double min_length = 0.0;
270 double max_length = 0.0;
271 double length_increment = 0.0;
272 std::string padstack;
273 std::string end_padstack;
274 std::vector<ATTRIBUTE> labels;
275};
276
277struct TRACK
278{
279 int layer = 0;
280 double width = 0.0;
281 std::vector<ARC_POINT> points;
282};
283
285{
286 int layer = 0;
287 std::string shape;
288 double sizeA = 0.0;
289 double sizeB = 0.0;
290 double offsetX = 0.0;
291 double offsetY = 0.0;
292 double rotation = 0.0;
293 double drill = 0.0;
294 bool plated = true;
295 double inner_diameter = 0.0;
296 double corner_radius = 0.0;
297 bool chamfered = false;
298 double finger_offset = 0.0;
299
300 // Slotted drill parameters
301 double slot_orientation = 0.0;
302 double slot_length = 0.0;
303 double slot_offset = 0.0;
304
305 // Thermal pad parameters (for RT/ST shapes)
308 double thermal_spoke_width = 0.0;
310};
311
319
321{
322 std::string name;
323 double drill = 0.0;
324 double size = 0.0;
325 std::vector<PAD_STACK_LAYER> stack;
326 int start_layer = 0;
327 int end_layer = 0;
329 int drill_start = 0;
330 int drill_end = 0;
331 bool has_mask_front = false;
332 bool has_mask_back = false;
333};
334
335struct VIA
336{
337 std::string name; // Via type name
339};
340
350
354enum class THERMAL_TYPE
355{
359};
360
361struct POUR
362{
363 std::string name;
364 std::string net_name;
365 int layer = 0;
366 int priority = 0;
367 double width = 0.0;
368 std::vector<ARC_POINT> points;
369 bool is_cutout = false;
370 std::string owner_pour;
372 double hatch_grid = 0.0;
373 double hatch_width = 0.0;
374
375 // Thermal relief definitions (PADTHERM, VIATHERM)
377 double thermal_spoke_width = 0.0;
379 double thermal_gap = 0.0;
380};
381
383{
384 std::string type;
385 int layer = 0;
386 double width = 0.0;
387 std::vector<ARC_POINT> points;
388 int pinnum = -1;
389 std::string restrictions;
390 bool is_tag_open = false;
391 bool is_tag_close = false;
392};
393
395{
396 int pin_number; // 0 for default
398 std::string name; // e.g. "1", "A1"
399 std::vector<PAD_STACK_LAYER> stack;
400 bool custom_stack = false;
401};
402
403
405{
406 double x;
407 double y;
408 std::string name; // Pin number
409};
410
412{
413 std::string name;
414 std::string units; // M, I, U, etc.
415 std::vector<DECAL_ITEM> items;
416 std::vector<ATTRIBUTE> attributes;
417 std::vector<TERMINAL> terminals;
418 std::map<int, std::vector<PAD_STACK_LAYER>> pad_stacks;
419};
420
424struct SIGPIN
425{
426 std::string pin_number;
427 double width = 0.0;
428 std::string signal_name;
429};
430
446
457
462{
464 std::vector<GATE_PIN> pins;
465};
466
468{
469 std::string name;
470 std::string decal_name;
471 std::map<std::string, int> pin_pad_map;
472 std::map<std::string, std::string> attributes;
473 std::vector<SIGPIN> signal_pins;
474 std::vector<GATE_DEF> gates;
475};
476
477struct ROUTE
478{
479 std::string net_name;
480 std::vector<TRACK> tracks;
481 std::vector<VIA> vias;
482 std::vector<NET_PIN> pins;
483 std::vector<TEARDROP> teardrops;
484 std::vector<JUMPER_MARKER> jumpers;
485};
486
487struct TEXT
488{
489 std::string content;
491 double height = 0.0;
492 double width = 0.0;
493 int layer = 0;
494 double rotation = 0.0;
495 bool mirrored = false;
496 std::string hjust;
497 std::string vjust;
498 int ndim = 0;
499 std::string reuse_instance;
500 std::string font_style;
501 double font_height = 0.0;
502 double font_descent = 0.0;
503 std::string font_face;
504};
505
506struct LINE
507{
508 int layer;
509 double width;
512};
513
525
533{
534 std::string name;
535 int layer = 0;
536 double width = 0.0;
538 bool closed = false;
539 bool filled = false;
540 std::vector<ARC_POINT> points;
541 std::string reuse_instance;
542};
543
550{
551 int layer;
552 double width;
553 bool closed;
554 std::vector<ARC_POINT> points;
555};
556
558{
559 // Base for board outline, etc.
560};
561
569{
570 std::string name;
571 std::string net_name;
572 int layer = 0;
573 double width = 0.0;
574 bool filled = false;
575 bool is_cutout = false;
576 std::vector<ARC_POINT> outline;
577};
578
596
608
613{
614 bool merge = false;
615 std::string name;
616};
617
619{
620 std::string instance_name;
621 std::string part_naming;
622 std::string net_naming;
624 double rotation = 0.0;
625 bool glued = false;
626};
627
632{
633 std::string name;
634 long timestamp = 0;
635 std::string part_naming;
636 std::string net_naming;
637 std::vector<std::string> part_names;
638 std::vector<REUSE_NET> nets;
639 std::vector<REUSE_INSTANCE> instances;
640};
641
646{
647 std::string name;
648 int id = 0;
649 std::vector<std::string> net_names;
650 std::vector<std::string> segment_refs;
651};
652
657{
658 std::string type;
659 double x = 0.0;
660 double y = 0.0;
661 int side = 0;
662 std::string net_name;
663 std::string symbol_name;
664};
665
670{
671 std::string name;
672 double x = 0.0;
673 double y = 0.0;
674 double crossbar_pos = 0.0;
675 bool is_horizontal = true;
676 int layer = 0;
677 std::vector<POINT> points;
678 std::string text;
679 double text_height = 0.0;
680 double text_width = 0.0;
681 double rotation = 0.0;
682};
683
695
700{
702 std::vector<ARC_POINT> outline;
703 std::vector<int> layers;
704 bool no_traces = true;
705 bool no_vias = true;
706 bool no_copper = true;
707 bool no_components = false;
708 bool height_restriction = false;
709 double max_height = 0.0;
710 bool no_test_points = false;
711 bool no_accordion = false;
712};
713
715{
716public:
717 PARSER();
718 ~PARSER();
719
720 void Parse( const wxString& aFileName );
721
722 const PARAMETERS& GetParameters() const { return m_parameters; }
723 const std::vector<PART>& GetParts() const { return m_parts; }
724 const std::vector<NET>& GetNets() const { return m_nets; }
725 const std::vector<ROUTE>& GetRoutes() const { return m_routes; }
726 const std::vector<TEXT>& GetTexts() const { return m_texts; }
727 const std::vector<LINE>& GetLines() const { return m_lines; }
728 const std::vector<POLYLINE>& GetBoardOutlines() const { return m_board_outlines; }
729 const std::vector<POUR>& GetPours() const { return m_pours; }
730 const std::map<std::string, VIA_DEF>& GetViaDefs() const { return m_via_defs; }
731 const std::map<std::string, PART_DECAL>& GetPartDecals() const { return m_decals; }
732 const std::map<std::string, PART_TYPE>& GetPartTypes() const { return m_part_types; }
733 const std::map<std::string, std::map<std::string, std::string>>& GetPartInstanceAttrs() const
734 {
736 }
737 const std::map<std::string, REUSE_BLOCK>& GetReuseBlocks() const { return m_reuse_blocks; }
738 const std::vector<CLUSTER>& GetClusters() const { return m_clusters; }
739 const std::vector<TEST_POINT>& GetTestPoints() const { return m_test_points; }
740 const std::vector<DIMENSION>& GetDimensions() const { return m_dimensions; }
741 const DESIGN_RULES& GetDesignRules() const { return m_design_rules; }
742 const std::vector<NET_CLASS_DEF>& GetNetClasses() const { return m_net_classes; }
743 const std::vector<DIFF_PAIR_DEF>& GetDiffPairs() const { return m_diff_pairs; }
744 const std::vector<KEEPOUT>& GetKeepouts() const { return m_keepouts; }
745 const std::vector<JUMPER_DEF>& GetJumperDefs() const { return m_jumper_defs; }
746 const std::vector<COPPER_SHAPE>& GetCopperShapes() const { return m_copper_shapes; }
747 const std::vector<GRAPHIC_LINE>& GetGraphicLines() const { return m_graphic_lines; }
748 const FILE_HEADER& GetFileHeader() const { return m_file_header; }
749 bool IsBasicUnits() const { return m_is_basic_units; }
750
757 std::vector<LAYER_INFO> GetLayerInfos() const;
758
759private:
760 void parseLine( const std::string& aLine );
761 void parseSectionPCB( std::ifstream& aStream );
762 void parseSectionPARTS( std::ifstream& aStream );
763 void parseSectionNETS( std::ifstream& aStream );
764 void parseSectionROUTES( std::ifstream& aStream );
765 void parseSectionTEXT( std::ifstream& aStream );
766 void parseSectionBOARD( std::ifstream& aStream );
767 void parseSectionLINES( std::ifstream& aStream );
768 void parseSectionVIA( std::ifstream& aStream );
769 void parseSectionPOUR( std::ifstream& aStream );
770 void parseSectionPARTDECAL( std::ifstream& aStream );
771 void parseSectionPARTTYPE( std::ifstream& aStream );
772 void parseSectionREUSE( std::ifstream& aStream );
773 void parseSectionCLUSTER( std::ifstream& aStream );
774 void parseSectionJUMPER( std::ifstream& aStream );
775 void parseSectionTESTPOINT( std::ifstream& aStream );
776 void parseSectionNETCLASS( std::ifstream& aStream );
777 void parseSectionDIFFPAIR( std::ifstream& aStream );
778 void parseSectionLAYERDEFS( std::ifstream& aStream );
779 void parseSectionMISC( std::ifstream& aStream );
781
782 // Helper to read next line skipping comments and empty lines
783 bool readLine( std::ifstream& aStream, std::string& aLine );
784 void pushBackLine( const std::string& aLine );
785
787 std::vector<PART> m_parts;
788 std::vector<NET> m_nets;
789 std::vector<ROUTE> m_routes;
790 std::vector<TEXT> m_texts;
791 std::vector<LINE> m_lines;
792 std::vector<POLYLINE> m_board_outlines;
793 std::vector<POUR> m_pours;
794 std::map<std::string, VIA_DEF> m_via_defs;
795 std::map<std::string, PART_DECAL> m_decals;
796 std::map<std::string, PART_TYPE> m_part_types;
797
799 std::map<std::string, std::map<std::string, std::string>> m_part_instance_attrs;
800 std::map<std::string, REUSE_BLOCK> m_reuse_blocks;
801 std::vector<CLUSTER> m_clusters;
802 std::vector<TEST_POINT> m_test_points;
803 std::vector<DIMENSION> m_dimensions;
805 std::vector<NET_CLASS_DEF> m_net_classes;
806 std::vector<DIFF_PAIR_DEF> m_diff_pairs;
807 std::vector<KEEPOUT> m_keepouts;
808 std::vector<JUMPER_DEF> m_jumper_defs;
809 std::vector<COPPER_SHAPE> m_copper_shapes;
810 std::vector<GRAPHIC_LINE> m_graphic_lines;
811 std::map<int, LAYER_INFO> m_layer_defs;
813 bool m_is_basic_units = false;
814
815 std::string m_current_section;
816 std::optional<std::string> m_pushed_line;
817};
818
819} // namespace PADS_IO
const PARAMETERS & GetParameters() const
const std::vector< TEXT > & GetTexts() const
bool readLine(std::ifstream &aStream, std::string &aLine)
std::map< std::string, PART_DECAL > m_decals
std::vector< CLUSTER > m_clusters
const DESIGN_RULES & GetDesignRules() const
std::map< std::string, REUSE_BLOCK > m_reuse_blocks
const std::map< std::string, std::map< std::string, std::string > > & GetPartInstanceAttrs() const
const std::vector< KEEPOUT > & GetKeepouts() const
std::vector< KEEPOUT > m_keepouts
std::vector< POUR > m_pours
const std::vector< NET_CLASS_DEF > & GetNetClasses() const
std::vector< JUMPER_DEF > m_jumper_defs
Jumper definitions from JUMPER section.
std::vector< TEXT > m_texts
void parseSectionPARTTYPE(std::ifstream &aStream)
void parseSectionJUMPER(std::ifstream &aStream)
const std::map< std::string, PART_TYPE > & GetPartTypes() const
const std::vector< NET > & GetNets() const
void parseSectionTESTPOINT(std::ifstream &aStream)
void parseSectionLINES(std::ifstream &aStream)
PARAMETERS m_parameters
const FILE_HEADER & GetFileHeader() const
std::map< std::string, VIA_DEF > m_via_defs
const std::map< std::string, PART_DECAL > & GetPartDecals() const
const std::vector< LINE > & GetLines() const
void parseSectionBOARD(std::ifstream &aStream)
const std::vector< POUR > & GetPours() const
void parseSectionVIA(std::ifstream &aStream)
std::vector< COPPER_SHAPE > m_copper_shapes
Copper shapes from LINES section.
std::map< std::string, PART_TYPE > m_part_types
Per-instance attribute overrides from PART <name> {...} blocks in PARTTYPE section.
const std::map< std::string, REUSE_BLOCK > & GetReuseBlocks() const
std::vector< NET > m_nets
std::vector< LINE > m_lines
void parseSectionPARTS(std::ifstream &aStream)
const std::vector< COPPER_SHAPE > & GetCopperShapes() const
std::vector< ROUTE > m_routes
const std::vector< DIFF_PAIR_DEF > & GetDiffPairs() const
std::map< std::string, std::map< std::string, std::string > > m_part_instance_attrs
bool IsBasicUnits() const
std::vector< NET_CLASS_DEF > m_net_classes
void parseSectionNETCLASS(std::ifstream &aStream)
void parseSectionMISC(std::ifstream &aStream)
void parseSectionREUSE(std::ifstream &aStream)
void parseSectionCLUSTER(std::ifstream &aStream)
void parseSectionLAYERDEFS(std::ifstream &aStream)
std::vector< LAYER_INFO > GetLayerInfos() const
Get layer information for layer mapping dialog.
const std::vector< ROUTE > & GetRoutes() const
const std::vector< DIMENSION > & GetDimensions() const
DESIGN_RULES m_design_rules
const std::vector< JUMPER_DEF > & GetJumperDefs() const
void parseSectionNETS(std::ifstream &aStream)
const std::map< std::string, VIA_DEF > & GetViaDefs() const
void Parse(const wxString &aFileName)
FILE_HEADER m_file_header
Parsed file header info.
std::vector< GRAPHIC_LINE > m_graphic_lines
2D graphic lines from LINES section
std::vector< DIMENSION > m_dimensions
std::vector< DIFF_PAIR_DEF > m_diff_pairs
std::string m_current_section
void parseSectionPCB(std::ifstream &aStream)
void clampDesignRuleSentinels()
void parseSectionTEXT(std::ifstream &aStream)
std::vector< POLYLINE > m_board_outlines
std::vector< PART > m_parts
const std::vector< GRAPHIC_LINE > & GetGraphicLines() const
std::map< int, LAYER_INFO > m_layer_defs
Parsed layer definitions by layer number.
void parseSectionROUTES(std::ifstream &aStream)
const std::vector< POLYLINE > & GetBoardOutlines() const
std::vector< TEST_POINT > m_test_points
std::optional< std::string > m_pushed_line
const std::vector< CLUSTER > & GetClusters() const
void pushBackLine(const std::string &aLine)
void parseLine(const std::string &aLine)
const std::vector< PART > & GetParts() const
void parseSectionDIFFPAIR(std::ifstream &aStream)
const std::vector< TEST_POINT > & GetTestPoints() const
void parseSectionPOUR(std::ifstream &aStream)
void parseSectionPARTDECAL(std::ifstream &aStream)
THERMAL_TYPE
Thermal relief type for pad/via connections.
@ PAD
Pad thermal relief (PADTHERM)
@ NONE
No thermal relief defined.
@ BURIED
Via spans only inner layers.
@ THROUGH
Via spans all copper layers.
@ BLIND
Via starts at top or bottom and ends at inner layer.
@ MICROVIA
Single-layer blind via (typically HDI)
PIN_ELEC_TYPE
Pin type classification for gate definitions.
@ BIDIRECTIONAL
B - Bidirectional pin.
@ UNDEFINED
U - Undefined.
@ OPEN_COLLECTOR
C - Open collector or or-tieable source.
@ TERMINATOR
Z - Terminator pin.
@ LOAD
L - Load pin.
@ TRISTATE
T - Tri-state pin.
@ POWER
P - Power pin.
@ GROUND
G - Ground pin.
@ SOURCE
S - Source pin.
PADS_FILE_TYPE
File header information from PADS header line.
Definition pads_parser.h:90
@ LIB_PCB_DECAL
Library PCB decals (footprints)
Definition pads_parser.h:94
@ LIB_PART_TYPE
Library part types.
Definition pads_parser.h:95
@ LIB_SCH_DECAL
Library schematic decals.
Definition pads_parser.h:93
@ LIB_LINE
Library line items (drafting)
Definition pads_parser.h:92
@ PCB
PCB design file (POWERPCB, PADS-LAYOUT, etc.)
Definition pads_parser.h:91
LINE_STYLE
Line style enumeration for 2D graphics.
KEEPOUT_TYPE
Keepout types in PADS.
@ PLACEMENT
Component placement keepout.
@ COPPER
Copper pour keepout.
POUR_STYLE
Pour style types from PADS piece types.
@ VOIDOUT
Void/empty region (VOIDOUT)
@ SOLID
Solid filled pour (POUROUT, POLY)
@ HATCHED
Hatched pour (HATOUT)
PADS_LAYER_FUNCTION
Layer types from PADS LAYER_TYPE field.
@ ASSEMBLY
Assembly drawing.
@ ROUTING
Copper routing layer.
@ PASTE_MASK
Solder paste mask.
@ MIXED
Mixed signal/plane.
@ UNASSIGNED
Unassigned layer.
@ DOCUMENTATION
Documentation layer.
@ SILK_SCREEN
Silkscreen/legend.
@ PLANE
Power/ground plane.
ARC arc
Arc parameters (only valid when is_arc is true)
Definition pads_parser.h:76
bool is_arc
True if this segment is an arc, false for line.
Definition pads_parser.h:75
ARC_POINT(double aX, double aY, const ARC &aArc)
Definition pads_parser.h:80
ARC_POINT(double aX, double aY)
Definition pads_parser.h:79
double y
Endpoint Y coordinate.
Definition pads_parser.h:74
double x
Endpoint X coordinate.
Definition pads_parser.h:73
Arc definition using center point, radius, and angles.
Definition pads_parser.h:57
double radius
Arc radius.
Definition pads_parser.h:60
double cx
Center X coordinate.
Definition pads_parser.h:58
double delta_angle
Arc sweep angle in degrees (positive = CCW)
Definition pads_parser.h:62
double start_angle
Start angle in degrees (0 = +X, CCW positive)
Definition pads_parser.h:61
double cy
Center Y coordinate.
Definition pads_parser.h:59
std::string font_info
std::string hjust
std::string vjust
A cluster of related route segments that should be grouped together.
std::vector< std::string > segment_refs
References to route segments in cluster.
std::string name
Cluster name/identifier.
std::vector< std::string > net_names
Nets belonging to this cluster.
A copper shape from the LINES section (type=COPPER).
std::vector< ARC_POINT > outline
Shape outline vertices.
bool is_cutout
True for cutouts (COPCUT, COPCCO)
int layer
Layer number.
std::string net_name
Associated net (empty if unconnected)
bool filled
True for filled shapes (COPCLS, COPCIR)
double width
Line width (for open polylines)
std::string name
Shape name.
std::string restrictions
Keepout restrictions (R,C,V,T,A) for KPTCLS/KPTCIR.
bool is_tag_close
True if this is a closing TAG (level=0)
std::vector< ARC_POINT > points
Shape points, may include arc segments.
int pinnum
Pin association for copper pieces (-1 = none, 0+ = pin index)
std::string type
CLOSED, OPEN, CIRCLE, COPCLS, TAG, etc.
bool is_tag_open
True if this is an opening TAG (level=1)
std::vector< PAD_STACK_LAYER > stack
Design rule definitions from PCB section.
double silk_clearance
Minimum silkscreen clearance (SILKCLEAR)
double default_track_width
Default track width (DEFAULTTRACKWID)
double default_via_drill
Default via drill diameter (DEFAULTVIADRILL)
double min_track_width
Minimum track width (MINTRACKWID)
double min_via_size
Minimum via outer diameter (MINVIASIZE)
double min_via_drill
Minimum via drill diameter (MINVIADRILL)
double min_clearance
Minimum copper clearance (MINCLEAR)
double default_via_size
Default via outer diameter (DEFAULTVIASIZE)
double copper_edge_clearance
Board outline clearance (OUTLINE_TO_*)
double default_clearance
Default copper clearance (DEFAULTCLEAR)
double hole_to_hole
Minimum hole-to-hole spacing (HOLEHOLE)
double mask_clearance
Solder mask clearance (MASKCLEAR)
Differential pair definition.
double width
Trace width.
std::string positive_net
Positive net name.
std::string negative_net
Negative net name.
double gap
Spacing between traces.
std::string name
Pair name.
A dimension annotation for measurement display.
std::string name
Dimension identifier.
double text_width
Text width.
double y
Origin Y coordinate.
double rotation
Text rotation angle.
bool is_horizontal
True for horizontal dimension.
double x
Origin X coordinate.
std::string text
Dimension text/value.
int layer
Layer for dimension graphics.
double crossbar_pos
Crossbar position (Y for horizontal, X for vertical)
double text_height
Text height.
std::vector< POINT > points
Dimension geometry points (measurement endpoints)
std::string mode
Optional mode like 250L.
std::string version
Version string like V9.4, V9.
std::string encoding
Optional encoding like CP1252.
std::string product
Product name: POWERPCB, PADS, LAYOUT, PADS-LIBRARY-*.
PADS_FILE_TYPE file_type
Type of PADS file.
std::string units
Units: MILS, MM, INCH, BASIC.
Gate definition for gate-swappable parts.
int gate_swap_type
Gate swap type (0 = not swappable)
std::vector< GATE_PIN > pins
Pins in this gate.
Pin definition within a gate.
std::string func_name
Optional functional name.
int swap_type
Swap type (0 = not swappable)
std::string pin_number
Electrical pin number.
PIN_ELEC_TYPE elec_type
A 2D graphic line/shape from the LINES section (type=LINES).
std::vector< ARC_POINT > points
Shape vertices, may include arcs.
bool closed
True if shape is closed (polygon/circle)
std::string name
Item name.
double width
Line width.
std::string reuse_instance
Reuse block instance name (if member of reuse)
int layer
Layer number.
bool filled
True if shape should be filled.
LINE_STYLE style
Line style (solid, dashed, etc.)
Jumper definition from JUMPER section.
std::string padstack
Pad stack for start pin (or both if end_padstack empty)
bool wirebond
W flag: wirebond jumper.
double min_length
Minimum possible length.
std::string end_padstack
Pad stack for end pin (optional)
bool glued
G flag: glued.
std::string name
Jumper name/reference designator.
bool display_silk
D flag: display special silk.
std::vector< ATTRIBUTE > labels
Reference designator labels.
double length_increment
Length increment.
double max_length
Maximum possible length.
bool via_enabled
V flag: via enabled.
Jumper endpoint marker in a route.
bool is_start
True if start (S), false if end (E)
std::string name
Jumper part name.
A keepout area definition.
std::vector< ARC_POINT > outline
Keepout boundary.
bool no_vias
Prohibit vias (V restriction)
bool no_components
Prohibit component placement (P restriction)
double max_height
Maximum component height when height_restriction is true.
bool no_copper
Prohibit copper pours (C restriction)
bool no_accordion
Prohibit accordion flex (A restriction for accordion, not all)
bool height_restriction
Component height restriction (H restriction)
KEEPOUT_TYPE type
Type of keepout.
bool no_traces
Prohibit traces (R restriction)
std::vector< int > layers
Affected layers (empty = all)
bool no_test_points
Prohibit test points (T restriction)
PADS_LAYER_FUNCTION layer_type
Parsed layer type from file.
bool required
True if layer must be mapped.
bool is_copper
True if copper layer.
int number
PADS layer number.
double layer_thickness
Dielectric thickness (BASIC units)
std::string name
Layer name.
double dielectric_constant
Relative permittivity (Er)
double copper_thickness
Copper foil thickness (BASIC units)
Net class definition with routing constraints.
double via_drill
Via drill diameter (VIADRILL)
double clearance
Copper clearance (CLEARANCE)
std::vector< std::string > net_names
Nets assigned to this class.
double track_width
Track width (TRACKWIDTH)
std::string name
Net class name.
double diff_pair_width
Differential pair width (DIFFPAIRWIDTH)
double diff_pair_gap
Differential pair gap (DIFFPAIRGAP)
double via_size
Via diameter (VIASIZE)
std::string pin_name
std::string reuse_instance
Reuse block instance name (if .REUSE. suffix)
std::string ref_des
std::string reuse_signal
Reuse block signal name (if .REUSE. suffix)
std::string name
std::vector< NET_PIN > pins
bool chamfered
True if corners are chamfered (negative corner in PADS)
double drill
Drill hole diameter (0 for SMD)
int thermal_spoke_count
Number of thermal spokes (typically 4)
double offsetX
Pad offset X from terminal position.
std::string shape
Shape code: R, S, A, O, OF, RF, RT, ST, RA, SA, RC, OC.
bool plated
True if drill is plated (PTH vs NPTH)
double rotation
Pad rotation angle in degrees.
double thermal_outer_diameter
Outer diameter of thermal or void in plane.
double slot_orientation
Slot orientation in degrees (0-179.999)
double thermal_spoke_orientation
First spoke orientation in degrees.
double slot_length
Slot length.
double inner_diameter
Inner diameter for annular ring (0 = solid)
double thermal_spoke_width
Width of thermal spokes.
double offsetY
Pad offset Y from terminal position.
double finger_offset
Finger pad offset along orientation axis.
double sizeB
Secondary size (height for rectangles/ovals)
double slot_offset
Slot offset from electrical center.
double corner_radius
Corner radius magnitude (always positive)
double sizeA
Primary size (diameter or width)
double drill_oversize
Drill oversize for plated holes (DRLOVERSIZE)
double thermal_line_width
Thermal line width for THT (THERLINEWID)
double thermal_smd_width
Thermal line width for SMD (THERSMDWID)
double user_grid
User-defined snap grid (USERGRID)
double thermal_min_clearance
Starved thermal minimum clearance (STMINCLEAR)
int thermal_flags
Thermal relief flags (THERFLAGS)
std::string default_signal_via
Default signal routing via (VIAPSHVIA)
int thermal_min_spokes
Starved thermal minimum spokes (STMINSPOKES)
std::vector< DECAL_ITEM > items
std::vector< TERMINAL > terminals
std::vector< ATTRIBUTE > attributes
std::map< int, std::vector< PAD_STACK_LAYER > > pad_stacks
std::map< std::string, std::string > attributes
Attribute name-value pairs from {...} block.
std::map< std::string, int > pin_pad_map
Maps pin name to pad stack index.
std::vector< GATE_DEF > gates
Gate definitions for swap support.
std::vector< SIGPIN > signal_pins
Standard signal pin definitions.
std::string decal_name
std::string part_type
Part type name when using PARTTYPE@DECAL syntax.
bool explicit_decal
True if decal was explicitly specified with @ syntax.
std::string reuse_instance
Reuse block instance name (if member of reuse)
std::string value
std::string decal
Primary decal (first in colon-separated list)
std::string name
int alt_decal_index
ALT field from placement (-1 = use primary decal)
std::vector< ATTRIBUTE > attributes
std::string reuse_part
Original part ref des inside the reuse block.
std::string units
std::vector< std::string > alternate_decals
Alternate decals (remaining after ':' splits)
A polyline that may contain arc segments.
bool closed
True if polyline forms a closed shape.
std::vector< ARC_POINT > points
Polyline vertices, may include arcs.
int thermal_spoke_count
Number of spokes (typically 4)
std::string name
This pour record's name.
bool is_cutout
True if this is a cutout (POCUT) piece.
POUR_STYLE style
Pour fill style.
std::string net_name
std::string owner_pour
Name of parent pour (7th field in header)
double thermal_spoke_width
Spoke width for thermal relief.
double hatch_grid
Hatch grid spacing for hatched pours.
std::vector< ARC_POINT > points
Pour outline, may include arc segments.
THERMAL_TYPE thermal_type
double thermal_gap
Gap between pad and pour.
double hatch_width
Hatch line width.
A reuse block definition containing parts and routes that can be instantiated.
std::vector< REUSE_NET > nets
Nets contained in this block with merge flags.
std::string net_naming
Default net naming scheme.
long timestamp
Creation/modification timestamp.
std::string part_naming
Default part naming scheme.
std::vector< std::string > part_names
Parts contained in this block.
std::vector< REUSE_INSTANCE > instances
Placements of this block.
std::string name
Block type name.
std::string instance_name
Instance name.
std::string part_naming
Part naming scheme (may be multi-word like "PREFIX pref")
std::string net_naming
Net naming scheme (may be multi-word like "SUFFIX suf")
bool glued
True if glued in place.
POINT location
Placement location.
double rotation
Rotation angle in degrees.
A reuse block instance placement.
std::string name
Original net name from reuse definition.
bool merge
True to merge nets, false to rename.
std::vector< VIA > vias
std::vector< TEARDROP > teardrops
Teardrop locations in this route.
std::vector< TRACK > tracks
std::vector< NET_PIN > pins
Pins connected to this net (from pin pair lines)
std::vector< JUMPER_MARKER > jumpers
Jumper start/end points in this route.
std::string net_name
Standard signal pin definition (power, ground, etc.)
std::string pin_number
Pin number.
double width
Track width for connections.
std::string signal_name
Standard signal name (e.g., VCC, GND)
Teardrop parameters for a route point.
int net_flags
Net-side teardrop flags.
double pad_width
Teardrop width at pad side.
int pad_flags
Pad-side teardrop flags.
double net_width
Teardrop width at net side.
double pad_length
Teardrop length toward pad.
double net_length
Teardrop length toward net.
std::string name
A test point definition for manufacturing/testing access.
std::string type
VIA or PIN.
std::string net_name
Net this test point connects to.
int side
Probe side (0=through, 1=top, 2=bottom)
std::string symbol_name
Symbol/pad name for the test point.
double x
X coordinate.
double y
Y coordinate.
std::string font_face
Font face name.
std::string vjust
Vertical justification: UP, CENTER, DOWN.
std::string content
std::string reuse_instance
Reuse block instance name (if .REUSE. suffix)
int ndim
Dimension number for auto-dimensioning text (0 if not used)
std::string hjust
Horizontal justification: LEFT, CENTER, RIGHT.
double font_descent
Font descent for text box calculation (optional)
double font_height
Font height for text box calculation (optional)
std::string font_style
Font style (Regular, Bold, Italic, Underline, or combinations)
std::vector< ARC_POINT > points
Track points, may include arc segments.
bool has_mask_front
Stack includes top soldermask opening (layer 25)
int drill_start
Drill start layer from file (for blind/buried vias)
int start_layer
First PADS layer number in via span.
int end_layer
Last PADS layer number in via span.
std::vector< PAD_STACK_LAYER > stack
int drill_end
Drill end layer from file (for blind/buried vias)
VIA_TYPE via_type
Classified via type.
std::string name
bool has_mask_back
Stack includes bottom soldermask opening (layer 28)
std::string name