From 31b5a77c8a574ad1eee7fe9ead0a1a8cd14989f6 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 19 Jun 2022 00:53:55 +0200 Subject: svg-flatten: Fix drill export --- svg-flatten/src/svg_doc.cpp | 56 ++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 29 deletions(-) (limited to 'svg-flatten/src/svg_doc.cpp') diff --git a/svg-flatten/src/svg_doc.cpp b/svg-flatten/src/svg_doc.cpp index 7ff0a11..42338e8 100644 --- a/svg-flatten/src/svg_doc.cpp +++ b/svg-flatten/src/svg_doc.cpp @@ -116,7 +116,7 @@ bool IDElementSelector::match(const pugi::xml_node &node, bool is_toplevel, bool if (is_toplevel && layers) { bool layer_match = std::find(layers->begin(), layers->end(), id) != layers->end(); if (!layer_match) { - cerr << "Rejecting layer \"" << id << "\"" << endl; + //cerr << "Rejecting layer \"" << id << "\"" << endl; return false; } } @@ -185,7 +185,6 @@ void gerbolyze::SVGDocument::export_svg_group(RenderContext &ctx, const pugi::xm if (name == "g") { if (ctx.root()) { /* Treat top-level groups as "layers" like inkscape does. */ - cerr << "Forwarding layer name to sink: \"" << node.attribute("id").value() << "\"" << endl; LayerNameToken tok { node.attribute("id").value() }; elem_ctx.sink() << tok; } @@ -258,34 +257,34 @@ void gerbolyze::SVGDocument::export_svg_path(RenderContext &ctx, const pugi::xml bool has_fill = fill_color; bool has_stroke = stroke_color && stroke_width > 0.0; - /* Skip filling for transparent fills. In outline mode, skip filling if a stroke is also set to avoid double lines. - */ - if (has_fill && !(ctx.settings().outline_mode && has_stroke)) { - /* In outline mode, identify drills before applying clip */ - if (ctx.settings().outline_mode && fill_color != GRB_PATTERN_FILL) { - /* Polsby-Popper test */ - for (auto &p : fill_paths) { - Polygon_i geom_poly(p.size()); - for (size_t i=0; i