Skip to content

Commit

Permalink
Refactor variable name to 'disallowed_areas_for_seams'
Browse files Browse the repository at this point in the history
Renamed the variable 'disallowed_area' to 'disallowed_areas_for_seams' in different files for more accurate representation.

CURA-11227
  • Loading branch information
saumyaj3 committed May 3, 2024
1 parent c3d155d commit 962a5a4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 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 = {});
const Polygons& 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_;
Polygons disallowed_areas_for_seams_;

std::vector<std::vector<ConstPolygonPointer>> inset_polys_; // vector of vectors holding the inset polygons
Polygons 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
12 changes: 6 additions & 6 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;
Polygons disallowed_area_for_seams;
/*!
* After optimizing, this contains the paths that need to be printed in the
* correct order.
Expand Down Expand Up @@ -113,15 +113,15 @@ 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 = {})
const Polygons& disallowed_areas_for_seams = {})
: start_point_(start_point)
, seam_config_(seam_config)
, combing_boundary_((combing_boundary != nullptr && ! combing_boundary->empty()) ? combing_boundary : nullptr)
, detect_loops_(detect_loops)
, reverse_direction_(reverse_direction)
, _group_outer_walls(group_outer_walls)
, order_requirements_(&order_requirements)
, disallowed_area{ disallowed_areas }
, disallowed_area_for_seams{ disallowed_areas_for_seams }

{
}
Expand Down Expand Up @@ -634,10 +634,10 @@ class PathOrderOptimizer
size_t path_size = path.converted_->size();
if (path_size > number_of_paths_analysed)
{
if (! disallowed_area.empty())
if (! disallowed_area_for_seams.empty())
{
Point2LL current_candidate = (path.converted_)->at(best_pos);
if (disallowed_area.inside(current_candidate, true))
if (disallowed_area_for_seams.inside(current_candidate, true))
{
size_t next_best_position = (path_size > best_pos + 1) ? best_pos + 1 : 0;
number_of_paths_analysed += 1;
Expand Down Expand Up @@ -792,7 +792,7 @@ class PathOrderOptimizer
}
}

if (! disallowed_area.empty())
if (! disallowed_area_for_seams.empty())
{
best_i = pathIfZseamIsInDisallowedArea(best_i, path, 0);
}
Expand Down
10 changes: 5 additions & 5 deletions src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3459,21 +3459,21 @@ 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{};
Polygons 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.add(part.print_outline);
disallowed_area_for_seams.add(part.print_outline);
}
}
if (! disallowed_area.empty())
if (! disallowed_area_for_seams.empty())
{
coord_t min_distance = infill_extruder.settings_.get<coord_t>("support_z_seam_min_distance");
disallowed_area = disallowed_area.offset(min_distance, ClipperLib::jtRound);
disallowed_area_for_seams = disallowed_area_for_seams.offset(min_distance, ClipperLib::jtRound);
}
}

Expand All @@ -3496,7 +3496,7 @@ bool FffGcodeWriter::processSupportInfill(const SliceDataStorage& storage, Layer
extruder_nr,
z_seam_config,
wall_toolpaths,
disallowed_area);
disallowed_area_for_seams);
added_something |= wall_orderer.addToLayer();
}

Expand Down
6 changes: 3 additions & 3 deletions 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)
const Polygons& disallowed_areas_for_seams)
: gcode_writer_(gcode_writer)
, storage_(storage)
, gcode_layer_(gcode_layer)
Expand All @@ -71,7 +71,7 @@ InsetOrderOptimizer::InsetOrderOptimizer(
, z_seam_config_(z_seam_config)
, paths_(paths)
, layer_nr_(gcode_layer.getLayerNr())
, disallowed_areas_{ disallowed_areas }
, disallowed_areas_for_seams_{ disallowed_areas_for_seams }
{
}

Expand Down Expand Up @@ -108,7 +108,7 @@ bool InsetOrderOptimizer::addToLayer()
reverse,
order,
group_outer_walls,
disallowed_areas_);
disallowed_areas_for_seams_);

for (const auto& line : walls_to_be_added)
{
Expand Down

0 comments on commit 962a5a4

Please sign in to comment.