mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-17 05:35:57 +08:00
Rename function: collect_duplications -> collect_duplicates
more english correct name
This commit is contained in:
parent
d330bbc54b
commit
b1f9d50aad
@ -283,7 +283,7 @@ ExPolygons Emboss::heal_shape(const Polygons &shape) {
|
|||||||
|
|
||||||
// Do not remove all duplicits but do it better way
|
// Do not remove all duplicits but do it better way
|
||||||
// Overlap all duplicit points by rectangle 3x3
|
// Overlap all duplicit points by rectangle 3x3
|
||||||
Points duplicits = collect_duplications(to_points(polygons));
|
Points duplicits = collect_duplicates(to_points(polygons));
|
||||||
if (!duplicits.empty()) {
|
if (!duplicits.empty()) {
|
||||||
polygons.reserve(polygons.size() + duplicits.size());
|
polygons.reserve(polygons.size() + duplicits.size());
|
||||||
for (const Point &p : duplicits) {
|
for (const Point &p : duplicits) {
|
||||||
@ -310,7 +310,7 @@ bool Emboss::heal_shape(ExPolygons &shape, unsigned max_iteration)
|
|||||||
priv::remove_same_neighbor(shape);
|
priv::remove_same_neighbor(shape);
|
||||||
|
|
||||||
Pointfs intersections = intersection_points(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.);
|
//Points close = priv::collect_close_points(shape, 1.);
|
||||||
if (intersections.empty() && duplicits.empty() /* && close.empty() */) break;
|
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(shape, "green");
|
||||||
|
|
||||||
svg.draw(duplicits, "lightgray", 13 / Emboss::SHAPE_SCALE);
|
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);
|
svg.draw(duplicits3, "black", 7 / Emboss::SHAPE_SCALE);
|
||||||
|
|
||||||
Pointfs pts2 = intersection_points(shape);
|
Pointfs pts2 = intersection_points(shape);
|
||||||
@ -387,7 +387,7 @@ bool Emboss::heal_shape(ExPolygons &shape, unsigned max_iteration)
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert(intersection_points(shape).empty());
|
assert(intersection_points(shape).empty());
|
||||||
assert(collect_duplications(to_points(shape)).empty());
|
assert(collect_duplicates(to_points(shape)).empty());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1186,7 +1186,7 @@ indexed_triangle_set Emboss::polygons2model(const ExPolygons &shape2d,
|
|||||||
const IProjection &projection)
|
const IProjection &projection)
|
||||||
{
|
{
|
||||||
Points points = to_points(shape2d);
|
Points points = to_points(shape2d);
|
||||||
Points duplicits = collect_duplications(points);
|
Points duplicits = collect_duplicates(points);
|
||||||
return (duplicits.empty()) ?
|
return (duplicits.empty()) ?
|
||||||
priv::polygons2model_unique(shape2d, projection, points) :
|
priv::polygons2model_unique(shape2d, projection, points) :
|
||||||
priv::polygons2model_duplicit(shape2d, projection, points, duplicits);
|
priv::polygons2model_duplicit(shape2d, projection, points, duplicits);
|
||||||
|
@ -158,7 +158,7 @@ bool has_duplicate_points(std::vector<Point> &&pts)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Points collect_duplications(Points pts /* Copy */)
|
Points collect_duplicates(Points pts /* Copy */)
|
||||||
{
|
{
|
||||||
std::stable_sort(pts.begin(), pts.end());
|
std::stable_sort(pts.begin(), pts.end());
|
||||||
Points duplicits;
|
Points duplicits;
|
||||||
|
@ -269,7 +269,7 @@ inline bool has_duplicate_successive_points_closed(const std::vector<Point> &pts
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Collect adjecent(duplicit points)
|
// 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)
|
inline bool shorter_then(const Point& p0, const coord_t len)
|
||||||
{
|
{
|
||||||
|
@ -241,7 +241,7 @@ Triangulation::Indices Triangulation::triangulate(const ExPolygon &expolygon){
|
|||||||
|
|
||||||
Triangulation::Indices Triangulation::triangulate(const ExPolygons &expolygons){
|
Triangulation::Indices Triangulation::triangulate(const ExPolygons &expolygons){
|
||||||
Points pts = to_points(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);
|
if (d_pts.empty()) return triangulate(expolygons, pts);
|
||||||
|
|
||||||
Changes changes = create_changes(pts, d_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());
|
assert(count_points(expolygons) == points.size());
|
||||||
// when contain duplicit coordinate in points will not work properly
|
// when contain duplicit coordinate in points will not work properly
|
||||||
assert(collect_duplications(points).empty());
|
assert(collect_duplicates(points).empty());
|
||||||
|
|
||||||
HalfEdges edges;
|
HalfEdges edges;
|
||||||
edges.reserve(points.size());
|
edges.reserve(points.size());
|
||||||
|
@ -201,7 +201,7 @@ ExPolygons heal_and_check(const Polygons &polygons)
|
|||||||
{
|
{
|
||||||
Pointfs intersections_prev = intersection_points(polygons);
|
Pointfs intersections_prev = intersection_points(polygons);
|
||||||
Points polygons_points = to_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);
|
ExPolygons shape = Emboss::heal_shape(polygons);
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ ExPolygons heal_and_check(const Polygons &polygons)
|
|||||||
|
|
||||||
Pointfs intersections = intersection_points(shape);
|
Pointfs intersections = intersection_points(shape);
|
||||||
Points shape_points = to_points(shape);
|
Points shape_points = to_points(shape);
|
||||||
Points duplicits = collect_duplications(shape_points);
|
Points duplicits = collect_duplicates(shape_points);
|
||||||
//{
|
//{
|
||||||
// BoundingBox bb(polygons_points);
|
// BoundingBox bb(polygons_points);
|
||||||
// // bb.scale(svg_scale);
|
// // bb.scale(svg_scale);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user