Skip to content

Commit

Permalink
fix infinite loop & 0-width perimeter in mmu bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Jul 4, 2024
2 parents 0f976e8 + 0c10d20 commit c4713c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/libslic3r/Config.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "Config.hpp"
#include "Preset.hpp"
#include "Flow.hpp"
#include "format.hpp"
#include "Preset.hpp"
#include "Utils.hpp"
#include "LocalesUtils.hpp"

Expand Down Expand Up @@ -1053,7 +1054,7 @@ double ConfigBase::get_computed_value(const t_config_option_key &opt_key, int ex
if (raw_opt->type() == coFloatOrPercent) {
auto cofop = static_cast<const ConfigOptionFloatOrPercent*>(raw_opt);
if (cofop->value == 0 && boost::ends_with(opt_key, "_extrusion_width")) {
return this->get_computed_value("extrusion_width");
return Flow::extrusion_width(opt_key, *this, extruder_id);
}
if (!cofop->percent)
return cofop->value;
Expand Down
9 changes: 7 additions & 2 deletions src/libslic3r/GCode/SeamPlacer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,13 @@ void process_perimeter_polylines(const PolylineWithEnd &orig_polyline, float z_c
}
std::vector<size_t> viable_points_indices;
std::vector<size_t> large_angle_points_indices;
for (size_t point_idx = longest_patch.first; point_idx != longest_patch.second;
point_idx = next_index(point_idx)) {
assert(longest_patch.first >= perimeter.start_index && longest_patch.first <= perimeter.end_index);
assert(longest_patch.second >= perimeter.start_index && longest_patch.second <= perimeter.end_index);
assert(is_polygon || longest_patch.first <= longest_patch.second);
for (size_t point_idx = longest_patch.first;
point_idx != longest_patch.second;
point_idx = is_polygon ? next_index(point_idx) : (1 + point_idx)) {
size_t viable_points_indices_count = viable_points_indices.size();
viable_points_indices.push_back(point_idx);
if (std::abs(result.points[point_idx].local_ccw_angle)
> SeamPlacer::sharp_angle_snapping_threshold) {
Expand Down

0 comments on commit c4713c7

Please sign in to comment.