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>
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
49struct ARC
50{
51 double cx;
52 double cy;
53 double radius;
56};
57
64{
65 double x;
66 double y;
67 bool is_arc;
69
71 x( 0 ),
72 y( 0 ),
73 is_arc( false ),
74 arc{ 0, 0, 0, 0, 0 }
75 {
76 }
77 ARC_POINT( double aX, double aY ) :
78 x( aX ),
79 y( aY ),
80 is_arc( false ),
81 arc{ 0, 0, 0, 0, 0 }
82 {
83 }
84 ARC_POINT( double aX, double aY, const ARC& aArc ) :
85 x( aX ),
86 y( aY ),
87 is_arc( true ),
88 arc( aArc )
89 {
90 }
91};
92
101
103{
104 std::string product;
105 std::string version;
106 std::string units;
107 std::string mode;
108 std::string encoding;
110};
111
113{
115 int layer_count = 2;
116 POINT origin = {0, 0};
117 double user_grid = 0.0;
118
119 double thermal_line_width = 30.0;
120 double thermal_smd_width = 20.0;
124
125 double drill_oversize = 0.0;
126
127 std::string default_signal_via;
128};
129
131{
132 double min_clearance = 8.0;
133 double default_clearance = 10.0;
134 double min_track_width = 6.0;
135 double default_track_width = 10.0;
136 double min_via_size = 20.0;
137 double default_via_size = 40.0;
138 double min_via_drill = 10.0;
139 double default_via_drill = 20.0;
140 double hole_to_hole = 10.0;
141 double silk_clearance = 5.0;
142 double mask_clearance = 3.0;
143 double copper_edge_clearance = 10.0;
144};
145
147{
148 // Line 1
149 bool visible = true;
150 double x = 0.0;
151 double y = 0.0;
152 double orientation = 0.0;
153 int level = 0;
154 double height = 0.0;
155 double width = 0.0;
156 bool mirrored = false;
157 std::string hjust;
158 std::string vjust;
159 bool right_reading = false;
160
161 // Line 2
162 std::string font_info;
163
164 // Line 3
165 std::string name; // "Ref.Des.", "Part Type", "VALUE", etc.
166};
167
168struct PART
169{
170 std::string name;
171 std::string decal;
172 std::string part_type;
173 std::vector<std::string> alternate_decals;
175 std::string value;
176 std::string units;
178 double rotation = 0.0;
179 bool bottom_layer = false;
180 bool glued = false;
181 bool explicit_decal = false;
182 std::vector<ATTRIBUTE> attributes;
183 std::string reuse_instance;
184 std::string reuse_part;
185};
186
188{
189 std::string ref_des;
190 std::string pin_name;
191 std::string reuse_instance;
192 std::string reuse_signal;
193};
194
195struct NET
196{
197 std::string name;
198 std::vector<NET_PIN> pins;
199 std::vector<std::string> component_refs;
200};
201
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
215{
216 std::string name;
217 std::string positive_net;
218 std::string negative_net;
219 double gap = 0.0;
220 double width = 0.0;
221};
222
224{
225 double pad_width = 0.0;
226 double pad_length = 0.0;
227 int pad_flags = 0;
228 double net_width = 0.0;
229 double net_length = 0.0;
230 int net_flags = 0;
231 bool has_pad_teardrop = false;
232 bool has_net_teardrop = false;
233};
234
236{
237 std::string name;
238 bool is_start = false;
239 double x = 0.0;
240 double y = 0.0;
241};
242
244{
245 std::string name;
246 bool via_enabled = false;
247 bool wirebond = false;
248 bool display_silk = false;
249 bool glued = false;
250 double min_length = 0.0;
251 double max_length = 0.0;
252 double length_increment = 0.0;
253 std::string padstack;
254 std::string end_padstack;
255 std::vector<ATTRIBUTE> labels;
256};
257
258struct TRACK
259{
260 int layer = 0;
261 double width = 0.0;
262 std::vector<ARC_POINT> points;
263};
264
266{
267 int layer = 0;
268 std::string shape;
269 double sizeA = 0.0;
270 double sizeB = 0.0;
271 double offsetX = 0.0;
272 double offsetY = 0.0;
273 double rotation = 0.0;
274 double drill = 0.0;
275 bool plated = true;
276 double inner_diameter = 0.0;
277 double corner_radius = 0.0;
278 bool chamfered = false;
279 double finger_offset = 0.0;
280
281 double slot_orientation = 0.0;
282 double slot_length = 0.0;
283 double slot_offset = 0.0;
284
285 // RT/ST shapes
290};
291
295bool IsThermalReliefPadRow( const PAD_STACK_LAYER& aLayer );
296
300bool IsAntiPadRow( const PAD_STACK_LAYER& aLayer );
301
306bool IsCopperPadRow( const PAD_STACK_LAYER& aLayer );
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;
335 std::vector<PAD_STACK_LAYER> stack;
336 int start_layer = 0;
337 int end_layer = 0;
338};
339
346
347enum class THERMAL_TYPE
348{
352};
353
354struct POUR
355{
356 std::string name;
357 std::string net_name;
358 int layer = 0;
359 int priority = 0;
360 double width = 0.0;
361 std::vector<ARC_POINT> points;
362 bool is_cutout = false;
363 std::string owner_pour;
365 double hatch_grid = 0.0;
366 double hatch_width = 0.0;
367
371 double thermal_gap = 0.0;
372};
373
375{
376 std::string type;
377 int layer = 0;
378 double width = 0.0;
379 std::vector<ARC_POINT> points;
380 int pinnum = -1;
381 std::string restrictions;
382 bool is_tag_open = false;
383 bool is_tag_close = false;
384};
385
387{
388 int pin_number; // 0 for default
390 std::string name; // e.g. "1", "A1"
391 std::vector<PAD_STACK_LAYER> stack;
392 bool custom_stack = false;
393};
394
395
397{
398 double x;
399 double y;
400 std::string name; // Pin number
401};
402
404{
405 std::string name;
406 std::string units; // M, I, U, etc.
407 std::vector<DECAL_ITEM> items;
408 std::vector<ATTRIBUTE> attributes;
409 std::vector<TERMINAL> terminals;
410 std::map<int, std::vector<PAD_STACK_LAYER>> pad_stacks;
411 std::map<int, std::pair<int, int>> drill_spans;
412};
413
414struct SIGPIN
415{
416 std::string pin_number;
417 double width = 0.0;
418 std::string signal_name;
419};
420
433
441
443{
445 std::vector<GATE_PIN> pins;
446};
447
449{
450 std::string name;
451 std::string decal_name;
452 std::map<std::string, int> pin_pad_map;
453 std::map<std::string, std::string> attributes;
454 std::vector<SIGPIN> signal_pins;
455 std::vector<GATE_DEF> gates;
456};
457
458struct ROUTE
459{
460 std::string net_name;
461 std::vector<TRACK> tracks;
462 std::vector<VIA> vias;
463 std::vector<NET_PIN> pins;
464 std::vector<TEARDROP> teardrops;
465 std::vector<JUMPER_MARKER> jumpers;
466};
467
468struct TEXT
469{
470 std::string content;
472 double height = 0.0;
473 double width = 0.0;
474 int layer = 0;
475 double rotation = 0.0;
476 bool mirrored = false;
477 std::string hjust;
478 std::string vjust;
479 int ndim = 0;
480 std::string reuse_instance;
481 std::string font_style;
482 double font_height = 0.0;
483 double font_descent = 0.0;
484 std::string font_face;
485};
486
487struct LINE
488{
489 int layer;
490 double width;
493};
494
503
508{
509 std::string name;
510 int layer = 0;
511 double width = 0.0;
513 bool closed = false;
514 bool filled = false;
515 std::vector<ARC_POINT> points;
516 std::string reuse_instance;
517};
518
523{
524 int layer;
525 double width;
526 bool closed;
527 std::vector<ARC_POINT> points;
528};
529
531{
532 // Base for board outline, etc.
533};
534
539{
540 std::string name;
541 std::string net_name;
542 int layer = 0;
543 double width = 0.0;
544 bool filled = false;
545 bool is_cutout = false;
546 std::vector<ARC_POINT> outline;
547};
548
563
576
578{
579 bool merge = false;
580 std::string name;
581};
582
584{
585 std::string instance_name;
586 std::string part_naming;
587 std::string net_naming;
589 double rotation = 0.0;
590 bool glued = false;
591};
592
597{
598 std::string name;
599 long timestamp = 0;
600 std::string part_naming;
601 std::string net_naming;
602 std::vector<std::string> part_names;
603 std::vector<REUSE_NET> nets;
604 std::vector<REUSE_INSTANCE> instances;
605};
606
608{
609 std::string name;
610 int id = 0;
611 std::vector<std::string> net_names;
612 std::vector<std::string> segment_refs;
613};
614
616{
617 std::string type;
618 double x = 0.0;
619 double y = 0.0;
620 int side = 0;
621 std::string net_name;
622 std::string symbol_name;
623};
624
626{
627 std::string name;
628 double x = 0.0;
629 double y = 0.0;
630 double crossbar_pos = 0.0;
631 bool is_horizontal = true;
632 int layer = 0;
633 std::vector<POINT> points;
634 std::string text;
635 double text_height = 0.0;
636 double text_width = 0.0;
637 double rotation = 0.0;
638};
639
648
650{
652 std::vector<ARC_POINT> outline;
653 std::vector<int> layers;
654 bool no_traces = true;
655 bool no_vias = true;
656 bool no_copper = true;
657 bool no_components = false;
658 bool height_restriction = false;
659 double max_height = 0.0;
660 bool no_test_points = false;
661 bool no_accordion = false;
662};
663
665{
666public:
667 PARSER();
668 ~PARSER();
669
670 void Parse( const wxString& aFileName );
671
672 const PARAMETERS& GetParameters() const { return m_parameters; }
673 const std::vector<PART>& GetParts() const { return m_parts; }
674 const std::vector<NET>& GetNets() const { return m_nets; }
675 const std::vector<ROUTE>& GetRoutes() const { return m_routes; }
676 const std::vector<TEXT>& GetTexts() const { return m_texts; }
677 const std::vector<LINE>& GetLines() const { return m_lines; }
678 const std::vector<POLYLINE>& GetBoardOutlines() const { return m_board_outlines; }
679 const std::vector<POUR>& GetPours() const { return m_pours; }
680 const std::map<std::string, VIA_DEF>& GetViaDefs() const { return m_via_defs; }
681 const std::map<std::string, PART_DECAL>& GetPartDecals() const { return m_decals; }
682 const std::map<std::string, PART_TYPE>& GetPartTypes() const { return m_part_types; }
683 const std::map<std::string, std::map<std::string, std::string>>& GetPartInstanceAttrs() const
684 {
686 }
687 const std::map<std::string, REUSE_BLOCK>& GetReuseBlocks() const { return m_reuse_blocks; }
688 const std::vector<CLUSTER>& GetClusters() const { return m_clusters; }
689 const std::vector<TEST_POINT>& GetTestPoints() const { return m_test_points; }
690 const std::vector<DIMENSION>& GetDimensions() const { return m_dimensions; }
691 const DESIGN_RULES& GetDesignRules() const { return m_design_rules; }
692 const std::vector<NET_CLASS_DEF>& GetNetClasses() const { return m_net_classes; }
693 const std::vector<DIFF_PAIR_DEF>& GetDiffPairs() const { return m_diff_pairs; }
694 const std::vector<KEEPOUT>& GetKeepouts() const { return m_keepouts; }
695 const std::vector<JUMPER_DEF>& GetJumperDefs() const { return m_jumper_defs; }
696 const std::vector<COPPER_SHAPE>& GetCopperShapes() const { return m_copper_shapes; }
697 const std::vector<GRAPHIC_LINE>& GetGraphicLines() const { return m_graphic_lines; }
698 const FILE_HEADER& GetFileHeader() const { return m_file_header; }
699 bool IsBasicUnits() const { return m_is_basic_units; }
700
704 std::vector<LAYER_INFO> GetLayerInfos() const;
705
706private:
707 void parseLine( const std::string& aLine );
708 void parseSectionPCB( std::ifstream& aStream );
709 void parseSectionPARTS( std::ifstream& aStream );
710 void parseSectionNETS( std::ifstream& aStream );
711 void parseSectionROUTES( std::ifstream& aStream );
712 void parseSectionTEXT( std::ifstream& aStream );
713 void parseSectionBOARD( std::ifstream& aStream );
714 void parseSectionLINES( std::ifstream& aStream );
715 void parseSectionVIA( std::ifstream& aStream );
716 void parseSectionPOUR( std::ifstream& aStream );
717 void parseSectionPARTDECAL( std::ifstream& aStream );
718 void parseSectionPARTTYPE( std::ifstream& aStream );
719 void parseSectionREUSE( std::ifstream& aStream );
720 void parseSectionCLUSTER( std::ifstream& aStream );
721 void parseSectionJUMPER( std::ifstream& aStream );
722 void parseSectionTESTPOINT( std::ifstream& aStream );
723 void parseSectionNETCLASS( std::ifstream& aStream );
724 void parseSectionDIFFPAIR( std::ifstream& aStream );
725 void parseSectionLAYERDEFS( std::ifstream& aStream );
726 void parseSectionMISC( std::ifstream& aStream );
728
729 // Read next line, skipping comments and empty lines
730 bool readLine( std::ifstream& aStream, std::string& aLine );
731 void pushBackLine( const std::string& aLine );
732
740 int parseMajorVersion() const;
741
743 std::vector<PART> m_parts;
744 std::vector<NET> m_nets;
745 std::vector<ROUTE> m_routes;
746 std::vector<TEXT> m_texts;
747 std::vector<LINE> m_lines;
748 std::vector<POLYLINE> m_board_outlines;
749 std::vector<POUR> m_pours;
750 std::map<std::string, VIA_DEF> m_via_defs;
751 std::map<std::string, PART_DECAL> m_decals;
752 std::map<std::string, PART_TYPE> m_part_types;
753
755 std::map<std::string, std::map<std::string, std::string>> m_part_instance_attrs;
756 std::map<std::string, REUSE_BLOCK> m_reuse_blocks;
757 std::vector<CLUSTER> m_clusters;
758 std::vector<TEST_POINT> m_test_points;
759 std::vector<DIMENSION> m_dimensions;
761 std::vector<NET_CLASS_DEF> m_net_classes;
762 std::vector<DIFF_PAIR_DEF> m_diff_pairs;
763 std::vector<KEEPOUT> m_keepouts;
764 std::vector<JUMPER_DEF> m_jumper_defs;
765 std::vector<COPPER_SHAPE> m_copper_shapes;
766 std::vector<GRAPHIC_LINE> m_graphic_lines;
767 std::map<int, LAYER_INFO> m_layer_defs;
769 bool m_is_basic_units = false;
770 bool m_has_font_lines = true;
771
772 std::string m_current_section;
773 std::optional<std::string> m_pushed_line;
774};
775
776} // 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
bool m_has_font_lines
True if text/label entries include a font line.
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
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
std::map< std::string, PART_TYPE > m_part_types
Per-instance attribute overrides from PART <name> {...} blocks.
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 the 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
std::vector< GRAPHIC_LINE > m_graphic_lines
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
int parseMajorVersion() const
Parse the major version number from the file header version string.
std::map< int, LAYER_INFO > m_layer_defs
Keyed 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)
@ BURIED
Inner layers only.
@ THROUGH
Spans all copper layers.
@ BLIND
Surface to inner layer.
@ MICROVIA
Single-layer blind, typically HDI.
@ OPEN_COLLECTOR
C, open collector or or-tieable source.
bool IsAntiPadRow(const PAD_STACK_LAYER &aLayer)
RA and SA rows carry a plane's anti-pad clearance rather than the pad's own copper.
bool IsThermalReliefPadRow(const PAD_STACK_LAYER &aLayer)
RT and ST rows carry a plane's thermal-relief spoke pattern rather than the pad's own copper.
@ LIB_PCB_DECAL
Library footprints.
Definition pads_parser.h:98
@ LIB_LINE
Library line items (drafting)
Definition pads_parser.h:96
bool IsCopperPadRow(const PAD_STACK_LAYER &aLayer)
True when the row describes pad or via copper.
@ SOLID
POUROUT, POLY.
PADS_LAYER_FUNCTION
ARC arc
Only valid when is_arc is true.
Definition pads_parser.h:68
ARC_POINT(double aX, double aY, const ARC &aArc)
Definition pads_parser.h:84
ARC_POINT(double aX, double aY)
Definition pads_parser.h:77
Arc as center, radius and angles.
Definition pads_parser.h:50
double radius
Definition pads_parser.h:53
double delta_angle
Definition pads_parser.h:55
double start_angle
Definition pads_parser.h:54
std::string font_info
std::string hjust
std::string vjust
std::vector< std::string > segment_refs
std::string name
std::vector< std::string > net_names
Standalone copper area from the LINES section (type=COPPER), not part of a pour.
std::vector< ARC_POINT > outline
bool is_cutout
COPCUT, COPCCO.
std::string net_name
Empty if unconnected.
bool filled
COPCLS, COPCIR.
double width
For open polylines.
std::string restrictions
KPTCLS/KPTCIR keepout codes R,C,V,T,A.
bool is_tag_close
Closing TAG, level 0.
std::vector< ARC_POINT > points
int pinnum
Copper-piece pin association, -1 = none.
std::string type
CLOSED, OPEN, CIRCLE, COPCLS, TAG, etc.
bool is_tag_open
Opening TAG, level 1.
std::vector< PAD_STACK_LAYER > stack
double silk_clearance
SILKCLEAR.
double default_track_width
DEFAULTTRACKWID.
double default_via_drill
DEFAULTVIADRILL.
double min_track_width
MINTRACKWID.
double min_via_size
MINVIASIZE.
double min_via_drill
MINVIADRILL.
double min_clearance
MINCLEAR.
double default_via_size
DEFAULTVIASIZE.
double copper_edge_clearance
OUTLINE_TO_*.
double default_clearance
DEFAULTCLEAR.
double hole_to_hole
HOLEHOLE.
double mask_clearance
MASKCLEAR.
double x
Origin.
double crossbar_pos
Y for horizontal, X for vertical.
std::vector< POINT > points
Measurement endpoints.
std::string product
POWERPCB, PADS, LAYOUT, PADS-LIBRARY-*.
PADS_FILE_TYPE file_type
std::string units
MILS, MM, INCH, BASIC.
int gate_swap_type
0 = not swappable
std::vector< GATE_PIN > pins
std::string func_name
int swap_type
0 = not swappable
std::string pin_number
PIN_ELEC_TYPE elec_type
Non-electrical drawing item from the LINES section (type=LINES).
std::vector< ARC_POINT > points
std::string reuse_instance
std::string padstack
Start pin, or both if end_padstack empty.
bool wirebond
W flag.
std::string end_padstack
End pin, optional.
bool display_silk
D flag.
std::vector< ATTRIBUTE > labels
bool via_enabled
V flag.
bool is_start
S = start, E = end.
std::vector< ARC_POINT > outline
bool no_vias
V restriction.
bool no_components
P restriction.
bool no_copper
C restriction.
bool no_accordion
A restriction.
bool height_restriction
H restriction.
KEEPOUT_TYPE type
bool no_traces
R restriction.
std::vector< int > layers
Empty = all.
bool no_test_points
T restriction.
PADS_LAYER_FUNCTION layer_type
bool required
Layer must be mapped.
int number
PADS layer number.
double layer_thickness
Dielectric, BASIC units.
double dielectric_constant
Er.
double copper_thickness
Copper foil, BASIC units.
int routing_direction
0=horizontal, 1=vertical, 2=no preference
double via_drill
VIADRILL.
double clearance
CLEARANCE.
std::vector< std::string > net_names
double track_width
TRACKWIDTH.
double diff_pair_width
DIFFPAIRWIDTH.
double diff_pair_gap
DIFFPAIRGAP.
double via_size
VIASIZE.
std::string pin_name
std::string reuse_instance
std::string ref_des
std::string reuse_signal
std::string name
std::vector< NET_PIN > pins
std::vector< std::string > component_refs
Section-24 endpoints whose terminal is unresolved.
bool chamfered
Negative corner value in PADS.
double drill
0 for SMD
std::string shape
R, S, A, O, OF, RF, RT, ST, RA, SA, RC, OC.
bool plated
PTH vs NPTH.
double thermal_outer_diameter
Thermal or void in plane.
double slot_orientation
0-179.999 degrees
double thermal_spoke_orientation
First spoke.
double inner_diameter
Annular ring, 0 = solid.
double finger_offset
Along orientation axis.
double sizeB
Height for rectangles/ovals.
double slot_offset
From electrical center.
double corner_radius
Always positive.
double sizeA
Diameter or width.
double drill_oversize
DRLOVERSIZE, plated holes.
double thermal_line_width
THERLINEWID, THT.
double thermal_smd_width
THERSMDWID, SMD.
double user_grid
USERGRID.
double thermal_min_clearance
STMINCLEAR.
int thermal_flags
THERFLAGS.
std::string default_signal_via
VIAPSHVIA.
int thermal_min_spokes
STMINSPOKES.
std::map< int, std::pair< int, int > > drill_spans
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
From {...} block.
std::map< std::string, int > pin_pad_map
Pin name to pad stack index.
std::vector< GATE_DEF > gates
std::vector< SIGPIN > signal_pins
std::string decal_name
std::string part_type
Used with PARTTYPE@DECAL syntax.
bool explicit_decal
Decal given explicitly with @ syntax.
std::string reuse_instance
std::string value
std::string decal
Primary decal (first in colon-separated list)
std::string name
int alt_decal_index
ALT placement field, -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
Remaining decals after ':' splits.
A polyline that may contain arc segments, used for board outlines and graphics.
std::vector< ARC_POINT > points
int thermal_spoke_count
std::string name
bool is_cutout
POCUT piece.
POUR_STYLE style
std::string net_name
std::string owner_pour
Parent pour, 7th header field.
double thermal_spoke_width
double hatch_grid
std::vector< ARC_POINT > points
THERMAL_TYPE thermal_type
double thermal_gap
double hatch_width
A reuse block definition containing parts and routes that can be instantiated.
std::vector< REUSE_NET > nets
std::string net_naming
Default scheme.
std::string part_naming
Default scheme.
std::vector< std::string > part_names
std::vector< REUSE_INSTANCE > instances
Placements of this block.
std::string part_naming
May be multi-word like "PREFIX pref".
std::string net_naming
May be multi-word like "SUFFIX suf".
std::string name
Original net name from reuse definition.
bool merge
Merge nets vs rename.
std::vector< VIA > vias
std::vector< TEARDROP > teardrops
std::vector< TRACK > tracks
std::vector< NET_PIN > pins
From pin pair lines.
std::vector< JUMPER_MARKER > jumpers
std::string net_name
std::string pin_number
double width
Track width for connections.
std::string signal_name
e.g. VCC, GND
std::string name
std::string type
VIA or PIN.
std::string net_name
int side
0=through, 1=top, 2=bottom
std::string symbol_name
std::string font_face
std::string vjust
UP, CENTER, DOWN.
std::string content
std::string reuse_instance
int ndim
Auto-dimensioning text number, 0 if unused.
std::string hjust
LEFT, CENTER, RIGHT.
double font_descent
double font_height
std::string font_style
Regular, Bold, Italic, Underline, or combinations.
std::vector< ARC_POINT > points
bool has_mask_front
Stack includes top soldermask, layer 25.
int drill_start
Drill span from file, for blind/buried.
int start_layer
First PADS layer in span.
int end_layer
Last PADS layer in span.
std::vector< PAD_STACK_LAYER > stack
std::string name
bool has_mask_back
Stack includes bottom soldermask, layer 28.
std::vector< PAD_STACK_LAYER > stack
std::string name