From b1f9d50aad249aaa5500c47caf79eae5b9a8c3d9 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Tue, 29 Nov 2022 13:52:47 +0100 Subject: [PATCH] Rename function: collect_duplications -> collect_duplicates more english correct name --- src/libslic3r/Emboss.cpp | 10 +++++----- src/libslic3r/Point.cpp | 2 +- src/libslic3r/Point.hpp | 2 +- src/libslic3r/Triangulation.cpp | 4 ++-- tests/libslic3r/test_emboss.cpp | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libslic3r/Emboss.cpp b/src/libslic3r/Emboss.cpp index d7a3ac1f6..440903757 100644 --- a/src/libslic3r/Emboss.cpp +++ b/src/libslic3r/Emboss.cpp @@ -283,7 +283,7 @@ ExPolygons Emboss::heal_shape(const Polygons &shape) { // Do not remove all duplicits but do it better way // Overlap all duplicit points by rectangle 3x3 - Points duplicits = collect_duplications(to_points(polygons)); + Points duplicits = collect_duplicates(to_points(polygons)); if (!duplicits.empty()) { polygons.reserve(polygons.size() + duplicits.size()); for (const Point &p : duplicits) { @@ -310,7 +310,7 @@ bool Emboss::heal_shape(ExPolygons &shape, unsigned max_iteration) priv::remove_same_neighbor(shape); Pointfs intersections = intersection_points(shape); - Points duplicits = collect_duplications(to_points(shape)); + Points duplicits = collect_duplicates(to_points(shape)); //Points close = priv::collect_close_points(shape, 1.); if (intersections.empty() && duplicits.empty() /* && close.empty() */) break; @@ -353,7 +353,7 @@ bool Emboss::heal_shape(ExPolygons &shape, unsigned max_iteration) svg.draw(shape, "green"); svg.draw(duplicits, "lightgray", 13 / Emboss::SHAPE_SCALE); - Points duplicits3 = collect_duplications(to_points(shape)); + Points duplicits3 = collect_duplicates(to_points(shape)); svg.draw(duplicits3, "black", 7 / Emboss::SHAPE_SCALE); Pointfs pts2 = intersection_points(shape); @@ -387,7 +387,7 @@ bool Emboss::heal_shape(ExPolygons &shape, unsigned max_iteration) } assert(intersection_points(shape).empty()); - assert(collect_duplications(to_points(shape)).empty()); + assert(collect_duplicates(to_points(shape)).empty()); return true; } @@ -1186,7 +1186,7 @@ indexed_triangle_set Emboss::polygons2model(const ExPolygons &shape2d, const IProjection &projection) { Points points = to_points(shape2d); - Points duplicits = collect_duplications(points); + Points duplicits = collect_duplicates(points); return (duplicits.empty()) ? priv::polygons2model_unique(shape2d, projection, points) : priv::polygons2model_duplicit(shape2d, projection, points, duplicits); diff --git a/src/libslic3r/Point.cpp b/src/libslic3r/Point.cpp index 2e282b400..ade8a5621 100644 --- a/src/libslic3r/Point.cpp +++ b/src/libslic3r/Point.cpp @@ -158,7 +158,7 @@ bool has_duplicate_points(std::vector &&pts) return false; } -Points collect_duplications(Points pts /* Copy */) +Points collect_duplicates(Points pts /* Copy */) { std::stable_sort(pts.begin(), pts.end()); Points duplicits; diff --git a/src/libslic3r/Point.hpp b/src/libslic3r/Point.hpp index c4504c211..ae1e88276 100644 --- a/src/libslic3r/Point.hpp +++ b/src/libslic3r/Point.hpp @@ -269,7 +269,7 @@ inline bool has_duplicate_successive_points_closed(const std::vector &pts } // Collect adjecent(duplicit points) -Points collect_duplications(Points pts /* Copy */); +Points collect_duplicates(Points pts /* Copy */); inline bool shorter_then(const Point& p0, const coord_t len) { diff --git a/src/libslic3r/Triangulation.cpp b/src/libslic3r/Triangulation.cpp index a355d725d..f5978d3e9 100644 --- a/src/libslic3r/Triangulation.cpp +++ b/src/libslic3r/Triangulation.cpp @@ -241,7 +241,7 @@ Triangulation::Indices Triangulation::triangulate(const ExPolygon &expolygon){ Triangulation::Indices Triangulation::triangulate(const ExPolygons &expolygons){ Points pts = to_points(expolygons); - Points d_pts = collect_duplications(pts); + Points d_pts = collect_duplicates(pts); if (d_pts.empty()) return triangulate(expolygons, pts); Changes changes = create_changes(pts, d_pts); @@ -262,7 +262,7 @@ Triangulation::Indices Triangulation::triangulate(const ExPolygons &expolygons, { assert(count_points(expolygons) == points.size()); // when contain duplicit coordinate in points will not work properly - assert(collect_duplications(points).empty()); + assert(collect_duplicates(points).empty()); HalfEdges edges; edges.reserve(points.size()); diff --git a/tests/libslic3r/test_emboss.cpp b/tests/libslic3r/test_emboss.cpp index 6a523ed31..ebb1a1792 100644 --- a/tests/libslic3r/test_emboss.cpp +++ b/tests/libslic3r/test_emboss.cpp @@ -201,7 +201,7 @@ ExPolygons heal_and_check(const Polygons &polygons) { Pointfs intersections_prev = intersection_points(polygons); Points polygons_points = to_points(polygons); - Points duplicits_prev = collect_duplications(polygons_points); + Points duplicits_prev = collect_duplicates(polygons_points); ExPolygons shape = Emboss::heal_shape(polygons); @@ -215,7 +215,7 @@ ExPolygons heal_and_check(const Polygons &polygons) Pointfs intersections = intersection_points(shape); Points shape_points = to_points(shape); - Points duplicits = collect_duplications(shape_points); + Points duplicits = collect_duplicates(shape_points); //{ // BoundingBox bb(polygons_points); // // bb.scale(svg_scale);