diff --git a/src/plugins/streamers/pcb/db_plugin/dbRS274XReader.cc b/src/plugins/streamers/pcb/db_plugin/dbRS274XReader.cc index c69975b07..9fb3b3b12 100644 --- a/src/plugins/streamers/pcb/db_plugin/dbRS274XReader.cc +++ b/src/plugins/streamers/pcb/db_plugin/dbRS274XReader.cc @@ -513,6 +513,7 @@ RS274XReader::do_read () if (m_polygon_mode) { // D02 strokes close the polygon (and restart a new one) + if (m_polygon_points.size () >= 3) { db::DPolygon poly; poly.assign_hull (m_polygon_points.begin (), m_polygon_points.end ()); @@ -520,6 +521,7 @@ RS274XReader::do_read () } m_polygon_points.clear (); + m_polygon_points.push_back (db::DPoint (x, y)); } diff --git a/src/plugins/streamers/pcb/unit_tests/dbGerberImport.cc b/src/plugins/streamers/pcb/unit_tests/dbGerberImport.cc index fb04bea8c..bbade496d 100644 --- a/src/plugins/streamers/pcb/unit_tests/dbGerberImport.cc +++ b/src/plugins/streamers/pcb/unit_tests/dbGerberImport.cc @@ -297,6 +297,11 @@ TEST(26) run_test (_this, "pos-neg"); } +TEST(27) +{ + run_test (_this, "polygon-mode"); +} + TEST(X2_1) { run_test (_this, "x2-1");