Skip to content

Commit

Permalink
Replace 'Polygons' with 'Shape' for 'disallowed_area_for_seams'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jellespijker committed May 3, 2024
1 parent d4f04e5 commit 53cd4b0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/InsetOrderOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class InsetOrderOptimizer
const size_t wall_x_extruder_nr,
const ZSeamConfig& z_seam_config,
const std::vector<VariableWidthLines>& paths,
const Polygons& disallowed_areas_for_seams = {});
const Shape& disallowed_areas_for_seams = {});

/*!
* Adds the insets to the given layer plan.
Expand Down Expand Up @@ -107,7 +107,7 @@ class InsetOrderOptimizer
const ZSeamConfig& z_seam_config_;
const std::vector<VariableWidthLines>& paths_;
const LayerIndex layer_nr_;
Polygons disallowed_areas_for_seams_;
Shape disallowed_areas_for_seams_;

std::vector<std::vector<const Polygon*>> 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
Expand Down
4 changes: 2 additions & 2 deletions include/PathOrderOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class PathOrderOptimizer
public:
using OrderablePath = PathOrdering<Path>;
/* 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.
Expand Down Expand Up @@ -113,7 +113,7 @@ class PathOrderOptimizer
const bool reverse_direction = false,
const std::unordered_multimap<Path, Path>& 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)
Expand Down
4 changes: 2 additions & 2 deletions src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3442,15 +3442,15 @@ 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<bool>("support_z_seam_away_from_model"))
{
for (std::shared_ptr<SliceMeshStorage> mesh_ptr : storage.meshes)
{
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())
Expand Down
2 changes: 1 addition & 1 deletion src/InsetOrderOptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ InsetOrderOptimizer::InsetOrderOptimizer(
const size_t wall_x_extruder_nr,
const ZSeamConfig& z_seam_config,
const std::vector<VariableWidthLines>& paths,
const Polygons& disallowed_areas_for_seams)
const Shape& disallowed_areas_for_seams)
: gcode_writer_(gcode_writer)
, storage_(storage)
, gcode_layer_(gcode_layer)
Expand Down

0 comments on commit 53cd4b0

Please sign in to comment.