Skip to content

Commit

Permalink
test: Write final svgs to expected
Browse files Browse the repository at this point in the history
  • Loading branch information
eyal0 committed Feb 17, 2021
1 parent ea36baf commit f49127a
Show file tree
Hide file tree
Showing 164 changed files with 7,087 additions and 0 deletions.
12 changes: 12 additions & 0 deletions surface_vectorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ vector<polygon_type_fp> find_thermal_reliefs(const multi_polygon_type_fp& millin
return holes;
}

void Surface_vectorial::write_svgs(const std::string& tool_suffix, coordinate_type_fp tool_diameter,
const multi_linestring_type_fp& toolpaths,
coordinate_type_fp tolerance, bool find_contentions) const {
vector<vector<pair<linestring_type_fp, bool>>> new_trace_toolpaths;
new_trace_toolpaths.emplace({});
for (const auto& ls : toolpaths) {
new_trace_toolpaths.front().push_back(make_pair(ls, true));
}
write_svgs(tool_suffix, tool_diameter, new_trace_toolpaths, tolerance, find_contentions);
}

void Surface_vectorial::write_svgs(const string& tool_suffix, coordinate_type_fp tool_diameter,
const vector<vector<pair<linestring_type_fp, bool>>>& new_trace_toolpaths,
coordinate_type_fp tolerance, bool find_contentions) const {
Expand Down Expand Up @@ -862,6 +873,7 @@ vector<pair<coordinate_type_fp, multi_linestring_type_fp>> Surface_vectorial::ge
write_svgs(tool_suffix, tool_diameter, new_trace_toolpaths, mill->tolerance, tool_index == tool_count - 1);
auto new_toolpath = flatten(new_trace_toolpaths);
multi_linestring_type_fp combined_toolpath = post_process_toolpath(isolator, new_toolpath);
write_svgs("_final" + tool_suffix, tool_diameter, combined_toolpath, isolator->tolerance, tool_index == tool_count - 1);
results[tool_index] = make_pair(tool_diameter, mirror_toolpath(combined_toolpath, mirror));
}
// Now process any lines that need drawing.
Expand Down
3 changes: 3 additions & 0 deletions surface_vectorial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ class Surface_vectorial: private boost::noncopyable {
void write_svgs(const std::string& tool_suffix, coordinate_type_fp tool_diameter,
const std::vector<std::vector<std::pair<linestring_type_fp, bool>>>& new_trace_toolpaths,
coordinate_type_fp tolerance, bool find_contentions) const;
void write_svgs(const std::string& tool_suffix, coordinate_type_fp tool_diameter,
const multi_linestring_type_fp& toolpaths,
coordinate_type_fp tolerance, bool find_contentions) const;
};

class svg_writer {
Expand Down
90 changes: 90 additions & 0 deletions testing/gerbv_example/D1MiniGSR/expected/processed_back_final.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions testing/gerbv_example/D1MiniGSR/expected/processed_front_final.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions testing/gerbv_example/D1MiniGSR/expected/traced_back_final.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions testing/gerbv_example/D1MiniGSR/expected/traced_front_final.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f49127a

Please sign in to comment.