diff options
author | Lukas Matena <lukasmatena@seznam.cz> | 2022-03-31 15:27:16 +0300 |
---|---|---|
committer | Lukas Matena <lukasmatena@seznam.cz> | 2022-03-31 15:27:18 +0300 |
commit | 5690cb8c2f008ffbdc8948f9546cef80911b24fb (patch) | |
tree | 05f286f6e45ceb9d8a29e5b8352c883ab7595060 | |
parent | 2ecfdea0703d8cd77fa76d456ada0d825fedc145 (diff) |
Fixup of previous commit:lm_layer_check_fix
the previous fix only works for objects that have equal height
-rw-r--r-- | src/libslic3r/Print.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 76c32336e..3198f6795 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -541,16 +541,17 @@ std::string Print::validate(std::string* warning) const // a copy of another, or when a layer height modifier is used the same way on both objects. // The latter case might create a floating point inaccuracy mismatch, so compare // element-wise using an epsilon check. - bool profiles_equal = layer_height_profiles[idx_object].size() == layer_height_profiles[tallest_object_idx].size(); size_t i = 0; const coordf_t eps = 0.5 * EPSILON; // layers closer than EPSILON will be merged later. Let's make // this check a bit more sensitive to make sure we never consider two different layers as one. - while (profiles_equal && i < layer_height_profiles[idx_object].size()) { - profiles_equal = (std::abs(layer_height_profiles[idx_object][i] - layer_height_profiles[tallest_object_idx][i]) < eps); + while (i < layer_height_profiles[idx_object].size() + && i < layer_height_profiles[tallest_object_idx].size()) { + if (i%2 == 0 && layer_height_profiles[tallest_object_idx][i] > layer_height_profiles[idx_object][layer_height_profiles[idx_object].size() - 2 ]) + break; + if (! std::abs(layer_height_profiles[idx_object][i] - layer_height_profiles[tallest_object_idx][i]) < eps) + return L("The Wipe tower is only supported if all objects have the same variable layer height"); ++i; } - if (! profiles_equal) - return L("The Wipe tower is only supported if all objects have the same variable layer height"); } } } |