Rename function: collect_duplications -> collect_duplicates

more english correct name
This commit is contained in:
Filip Sykala - NTB T15p 2022-11-29 13:52:47 +01:00
parent d330bbc54b
commit b1f9d50aad
5 changed files with 11 additions and 11 deletions

View File

@ -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);

View File

@ -158,7 +158,7 @@ bool has_duplicate_points(std::vector<Point> &&pts)
return false;
}
Points collect_duplications(Points pts /* Copy */)
Points collect_duplicates(Points pts /* Copy */)
{
std::stable_sort(pts.begin(), pts.end());
Points duplicits;

View File

@ -269,7 +269,7 @@ inline bool has_duplicate_successive_points_closed(const std::vector<Point> &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)
{

View File

@ -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());

View File

@ -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);