From eb7107a8c6025399ce7c41a3f0f4ae7d40861b32 Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 29 Mar 2023 18:23:56 +0200 Subject: svg-flatten: Fix incorrect polarity for outlined strokes --- svg-flatten/src/out_gerber.cpp | 1 - svg-flatten/src/svg_doc.cpp | 4 +- svg-flatten/testdata/svg/xform_uniformity.svg | 586 ++++++++++++++++++++++++++ 3 files changed, 588 insertions(+), 3 deletions(-) create mode 100644 svg-flatten/testdata/svg/xform_uniformity.svg (limited to 'svg-flatten') diff --git a/svg-flatten/src/out_gerber.cpp b/svg-flatten/src/out_gerber.cpp index 4293d82..af84876 100644 --- a/svg-flatten/src/out_gerber.cpp +++ b/svg-flatten/src/out_gerber.cpp @@ -63,7 +63,6 @@ void SimpleGerberOutput::header_impl(d2p origin, d2p size) { } SimpleGerberOutput& SimpleGerberOutput::operator<<(const ApertureToken &ap) { - cerr << ap.m_size << " / " << m_current_aperture << endl; m_aperture_set = ap.m_has_aperture; if (!m_macro_aperture && ap.m_size == m_current_aperture) { diff --git a/svg-flatten/src/svg_doc.cpp b/svg-flatten/src/svg_doc.cpp index 6cb6138..47e73ee 100644 --- a/svg-flatten/src/svg_doc.cpp +++ b/svg-flatten/src/svg_doc.cpp @@ -530,9 +530,9 @@ void gerbolyze::SVGDocument::export_svg_path(RenderContext &ctx, const pugi::xml Paths s_polys; dehole_polytree(ptree, s_polys); ctx.mat().doc2phys_clipper(s_polys); - /* color has alredy been pushed above. */ + /* color has already been pushed above. */ //cerr << " sinking " << s_polys.size() << " paths" << endl; - ctx.sink() << ApertureToken() << s_polys; + ctx.sink() << (stroke_color == GRB_DARK ? GRB_POL_DARK : GRB_POL_CLEAR) << ApertureToken() << s_polys; } } } diff --git a/svg-flatten/testdata/svg/xform_uniformity.svg b/svg-flatten/testdata/svg/xform_uniformity.svg new file mode 100644 index 0000000..2b0b27c --- /dev/null +++ b/svg-flatten/testdata/svg/xform_uniformity.svg @@ -0,0 +1,586 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit