Skip to content

Commit 53d1ae7

Browse files
authored
CURA-12249 Remove "None" seam corner preference (#2244)
2 parents 086393a + 834c5cc commit 53d1ae7

7 files changed

Lines changed: 20 additions & 19 deletions

File tree

include/PathOrderOptimizer.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,9 +765,7 @@ class PathOrderOptimizer
765765
{
766766
main_criterion.criterion = std::make_shared<DistanceScoringCriterion>(points, target_pos);
767767
}
768-
else if (
769-
path.seam_config_.type_ == EZSeamType::SHARPEST_CORNER
770-
&& (path.seam_config_.corner_pref_ != EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE && path.seam_config_.corner_pref_ != EZSeamCornerPrefType::PLUGIN))
768+
else if (path.seam_config_.type_ == EZSeamType::SHARPEST_CORNER && path.seam_config_.corner_pref_ != EZSeamCornerPrefType::PLUGIN)
771769
{
772770
main_criterion.criterion = std::make_shared<CornerScoringCriterion>(points, path.seam_config_.corner_pref_);
773771
}

include/settings/EnumSettings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ enum class EZSeamType
9393

9494
enum class EZSeamCornerPrefType
9595
{
96-
Z_SEAM_CORNER_PREF_NONE,
9796
Z_SEAM_CORNER_PREF_INNER,
9897
Z_SEAM_CORNER_PREF_OUTER,
9998
Z_SEAM_CORNER_PREF_ANY,

include/settings/ZSeamConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct ZSeamConfig
5252
ZSeamConfig(
5353
const EZSeamType type = EZSeamType::SHORTEST,
5454
const Point2LL pos = Point2LL(0, 0),
55-
const EZSeamCornerPrefType corner_pref = EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE,
55+
const EZSeamCornerPrefType corner_pref = EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER,
5656
const coord_t simplify_curvature = 0);
5757
};
5858

src/FffGcodeWriter.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,11 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage)
717717
if (! raft_paths.empty())
718718
{
719719
const GCodePathConfig& config = gcode_layer.configs_storage_.raft_base_config;
720-
const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE, false);
720+
const ZSeamConfig z_seam_config(
721+
EZSeamType::SHORTEST,
722+
gcode_layer.getLastPlannedPositionOrStartingPosition(),
723+
EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER,
724+
false);
721725
InsetOrderOptimizer wall_orderer(
722726
*this,
723727
storage,
@@ -880,7 +884,7 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage)
880884
if (! raft_paths.empty())
881885
{
882886
const GCodePathConfig& config = gcode_layer.configs_storage_.raft_interface_config;
883-
const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE, false);
887+
const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER, false);
884888
InsetOrderOptimizer wall_orderer(
885889
*this,
886890
storage,
@@ -1051,7 +1055,11 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage)
10511055

10521056
if (! raft_paths.empty())
10531057
{
1054-
const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE, false);
1058+
const ZSeamConfig z_seam_config(
1059+
EZSeamType::SHORTEST,
1060+
gcode_layer.getLastPlannedPositionOrStartingPosition(),
1061+
EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER,
1062+
false);
10551063
InsetOrderOptimizer wall_orderer(
10561064
*this,
10571065
storage,
@@ -4011,7 +4019,7 @@ bool FffGcodeWriter::processSupportInfill(const SliceDataStorage& storage, Layer
40114019
constexpr coord_t wipe_dist = 0;
40124020
const LayerIndex layer_nr = gcode_layer.getLayerNr();
40134021
ZSeamConfig z_seam_config
4014-
= ZSeamConfig(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE, false);
4022+
= ZSeamConfig(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER, false);
40154023
Shape disallowed_area_for_seams{};
40164024
if (infill_extruder.settings_.get<bool>("support_z_seam_away_from_model") && (layer_nr >= 0))
40174025
{
@@ -4216,7 +4224,7 @@ bool FffGcodeWriter::processSupportInfill(const SliceDataStorage& storage, Layer
42164224
const ZSeamConfig z_seam_config(
42174225
EZSeamType::SHORTEST,
42184226
gcode_layer.getLastPlannedPositionOrStartingPosition(),
4219-
EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE,
4227+
EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER,
42204228
simplify_curvature);
42214229
InsetOrderOptimizer wall_orderer(
42224230
*this,
@@ -4354,7 +4362,7 @@ bool FffGcodeWriter::addSupportRoofsToGCode(const SliceDataStorage& storage, con
43544362
const GCodePathConfig& config = current_roof_config;
43554363
constexpr bool retract_before_outer_wall = false;
43564364
constexpr coord_t wipe_dist = 0;
4357-
const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE, false);
4365+
const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER, false);
43584366

43594367
InsetOrderOptimizer wall_orderer(
43604368
*this,
@@ -4470,7 +4478,7 @@ bool FffGcodeWriter::addSupportBottomsToGCode(const SliceDataStorage& storage, L
44704478
const GCodePathConfig& config = gcode_layer.configs_storage_.support_bottom_config;
44714479
constexpr bool retract_before_outer_wall = false;
44724480
constexpr coord_t wipe_dist = 0;
4473-
const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE, false);
4481+
const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER, false);
44744482

44754483
InsetOrderOptimizer wall_orderer(
44764484
*this,

src/TopSurface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ bool TopSurface::ironing(const SliceDataStorage& storage, const SliceMeshStorage
164164
{
165165
constexpr bool retract_before_outer_wall = false;
166166
constexpr coord_t wipe_dist = 0u;
167-
const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE, false);
167+
const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER, false);
168168
InsetOrderOptimizer wall_orderer(
169169
gcode_writer,
170170
storage,

src/settings/Settings.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,6 @@ EZSeamCornerPrefType Settings::get<EZSeamCornerPrefType>(const std::string& key)
546546
using namespace cura::utils;
547547
switch (hash_enum(value))
548548
{
549-
case "z_seam_corner_none"_sw:
550-
return EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE;
551-
case "z_seam_corner_inner"_sw:
552-
return EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER;
553549
case "z_seam_corner_outer"_sw:
554550
return EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_OUTER;
555551
case "z_seam_corner_any"_sw:
@@ -558,8 +554,9 @@ EZSeamCornerPrefType Settings::get<EZSeamCornerPrefType>(const std::string& key)
558554
return EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_WEIGHTED;
559555
case "plugin"_sw:
560556
return EZSeamCornerPrefType::PLUGIN;
557+
case "z_seam_corner_inner"_sw:
561558
default:
562-
return EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE;
559+
return EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER;
563560
}
564561
}
565562

src/utils/scoring/CornerScoringCriterion.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ double CornerScoringCriterion::computeScore(const size_t candidate_index) const
6060
score = corner_angle / 2.0;
6161
}
6262
break;
63-
case EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE:
6463
case EZSeamCornerPrefType::PLUGIN:
6564
break;
6665
}

0 commit comments

Comments
 (0)