From 53e566bc520ddb135e5bf24fef643f3525e3b8d5 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 11 Apr 2024 12:36:48 +0200 Subject: [PATCH] Fixed some possible issues CURA-9830 --- include/geometry/polyline.h | 17 +++++------------ src/SkirtBrim.cpp | 7 +------ src/infill.cpp | 3 --- src/utils/PolylineStitcher.cpp | 2 -- src/utils/mixed_polyline_stitcher.cpp | 1 - 5 files changed, 6 insertions(+), 24 deletions(-) diff --git a/include/geometry/polyline.h b/include/geometry/polyline.h index 8f7a162f35..6473811083 100644 --- a/include/geometry/polyline.h +++ b/include/geometry/polyline.h @@ -19,12 +19,12 @@ class OpenPolyline; * \brief Base class for various types of polylines. A polyline is basically a set of points, but * we geometrically interpret them forming a chain of segments between each other. * - * * Open Polyline : this represents a line that does not closes, i.e. the last point is different - * from the initial point + * * Open Polyline : this represents a line that does not close, i.e. the last point is different + * from the initial point (think of the U letter) * * Closed Polyline : a closed polyline has a final segment joining the last point and the - * initial one - * * Filled Polyline : this is a particular type of closed polyline, for which we consider that the - * "inside" part of the line forms a surface + * initial one (think of the O letter) + * * Polygon : this is a particular type of closed polyline, for which we consider that the + * "inside" part of the line forms a surface * * \note Historically, the open and closed polylines were not explicitely differenciated, so * sometimes we would use an open polyline with an extra point at the end, which virtually @@ -134,13 +134,6 @@ class Polyline : public PointsSet */ void simplify(const coord_t smallest_line_segment_squared = MM2INT(0.01) * MM2INT(0.01), const coord_t allowed_error_distance_squared = 25); - /*void pseudoClose() - { - if (size() >= 2) - { - push_back(front()); - } - }*/ private: /*! diff --git a/src/SkirtBrim.cpp b/src/SkirtBrim.cpp index 13f691c178..cee9bc4caf 100644 --- a/src/SkirtBrim.cpp +++ b/src/SkirtBrim.cpp @@ -242,12 +242,7 @@ coord_t SkirtBrim::generateOffset(const Offset& offset, Shape& covered_area, std const int reference_idx = std::get(offset.reference_outline_or_index_); const coord_t offset_dist = extruder_config.line_width_; - Shape local_brim = storage_.skirt_brim[offset.extruder_nr_][reference_idx].offset(offset_dist, ClipperLib::jtRound); - -#warning Is this required now we do all the offsetting in one pass ? - local_brim.unionPolygons(); - - brim.push_back(local_brim); + brim.push_back(storage_.skirt_brim[offset.extruder_nr_][reference_idx].offset(offset_dist, ClipperLib::jtRound)); } // limit brim lines to allowed areas, stitch them and store them in the result diff --git a/src/infill.cpp b/src/infill.cpp index 6f15f2a1c1..b1e0ca40a4 100644 --- a/src/infill.cpp +++ b/src/infill.cpp @@ -540,10 +540,7 @@ void Infill::generateCrossInfill(const SierpinskiFillProvider& cross_fill_provid else { // make the polyline closed in order to handle cross_pattern_polygon as a polyline, rather than a closed polygon - cross_pattern_polygon.push_back(cross_pattern_polygon[0]); - LinesSet cross_pattern_polylines; -#warning No sure we should add the last point in this case cross_pattern_polylines.push_back(cross_pattern_polygon.toPseudoOpenPolyline()); LinesSet poly_lines = inner_contour_.intersection(cross_pattern_polylines); OpenPolylineStitcher::stitch(poly_lines, result_lines, result_polygons, infill_line_width_); diff --git a/src/utils/PolylineStitcher.cpp b/src/utils/PolylineStitcher.cpp index efc78b15c9..49e632647d 100644 --- a/src/utils/PolylineStitcher.cpp +++ b/src/utils/PolylineStitcher.cpp @@ -284,14 +284,12 @@ void ExtrusionLineStitcher::pushToClosedResult(VariableWidthLines& result_polygo template<> void OpenPolylineStitcher::pushToClosedResult(Shape& result_polygons, const OpenPolyline& polyline) { -#warning Check whether the polyline is explicitely closed result_polygons.emplace_back(polyline.getPoints(), true); } template<> void PolylineStitcher::pushToClosedResult(ClosedLinesSet& result_polygons, const OpenPolyline& polyline) { -#warning Check whether the polyline is explicitely closed result_polygons.emplace_back(polyline.getPoints(), true); } diff --git a/src/utils/mixed_polyline_stitcher.cpp b/src/utils/mixed_polyline_stitcher.cpp index 85e3e017b9..8095231d73 100644 --- a/src/utils/mixed_polyline_stitcher.cpp +++ b/src/utils/mixed_polyline_stitcher.cpp @@ -23,7 +23,6 @@ void MixedPolylineStitcher::stitch(const LinesSet& lines, MixedLin { // Base stitch method will create explicitely closed polylines, but won't tag them as such // because it is a generic algorithm. Tag them now. -#warning Make sure that what is said here is true closed_line.setExplicitelyClosed(true); }