From 53cd4b070aa04fce054420a3899ff7b7952cc767 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 3 May 2024 18:23:57 +0200 Subject: [PATCH] Replace 'Polygons' with 'Shape' for 'disallowed_area_for_seams' The type of 'disallowed_area_for_seams' has been changed from 'Polygons' to 'Shape' in PathOrderOptimizer.h, FffGcodeWriter.cpp, InsetOrderOptimizer.cpp, and InsetOrderOptimizer.h. The change was made to increase code readability and maintainability. Also, the usage of 'disallowed_area_for_seams' has been adjusted accordingly in the respective files. Contribute to CURA-9830 --- include/InsetOrderOptimizer.h | 4 ++-- include/PathOrderOptimizer.h | 4 ++-- src/FffGcodeWriter.cpp | 4 ++-- src/InsetOrderOptimizer.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/InsetOrderOptimizer.h b/include/InsetOrderOptimizer.h index 67c97ec161..f03a7fc461 100644 --- a/include/InsetOrderOptimizer.h +++ b/include/InsetOrderOptimizer.h @@ -56,7 +56,7 @@ class InsetOrderOptimizer const size_t wall_x_extruder_nr, const ZSeamConfig& z_seam_config, const std::vector& paths, - const Polygons& disallowed_areas_for_seams = {}); + const Shape& disallowed_areas_for_seams = {}); /*! * Adds the insets to the given layer plan. @@ -107,7 +107,7 @@ class InsetOrderOptimizer const ZSeamConfig& z_seam_config_; const std::vector& paths_; const LayerIndex layer_nr_; - Polygons disallowed_areas_for_seams_; + Shape disallowed_areas_for_seams_; std::vector> inset_polys_; // vector of vectors holding the inset polygons Shape retraction_region_; // After printing an outer wall, move into this region so that retractions do not leave visible blobs. Calculated lazily if needed (see diff --git a/include/PathOrderOptimizer.h b/include/PathOrderOptimizer.h index 2ee8589d83..cf54338a06 100644 --- a/include/PathOrderOptimizer.h +++ b/include/PathOrderOptimizer.h @@ -62,7 +62,7 @@ class PathOrderOptimizer public: using OrderablePath = PathOrdering; /* Areas defined here are not allowed to have the start the prints */ - Polygons disallowed_area_for_seams; + Shape disallowed_area_for_seams; /*! * After optimizing, this contains the paths that need to be printed in the * correct order. @@ -113,7 +113,7 @@ class PathOrderOptimizer const bool reverse_direction = false, const std::unordered_multimap& order_requirements = no_order_requirements_, const bool group_outer_walls = false, - const Polygons& disallowed_areas_for_seams = {}) + const Shape& disallowed_areas_for_seams = {}) : start_point_(start_point) , seam_config_(seam_config) , combing_boundary_((combing_boundary != nullptr && ! combing_boundary->empty()) ? combing_boundary : nullptr) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index c146a2e7ec..dfba3f7ed8 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -3442,7 +3442,7 @@ bool FffGcodeWriter::processSupportInfill(const SliceDataStorage& storage, Layer constexpr coord_t wipe_dist = 0; ZSeamConfig z_seam_config = ZSeamConfig(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE, false); - Polygons disallowed_area_for_seams{}; + Shape disallowed_area_for_seams{}; if (infill_extruder.settings_.get("support_z_seam_away_from_model")) { for (std::shared_ptr mesh_ptr : storage.meshes) @@ -3450,7 +3450,7 @@ bool FffGcodeWriter::processSupportInfill(const SliceDataStorage& storage, Layer auto& mesh = *mesh_ptr; for (auto& part : mesh.layers[gcode_layer.getLayerNr()].parts) { - disallowed_area_for_seams.add(part.print_outline); + disallowed_area_for_seams.push_back(part.print_outline); } } if (! disallowed_area_for_seams.empty()) diff --git a/src/InsetOrderOptimizer.cpp b/src/InsetOrderOptimizer.cpp index f2b3f5fc2d..7be4d8f6ba 100644 --- a/src/InsetOrderOptimizer.cpp +++ b/src/InsetOrderOptimizer.cpp @@ -51,7 +51,7 @@ InsetOrderOptimizer::InsetOrderOptimizer( const size_t wall_x_extruder_nr, const ZSeamConfig& z_seam_config, const std::vector& paths, - const Polygons& disallowed_areas_for_seams) + const Shape& disallowed_areas_for_seams) : gcode_writer_(gcode_writer) , storage_(storage) , gcode_layer_(gcode_layer)