KiCad PCB EDA Suite
Loading...
Searching...
No Matches
autotrax_model.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 * Format interpretation derived from pcb-rnd src_plugins/io_autotrax:
5 * Copyright (C) 2016, 2017, 2018, 2020 Tibor 'Igor2' Palinkas
6 * Copyright (C) 2016, 2017 Erich S. Heinzle
7 * Used under GPL v2-or-later.
8 *
9 * Copyright (C) 2026 KiCad Developers, see AUTHORS.txt for contributors.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, you may find one here:
23 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
24 * or you may search the http://www.gnu.org website for the version 2 license,
25 * or you may write to the Free Software Foundation, Inc.,
26 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
27 */
28
29#ifndef AUTOTRAX_MODEL_H_
30#define AUTOTRAX_MODEL_H_
31
32#include <vector>
33
34#include <wx/string.h>
35
36namespace AUTOTRAX
37{
38
60
61
63struct TRACK
64{
65 double x1 = 0;
66 double y1 = 0;
67 double x2 = 0;
68 double y2 = 0;
69 double width = 0;
70 int layer = 0;
71};
72
73
76struct ARC
77{
78 double centerX = 0;
79 double centerY = 0;
80 double radius = 0;
81 int segments = 15;
82 double width = 0;
83 int layer = 0;
84};
85
86
88struct VIA
89{
90 double x = 0;
91 double y = 0;
92 double diameter = 0;
93 double drill = 0;
94};
95
96
98struct PAD
99{
100 double x = 0;
101 double y = 0;
102 double xSize = 0;
103 double ySize = 0;
104 int shape = 0;
105 double drill = 0;
106 int planeFlags = 0;
107 int layer = 0;
108 wxString name;
109};
110
111
113struct FILL
114{
115 double x1 = 0;
116 double y1 = 0;
117 double x2 = 0;
118 double y2 = 0;
119 int layer = 0;
120};
121
122
124struct TEXT
125{
126 double x = 0;
127 double y = 0;
128 double height = 0;
129 int direction = 0;
130 double width = 0;
131 int layer = 0;
132 wxString text;
133};
134
135
138{
139 wxString refdes;
140 wxString name;
141 wxString value;
142 double x = 0;
143 double y = 0;
144
145 std::vector<TRACK> tracks;
146 std::vector<ARC> arcs;
147 std::vector<VIA> vias;
148 std::vector<PAD> pads;
149 std::vector<FILL> fills;
150 std::vector<TEXT> texts;
151};
152
153
156{
157 wxString netName;
158 wxString node;
159};
160
161
167{
168 int version = 4;
169
170 std::vector<TRACK> tracks;
171 std::vector<ARC> arcs;
172 std::vector<VIA> vias;
173 std::vector<PAD> pads;
174 std::vector<FILL> fills;
175 std::vector<TEXT> texts;
176 std::vector<COMPONENT> components;
177 std::vector<NET_NODE> netNodes;
178};
179
180} // namespace AUTOTRAX
181
182#endif // AUTOTRAX_MODEL_H_
LAYER
Autotrax/Easytrax layer numbers as stored in the file.
@ LAYER_BOTTOM_COPPER
Free or component arc (FA / CA).
int segments
quadrant bitmask; 15 = full circle
Everything parsed out of an Autotrax/Easytrax file, before any KiCad object is created.
std::vector< COMPONENT > components
std::vector< VIA > vias
std::vector< NET_NODE > netNodes
std::vector< PAD > pads
std::vector< TRACK > tracks
int version
4 = Autotrax, 5 = Easytrax
std::vector< TEXT > texts
std::vector< ARC > arcs
std::vector< FILL > fills
A placed component (COMP .. ENDCOMP) holding its own primitives.
std::vector< ARC > arcs
std::vector< TRACK > tracks
std::vector< VIA > vias
std::vector< PAD > pads
std::vector< FILL > fills
std::vector< TEXT > texts
Free or component rectangular fill (FF / CF), Autotrax's only pour.
One refdes -> net membership row collected from the NETDEF section.
wxString node
"refdes-pad" connection token
Free or component pad/pin (FP / CP).
int shape
1 round, 2 rect, 3 octagon, 4 round-rect
Free or component string (FS / CS).
int direction
0..3, multiplied by 90 degrees
Free or component track segment (FT / CT). All coordinates are in mils.
Free or component via (FV / CV).