diff --git a/Jenkinsfile-pypi b/Jenkinsfile-pypi index 8bc51a963..632fab52e 100644 --- a/Jenkinsfile-pypi +++ b/Jenkinsfile-pypi @@ -33,7 +33,7 @@ node("master") { stage("Publish and test") { // publish for release tags - if (BRANCH_NAME.startsWith('pypi_v')) { + if (BRANCH_NAME.startsWith('pypi_')) { sh("twine upload --skip-existing wheelhouse/klayout-*manylinux2014*.whl wheelhouse/*.zip") } diff --git a/src/db/db/dbShapes.cc b/src/db/db/dbShapes.cc index 535c0be6d..250918349 100644 --- a/src/db/db/dbShapes.cc +++ b/src/db/db/dbShapes.cc @@ -839,27 +839,27 @@ Shapes::transform (const Shapes::shape_type &ref, const Trans &t) case shape_type::Polygon: { shape_type::polygon_type p (ref.polygon ()); - p.transform (t); + p.transform (t, false /* don't compress */); return replace_member_with_props (shape_type::polygon_type::tag (), ref, p); } case shape_type::PolygonRef: { shape_type::polygon_type p; ref.polygon (p); - p.transform (t); + p.transform (t, false /* don't compress */); return replace_member_with_props (shape_type::polygon_ref_type::tag (), ref, p); } case shape_type::SimplePolygon: { shape_type::simple_polygon_type p (ref.simple_polygon ()); - p.transform (t); + p.transform (t, false /* don't compress */); return replace_member_with_props (shape_type::simple_polygon_type::tag (), ref, p); } case shape_type::SimplePolygonRef: { shape_type::simple_polygon_type p; ref.simple_polygon (p); - p.transform (t); + p.transform (t, false /* don't compress */); return replace_member_with_props (shape_type::simple_polygon_ref_type::tag (), ref, p); } case shape_type::Edge: diff --git a/src/edt/edt/edtPartialService.cc b/src/edt/edt/edtPartialService.cc index c765f271f..fe5bf02df 100644 --- a/src/edt/edt/edtPartialService.cc +++ b/src/edt/edt/edtPartialService.cc @@ -261,13 +261,12 @@ insert_point_path (const db::Path &p, const std::set &sel, db::Po } static void -assign_path_compressed (db::Path &p, std::vector &ctr) +remove_redundant_points (std::vector &ctr) { // compress contour (remove redundant points) // and assign to path std::vector::iterator wp = ctr.begin (); - std::vector::iterator wp0 = wp; std::vector::const_iterator rp = ctr.begin (); db::Point pm1 = *rp; if (wp != ctr.end ()) { @@ -275,20 +274,14 @@ assign_path_compressed (db::Path &p, std::vector &ctr) ++rp; while (rp != ctr.end ()) { db::Point p0 = *rp; - ++rp; - if (rp != ctr.end ()) { - db::Point pp1 = *rp; - if (! (db::vprod_sign (pp1 - p0, p0 - pm1) == 0 && db::sprod_sign (pp1 - p0, p0 - pm1) >= 0)) { - *wp++ = p0; - pm1 = p0; - } - } else { + if (p0 != pm1) { *wp++ = p0; } + ++rp; } } - p.assign (wp0, wp); + ctr.erase (wp, ctr.end ()); } static db::Path @@ -310,7 +303,8 @@ del_points_path (const db::Path &p, const std::set &sel) } } - assign_path_compressed (new_path, ctr); + remove_redundant_points (ctr); + new_path.assign (ctr.begin (), ctr.end ()); return new_path; } @@ -362,10 +356,10 @@ modify_path (db::Path &p, const std::map &new_points } if (compress) { - assign_path_compressed (p, ctr); - } else { - p.assign (ctr.begin (), ctr.end ()); + remove_redundant_points (ctr); } + + p.assign (ctr.begin (), ctr.end ()); } bool @@ -402,6 +396,8 @@ insert_point_poly (const db::Polygon &p, const std::set &sel, db: if (found) { + remove_redundant_points (ctr); + new_poly = p; if (c == 0) { new_poly.assign_hull (ctr.begin (), ctr.end (), false /*don't compress*/); @@ -436,10 +432,12 @@ del_points_poly (const db::Polygon &p, const std::set &sel) } } + remove_redundant_points (ctr); + if (c == 0) { - new_poly.assign_hull (ctr.begin (), ctr.end (), true /*compress*/); + new_poly.assign_hull (ctr.begin (), ctr.end (), false /*compress*/); } else { - new_poly.assign_hole (c - 1, ctr.begin (), ctr.end (), true /*compress*/); + new_poly.assign_hole (c - 1, ctr.begin (), ctr.end (), false /*compress*/); } } @@ -495,10 +493,14 @@ modify_polygon (db::Polygon &p, } + if (compress) { + remove_redundant_points (ctr); + } + if (c == 0) { - p.assign_hull (ctr.begin (), ctr.end (), compress); + p.assign_hull (ctr.begin (), ctr.end (), false /*compress*/); } else { - p.assign_hole (c - 1, ctr.begin (), ctr.end (), compress); + p.assign_hole (c - 1, ctr.begin (), ctr.end (), false /*compress*/); } }