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, see <https://www.gnu.org/licenses/>.
23 */
24
25#ifndef AUTOTRAX_MODEL_H_
26#define AUTOTRAX_MODEL_H_
27
28#include <optional>
29#include <vector>
30
31#include <wx/string.h>
32
33namespace AUTOTRAX
34{
35
57
58
60struct TRACK
61{
62 double x1 = 0;
63 double y1 = 0;
64 double x2 = 0;
65 double y2 = 0;
66 double width = 0;
67 int layer = 0;
68};
69
70
73struct ARC
74{
75 double centerX = 0;
76 double centerY = 0;
77 double radius = 0;
78 int segments = 15;
79 double width = 0;
80 int layer = 0;
81};
82
83
85struct VIA
86{
87 double x = 0;
88 double y = 0;
89 double diameter = 0;
90 double drill = 0;
91};
92
93
95struct PAD
96{
97 double x = 0;
98 double y = 0;
99 double xSize = 0;
100 double ySize = 0;
101 int shape = 0;
102 double drill = 0;
103 int planeFlags = 0;
104 int layer = 0;
105 wxString name;
106};
107
108
110struct FILL
111{
112 double x1 = 0;
113 double y1 = 0;
114 double x2 = 0;
115 double y2 = 0;
116 int layer = 0;
117};
118
119
121struct TEXT
122{
123 double x = 0;
124 double y = 0;
125 double height = 0;
126 int direction = 0;
127 bool mirrored = false;
128 double width = 0;
129 int layer = 0;
130 wxString text;
131};
132
133
136{
137 wxString refdes;
138 wxString name;
139 wxString value;
140 double x = 0;
141 double y = 0;
142
143 std::optional<TEXT> refdesText;
144 std::optional<TEXT> valueText;
145 bool refdesVisible = true;
146 bool valueVisible = true;
147
148 std::vector<TRACK> tracks;
149 std::vector<ARC> arcs;
150 std::vector<VIA> vias;
151 std::vector<PAD> pads;
152 std::vector<FILL> fills;
153 std::vector<TEXT> texts;
154};
155
156
159{
160 wxString netName;
161 wxString node;
162};
163
164
170{
171 int version = 4;
172
173 std::vector<TRACK> tracks;
174 std::vector<ARC> arcs;
175 std::vector<VIA> vias;
176 std::vector<PAD> pads;
177 std::vector<FILL> fills;
178 std::vector<TEXT> texts;
179 std::vector<COMPONENT> components;
180 std::vector<NET_NODE> netNodes;
181};
182
183} // namespace AUTOTRAX
184
185#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::optional< TEXT > valueText
comment placement, text unused
std::vector< TRACK > tracks
std::vector< VIA > vias
std::vector< PAD > pads
std::optional< TEXT > refdesText
designator placement, text unused
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 counterclockwise
Free or component track segment (FT / CT). All coordinates are in mils.
Free or component via (FV / CV).