diff --git a/include/PathOrderOptimizer.h b/include/PathOrderOptimizer.h index 2d339e79f8..f50482d4ad 100644 --- a/include/PathOrderOptimizer.h +++ b/include/PathOrderOptimizer.h @@ -738,29 +738,26 @@ class PathOrderOptimizer BestElementFinder::WeighedCriterion main_criterion; - if (path.force_start_index_.has_value()) // Actually handles EZSeamType::USER_SPECIFIED + if (path.force_start_index_.has_value()) // Handles EZSeamType::USER_SPECIFIED with "seam_on_vertex" disabled { // Use a much smaller distance divider because we want points around the forced points to be filtered out very easily constexpr double distance_divider = 1.0; constexpr auto distance_type = DistanceScoringCriterion::DistanceType::Euclidian; main_criterion.criterion = std::make_shared(points, points.at(path.force_start_index_.value()), distance_type, distance_divider); } - else + else if (path.seam_config_.type_ == EZSeamType::SHORTEST || path.seam_config_.type_ == EZSeamType::USER_SPECIFIED) { - if (path.seam_config_.type_ == EZSeamType::SHORTEST) - { - main_criterion.criterion = std::make_shared(points, target_pos); - } - else if ( - path.seam_config_.type_ == EZSeamType::SHARPEST_CORNER - && (path.seam_config_.corner_pref_ != EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE && path.seam_config_.corner_pref_ != EZSeamCornerPrefType::PLUGIN)) - { - main_criterion.criterion = std::make_shared(points, path.seam_config_.corner_pref_); - } - else if (path.seam_config_.type_ == EZSeamType::RANDOM) - { - main_criterion.criterion = std::make_shared(); - } + main_criterion.criterion = std::make_shared(points, target_pos); + } + else if ( + path.seam_config_.type_ == EZSeamType::SHARPEST_CORNER + && (path.seam_config_.corner_pref_ != EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE && path.seam_config_.corner_pref_ != EZSeamCornerPrefType::PLUGIN)) + { + main_criterion.criterion = std::make_shared(points, path.seam_config_.corner_pref_); + } + else if (path.seam_config_.type_ == EZSeamType::RANDOM) + { + main_criterion.criterion = std::make_shared(); } if (main_criterion.criterion)