aboutsummaryrefslogtreecommitdiff
path: root/svg-flatten/src/out_gerber.cpp
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-06-24 13:04:25 +0200
committerjaseg <git@jaseg.de>2022-06-24 13:04:25 +0200
commite845888580eff25332a4f75fc2503089a8835963 (patch)
treee5432b83d4b3b29e828ee91561194733c2c20fe4 /svg-flatten/src/out_gerber.cpp
parente76d257220cb98cf8286b077cad248de62a6abc8 (diff)
downloadgerbolyze-e845888580eff25332a4f75fc2503089a8835963.tar.gz
gerbolyze-e845888580eff25332a4f75fc2503089a8835963.tar.bz2
gerbolyze-e845888580eff25332a4f75fc2503089a8835963.zip
svg-flatten: Fix pattern aperture macro export
Diffstat (limited to 'svg-flatten/src/out_gerber.cpp')
-rw-r--r--svg-flatten/src/out_gerber.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/svg-flatten/src/out_gerber.cpp b/svg-flatten/src/out_gerber.cpp
index f781649..30518b1 100644
--- a/svg-flatten/src/out_gerber.cpp
+++ b/svg-flatten/src/out_gerber.cpp
@@ -156,7 +156,10 @@ SimpleGerberOutput &SimpleGerberOutput::operator<<(const PatternToken &tok) {
for (auto &pt : pair.first) {
m_out << "," << pt[0] << "," << pt[1];
}
- m_out << "," << pair.first.back()[0] << "," << pair.first.back()[1] << "*" << endl;
+ /* We internally represent closed polys as (a - b - c - d), while Gerber aperture macros require the first and
+ * last vertex to be the same as in (a - b - c - d - a).
+ */
+ m_out << "," << pair.first[0][0] << "," << pair.first[0][1] << "*" << endl;
}
m_out << "%" << endl;