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, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <string>
23#include <vector>
24#include <map>
25#include <optional>
26#include <wx/string.h>
27#include <wx/gdicmn.h> // For wxPoint if needed, or use VECTOR2I
28#include <math/vector2d.h>
29
30namespace PADS_IO
31{
32
33enum class UNIT_TYPE
34{
38};
39
40struct POINT
41{
42 double x;
43 double y;
44};
45
52struct ARC
53{
54 double cx;
55 double cy;
56 double radius;
57 double start_angle;
58 double delta_angle;
59};
60
68{
69 double x;
70 double y;
71 bool is_arc;
73
74 ARC_POINT() : x( 0 ), y( 0 ), is_arc( false ), arc{ 0, 0, 0, 0, 0 } {}
75 ARC_POINT( double aX, double aY ) : x( aX ), y( aY ), is_arc( false ), arc{ 0, 0, 0, 0, 0 } {}
76 ARC_POINT( double aX, double aY, const ARC& aArc ) : x( aX ), y( aY ), is_arc( true ), arc( aArc ) {}
77};
78
93
95{
96 std::string product;
97 std::string version;
98 std::string units;
99 std::string mode;
100 std::string encoding;
102};
103
105{
107 int layer_count = 2;
108 POINT origin = {0, 0};
109 double user_grid = 0.0;
110
111 // Thermal relief settings (global defaults)
112 double thermal_line_width = 30.0;
113 double thermal_smd_width = 20.0;
117
118 // Drill parameters
119 double drill_oversize = 0.0;
120
121 // Via defaults extracted from file
122 std::string default_signal_via;
123};
124
129{
130 double min_clearance = 8.0;
131 double default_clearance = 10.0;
132 double min_track_width = 6.0;
133 double default_track_width = 10.0;
134 double min_via_size = 20.0;
135 double default_via_size = 40.0;
136 double min_via_drill = 10.0;
137 double default_via_drill = 20.0;
138 double hole_to_hole = 10.0;
139 double silk_clearance = 5.0;
140 double mask_clearance = 3.0;
141 double copper_edge_clearance = 10.0;
142};
143
145{
146 // Line 1
147 bool visible = true;
148 double x = 0.0;
149 double y = 0.0;
150 double orientation = 0.0;
151 int level = 0;
152 double height = 0.0;
153 double width = 0.0;
154 bool mirrored = false;
155 std::string hjust;
156 std::string vjust;
157 bool right_reading = false;
158
159 // Line 2
160 std::string font_info;
161
162 // Line 3
163 std::string name; // "Ref.Des.", "Part Type", "VALUE", etc.
164};
165
166struct PART
167{
168 std::string name;
169 std::string decal;
170 std::string part_type;
171 std::vector<std::string> alternate_decals;
173 std::string value;
174 std::string units;
176 double rotation = 0.0;
177 bool bottom_layer = false;
178 bool glued = false;
179 bool explicit_decal = false;
180 std::vector<ATTRIBUTE> attributes;
181 std::string reuse_instance;
182 std::string reuse_part;
183};
184
186{
187 std::string ref_des;
188 std::string pin_name;
189 std::string reuse_instance;
190 std::string reuse_signal;
191};
192
193struct NET
194{
195 std::string name;
196 std::vector<NET_PIN> pins;
197};
198
203{
204 std::string name;
205 double clearance = 0.0;
206 double track_width = 0.0;
207 double via_size = 0.0;
208 double via_drill = 0.0;
209 double diff_pair_gap = 0.0;
210 double diff_pair_width = 0.0;
211 std::vector<std::string> net_names;
212};
213
218{
219 std::string name;
220 std::string positive_net;
221 std::string negative_net;
222 double gap = 0.0;
223 double width = 0.0;
224};
225
230{
231 double pad_width = 0.0;
232 double pad_length = 0.0;
233 int pad_flags = 0;
234 double net_width = 0.0;
235 double net_length = 0.0;
236 int net_flags = 0;
237 bool has_pad_teardrop = false;
238 bool has_net_teardrop = false;
239};
240
245{
246 std::string name;
247 bool is_start = false;
248 double x = 0.0;
249 double y = 0.0;
250};
251
259{
260 std::string name;
261 bool via_enabled = false;
262 bool wirebond = false;
263 bool display_silk = false;
264 bool glued = false;
265 double min_length = 0.0;
266 double max_length = 0.0;
267 double length_increment = 0.0;
268 std::string padstack;
269 std::string end_padstack;
270 std::vector<ATTRIBUTE> labels;
271};
272
273struct TRACK
274{
275 int layer = 0;
276 double width = 0.0;
277 std::vector<ARC_POINT> points;
278};
279
281{
282 int layer = 0;
283 std::string shape;
284 double sizeA = 0.0;
285 double sizeB = 0.0;
286 double offsetX = 0.0;
287 double offsetY = 0.0;
288 double rotation = 0.0;
289 double drill = 0.0;
290 bool plated = true;
291 double inner_diameter = 0.0;
292 double corner_radius = 0.0;
293 bool chamfered = false;
294 double finger_offset = 0.0;
295
296 // Slotted drill parameters
297 double slot_orientation = 0.0;
298 double slot_length = 0.0;
299 double slot_offset = 0.0;
300
301 // Thermal pad parameters (for RT/ST shapes)
304 double thermal_spoke_width = 0.0;
306};
307
315
317{
318 std::string name;
319 double drill = 0.0;
320 double size = 0.0;
321 std::vector<PAD_STACK_LAYER> stack;
322 int start_layer = 0;
323 int end_layer = 0;
325 int drill_start = 0;
326 int drill_end = 0;
327 bool has_mask_front = false;
328 bool has_mask_back = false;
329};
330
331struct VIA
332{
333 std::string name; // Via type name
335};
336
346
350enum class THERMAL_TYPE
351{
355};
356
357struct POUR
358{
359 std::string name;
360 std::string net_name;
361 int layer = 0;
362 int priority = 0;
363 double width = 0.0;
364 std::vector<ARC_POINT> points;
365 bool is_cutout = false;
366 std::string owner_pour;
368 double hatch_grid = 0.0;
369 double hatch_width = 0.0;
370
371 // Thermal relief definitions (PADTHERM, VIATHERM)
373 double thermal_spoke_width = 0.0;
375 double thermal_gap = 0.0;
376};
377
379{
380 std::string type;
381 int layer = 0;
382 double width = 0.0;
383 std::vector<ARC_POINT> points;
384 int pinnum = -1;
385 std::string restrictions;
386 bool is_tag_open = false;
387 bool is_tag_close = false;
388};
389
391{
392 int pin_number; // 0 for default
394 std::string name; // e.g. "1", "A1"
395 std::vector<PAD_STACK_LAYER> stack;
396 bool custom_stack = false;
397};
398
399
401{
402 double x;
403 double y;
404 std::string name; // Pin number
405};
406
408{
409 std::string name;
410 std::string units; // M, I, U, etc.
411 std::vector<DECAL_ITEM> items;
412 std::vector<ATTRIBUTE> attributes;
413 std::vector<TERMINAL> terminals;
414 std::map<int, std::vector<PAD_STACK_LAYER>> pad_stacks;
415};
416
420struct SIGPIN
421{
422 std::string pin_number;
423 double width = 0.0;
424 std::string signal_name;
425};
426
442
453
458{
460 std::vector<GATE_PIN> pins;
461};
462
464{
465 std::string name;
466 std::string decal_name;
467 std::map<std::string, int> pin_pad_map;
468 std::map<std::string, std::string> attributes;
469 std::vector<SIGPIN> signal_pins;
470 std::vector<GATE_DEF> gates;
471};
472
473struct ROUTE
474{
475 std::string net_name;
476 std::vector<TRACK> tracks;
477 std::vector<VIA> vias;
478 std::vector<NET_PIN> pins;
479 std::vector<TEARDROP> teardrops;
480 std::vector<JUMPER_MARKER> jumpers;
481};
482
483struct TEXT
484{
485 std::string content;
487 double height = 0.0;
488 double width = 0.0;
489 int layer = 0;
490 double rotation = 0.0;
491 bool mirrored = false;
492 std::string hjust;
493 std::string vjust;
494 int ndim = 0;
495 std::string reuse_instance;
496 std::string font_style;
497 double font_height = 0.0;
498 double font_descent = 0.0;
499 std::string font_face;
500};
501
502struct LINE
503{
504 int layer;
505 double width;
508};
509
521
529{
530 std::string name;
531 int layer = 0;
532 double width = 0.0;
534 bool closed = false;
535 bool filled = false;
536 std::vector<ARC_POINT> points;
537 std::string reuse_instance;
538};
539
546{
547 int layer;
548 double width;
549 bool closed;
550 std::vector<ARC_POINT> points;
551};
552
554{
555 // Base for board outline, etc.
556};
557
565{
566 std::string name;
567 std::string net_name;
568 int layer = 0;
569 double width = 0.0;
570 bool filled = false;
571 bool is_cutout = false;
572 std::vector<ARC_POINT> outline;
573};
574
592
604
609{
610 bool merge = false;
611 std::string name;
612};
613
615{
616 std::string instance_name;
617 std::string part_naming;
618 std::string net_naming;
620 double rotation = 0.0;
621 bool glued = false;
622};
623
628{
629 std::string name;
630 long timestamp = 0;
631 std::string part_naming;
632 std::string net_naming;
633 std::vector<std::string> part_names;
634 std::vector<REUSE_NET> nets;
635 std::vector<REUSE_INSTANCE> instances;
636};
637
642{
643 std::string name;
644 int id = 0;
645 std::vector<std::string> net_names;
646 std::vector<std::string> segment_refs;
647};
648
653{
654 std::string type;
655 double x = 0.0;
656 double y = 0.0;
657 int side = 0;
658 std::string net_name;
659 std::string symbol_name;
660};
661
666{
667 std::string name;
668 double x = 0.0;
669 double y = 0.0;
670 double crossbar_pos = 0.0;
671 bool is_horizontal = true;
672 int layer = 0;
673 std::vector<POINT> points;
674 std::string text;
675 double text_height = 0.0;
676 double text_width = 0.0;
677 double rotation = 0.0;
678};
679
691
696{
698 std::vector<ARC_POINT> outline;
699 std::vector<int> layers;
700 bool no_traces = true;
701 bool no_vias = true;
702 bool no_copper = true;
703 bool no_components = false;
704 bool height_restriction = false;
705 double max_height = 0.0;
706 bool no_test_points = false;
707 bool no_accordion = false;
708};
709
711{
712public:
713 PARSER();
714 ~PARSER();
715
716 void Parse( const wxString& aFileName );
717
718 const PARAMETERS& GetParameters() const { return m_parameters; }
719 const std::vector<PART>& GetParts() const { return m_parts; }
720 const std::vector<NET>& GetNets() const { return m_nets; }
721 const std::vector<ROUTE>& GetRoutes() const { return m_routes; }
722 const std::vector<TEXT>& GetTexts() const { return m_texts; }
723 const std::vector<LINE>& GetLines() const { return m_lines; }
724 const std::vector<POLYLINE>& GetBoardOutlines() const { return m_board_outlines; }
725 const std::vector<POUR>& GetPours() const { return m_pours; }
726 const std::map<std::string, VIA_DEF>& GetViaDefs() const { return m_via_defs; }
727 const std::map<std::string, PART_DECAL>& GetPartDecals() const { return m_decals; }
728 const std::map<std::string, PART_TYPE>& GetPartTypes() const { return m_part_types; }
729 const std::map<std::string, std::map<std::string, std::string>>& GetPartInstanceAttrs() const
730 {
732 }
733 const std::map<std::string, REUSE_BLOCK>& GetReuseBlocks() const { return m_reuse_blocks; }
734 const std::vector<CLUSTER>& GetClusters() const { return m_clusters; }
735 const std::vector<TEST_POINT>& GetTestPoints() const { return m_test_points; }
736 const std::vector<DIMENSION>& GetDimensions() const { return m_dimensions; }
737 const DESIGN_RULES& GetDesignRules() const { return m_design_rules; }
738 const std::vector<NET_CLASS_DEF>& GetNetClasses() const { return m_net_classes; }
739 const std::vector<DIFF_PAIR_DEF>& GetDiffPairs() const { return m_diff_pairs; }
740 const std::vector<KEEPOUT>& GetKeepouts() const { return m_keepouts; }
741 const std::vector<JUMPER_DEF>& GetJumperDefs() const { return m_jumper_defs; }
742 const std::vector<COPPER_SHAPE>& GetCopperShapes() const { return m_copper_shapes; }
743 const std::vector<GRAPHIC_LINE>& GetGraphicLines() const { return m_graphic_lines; }
744 const FILE_HEADER& GetFileHeader() const { return m_file_header; }
745 bool IsBasicUnits() const { return m_is_basic_units; }
746
753 std::vector<LAYER_INFO> GetLayerInfos() const;
754
755private:
756 void parseLine( const std::string& aLine );
757 void parseSectionPCB( std::ifstream& aStream );
758 void parseSectionPARTS( std::ifstream& aStream );
759 void parseSectionNETS( std::ifstream& aStream );
760 void parseSectionROUTES( std::ifstream& aStream );
761 void parseSectionTEXT( std::ifstream& aStream );
762 void parseSectionBOARD( std::ifstream& aStream );
763 void parseSectionLINES( std::ifstream& aStream );
764 void parseSectionVIA( std::ifstream& aStream );
765 void parseSectionPOUR( std::ifstream& aStream );
766 void parseSectionPARTDECAL( std::ifstream& aStream );
767 void parseSectionPARTTYPE( std::ifstream& aStream );
768 void parseSectionREUSE( std::ifstream& aStream );
769 void parseSectionCLUSTER( std::ifstream& aStream );
770 void parseSectionJUMPER( std::ifstream& aStream );
771 void parseSectionTESTPOINT( std::ifstream& aStream );
772 void parseSectionNETCLASS( std::ifstream& aStream );
773 void parseSectionDIFFPAIR( std::ifstream& aStream );
774 void parseSectionLAYERDEFS( std::ifstream& aStream );
775 void parseSectionMISC( std::ifstream& aStream );
777
778 // Helper to read next line skipping comments and empty lines
779 bool readLine( std::ifstream& aStream, std::string& aLine );
780 void pushBackLine( const std::string& aLine );
781
783 std::vector<PART> m_parts;
784 std::vector<NET> m_nets;
785 std::vector<ROUTE> m_routes;
786 std::vector<TEXT> m_texts;
787 std::vector<LINE> m_lines;
788 std::vector<POLYLINE> m_board_outlines;
789 std::vector<POUR> m_pours;
790 std::map<std::string, VIA_DEF> m_via_defs;
791 std::map<std::string, PART_DECAL> m_decals;
792 std::map<std::string, PART_TYPE> m_part_types;
793
795 std::map<std::string, std::map<std::string, std::string>> m_part_instance_attrs;
796 std::map<std::string, REUSE_BLOCK> m_reuse_blocks;
797 std::vector<CLUSTER> m_clusters;
798 std::vector<TEST_POINT> m_test_points;
799 std::vector<DIMENSION> m_dimensions;
801 std::vector<NET_CLASS_DEF> m_net_classes;
802 std::vector<DIFF_PAIR_DEF> m_diff_pairs;
803 std::vector<KEEPOUT> m_keepouts;
804 std::vector<JUMPER_DEF> m_jumper_defs;
805 std::vector<COPPER_SHAPE> m_copper_shapes;
806 std::vector<GRAPHIC_LINE> m_graphic_lines;
807 std::map<int, LAYER_INFO> m_layer_defs;
809 bool m_is_basic_units = false;
810
811 std::string m_current_section;
812 std::optional<std::string> m_pushed_line;
813};
814
815} // 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:86
@ LIB_PCB_DECAL
Library PCB decals (footprints)
Definition pads_parser.h:90
@ LIB_PART_TYPE
Library part types.
Definition pads_parser.h:91
@ LIB_SCH_DECAL
Library schematic decals.
Definition pads_parser.h:89
@ LIB_LINE
Library line items (drafting)
Definition pads_parser.h:88
@ PCB
PCB design file (POWERPCB, PADS-LAYOUT, etc.)
Definition pads_parser.h:87
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:72
bool is_arc
True if this segment is an arc, false for line.
Definition pads_parser.h:71
ARC_POINT(double aX, double aY, const ARC &aArc)
Definition pads_parser.h:76
ARC_POINT(double aX, double aY)
Definition pads_parser.h:75
double y
Endpoint Y coordinate.
Definition pads_parser.h:70
double x
Endpoint X coordinate.
Definition pads_parser.h:69
Arc definition using center point, radius, and angles.
Definition pads_parser.h:53
double radius
Arc radius.
Definition pads_parser.h:56
double cx
Center X coordinate.
Definition pads_parser.h:54
double delta_angle
Arc sweep angle in degrees (positive = CCW)
Definition pads_parser.h:58
double start_angle
Start angle in degrees (0 = +X, CCW positive)
Definition pads_parser.h:57
double cy
Center Y coordinate.
Definition pads_parser.h:55
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.
Definition pads_parser.h:99
std::string version
Version string like V9.4, V9.
Definition pads_parser.h:97
std::string encoding
Optional encoding like CP1252.
std::string product
Product name: POWERPCB, PADS, LAYOUT, PADS-LIBRARY-*.
Definition pads_parser.h:96
PADS_FILE_TYPE file_type
Type of PADS file.
std::string units
Units: MILS, MM, INCH, BASIC.
Definition pads_parser.h:98
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