diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index 0da5e73808..41d5231f16 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -705,7 +705,7 @@ bool CLI::setup(int argc, char **argv) // Initialize with defaults. for (const t_optiondef_map *options : { &cli_actions_config_def.options, &cli_transform_config_def.options, &cli_misc_config_def.options }) - for (const std::pair &optdef : *options) + for (const t_optiondef_map::value_type &optdef : *options) m_config.option(optdef.first, true); set_data_dir(m_config.opt_string("datadir")); diff --git a/src/libnest2d/include/libnest2d/placers/nfpplacer.hpp b/src/libnest2d/include/libnest2d/placers/nfpplacer.hpp index 47ba7bbdc5..00f6a999fb 100644 --- a/src/libnest2d/include/libnest2d/placers/nfpplacer.hpp +++ b/src/libnest2d/include/libnest2d/placers/nfpplacer.hpp @@ -577,7 +577,7 @@ private: template - Shapes calcnfp(const Item &trsh, Level) + Shapes calcnfp(const Item &/*trsh*/, Level) { // Function for arbitrary level of nfp implementation // TODO: implement diff --git a/src/libnest2d/include/libnest2d/placers/placer_boilerplate.hpp b/src/libnest2d/include/libnest2d/placers/placer_boilerplate.hpp index dc1bbd4f1f..486996f0d6 100644 --- a/src/libnest2d/include/libnest2d/placers/placer_boilerplate.hpp +++ b/src/libnest2d/include/libnest2d/placers/placer_boilerplate.hpp @@ -33,7 +33,8 @@ public: PackResult(Item& item): item_ptr_(&item), move_(item.translation()), - rot_(item.rotation()) {} + rot_(item.rotation()), + overfit_(1.0) {} PackResult(double overfit = 1.0): item_ptr_(nullptr), overfit_(overfit) {} diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index ff0a7c0273..116fcbe7fb 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2807,7 +2807,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, gcode += this->unretract(); // adjust acceleration - { + if (m_config.default_acceleration.value > 0) { double acceleration; if (this->on_first_layer() && m_config.first_layer_acceleration.value > 0) { acceleration = m_config.first_layer_acceleration.value; diff --git a/src/libslic3r/SLA/ConcaveHull.cpp b/src/libslic3r/SLA/ConcaveHull.cpp index 1724089894..cfce36d162 100644 --- a/src/libslic3r/SLA/ConcaveHull.cpp +++ b/src/libslic3r/SLA/ConcaveHull.cpp @@ -40,36 +40,6 @@ Point ConcaveHull::centroid(const Points &pp) return c; } -// As it shows, the current offset_ex in ClipperUtils hangs if used in jtRound -// mode -template -static ClipperLib::Paths fast_offset(PolygonsProvider &&paths, - coord_t delta, - ClipperLib::JoinType jointype) -{ - using ClipperLib::ClipperOffset; - using ClipperLib::etClosedPolygon; - using ClipperLib::Paths; - using ClipperLib::Path; - - ClipperOffset offs; - offs.ArcTolerance = scaled(0.01); - - for (auto &p : paths) - // If the input is not at least a triangle, we can not do this algorithm - if(p.size() < 3) { - BOOST_LOG_TRIVIAL(error) << "Invalid geometry for offsetting!"; - return {}; - } - - offs.AddPaths(std::forward(paths), jointype, etClosedPolygon); - - Paths result; - offs.Execute(result, static_cast(delta)); - - return result; -} - Points ConcaveHull::calculate_centroids() const { // We get the centroids of all the islands in the 2D slice @@ -158,15 +128,17 @@ ExPolygons ConcaveHull::to_expolygons() const ExPolygons offset_waffle_style_ex(const ConcaveHull &hull, coord_t delta) { - ExPolygons ret = ClipperPaths_to_Slic3rExPolygons( - fast_offset(fast_offset(ClipperUtils::PolygonsProvider(hull.polygons()), 2 * delta, ClipperLib::jtRound), -delta, ClipperLib::jtRound)); - for (ExPolygon &p : ret) p.holes.clear(); - return ret; + return to_expolygons(offset_waffle_style(hull, delta)); } Polygons offset_waffle_style(const ConcaveHull &hull, coord_t delta) { - return to_polygons(offset_waffle_style_ex(hull, delta)); + Polygons res = closing(hull.polygons(), 2 * delta, delta, ClipperLib::jtRound); + + auto it = std::remove_if(res.begin(), res.end(), [](Polygon &p) { return p.is_clockwise(); }); + res.erase(it, res.end()); + + return res; } }} // namespace Slic3r::sla diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 1bc5489145..43ac958b59 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -1216,7 +1216,7 @@ DynamicConfig SLAPrintStatistics::config() const DynamicConfig SLAPrintStatistics::placeholders() { DynamicConfig config; - for (const std::string &key : { + for (const char *key : { "print_time", "total_cost", "total_weight", "objects_used_material", "support_used_material" }) config.set_key_value(key, new ConfigOptionString(std::string("{") + key + "}")); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp index d45a2e6137..614e838114 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp @@ -621,7 +621,7 @@ RENDER_AGAIN: ImGui::PushItemWidth(window_width - diameter_slider_left); float diam = 2.f * m_new_hole_radius; - m_imgui->slider_float("##hole_diameter", &diam, 1.f, 15.f, "%.1f mm", 1.f, false); + m_imgui->slider_float("##hole_diameter", &diam, 1.f, 25.f, "%.1f mm", 1.f, false); // Let's clamp the value (which could have been entered by keyboard) to a larger range // than the slider. This allows entering off-scale values and still protects against //complete non-sense. diff --git a/src/slic3r/GUI/PresetHints.cpp b/src/slic3r/GUI/PresetHints.cpp index 5c5ed26124..ce709d9eb8 100644 --- a/src/slic3r/GUI/PresetHints.cpp +++ b/src/slic3r/GUI/PresetHints.cpp @@ -34,11 +34,17 @@ std::string PresetHints::cooling_description(const Preset &preset) "so that no less than %3%s are spent on that layer " "(however, speed will never be reduced below %4%mm/s)."), slowdown_below_layer_time, max_fan_speed, slowdown_below_layer_time, min_print_speed); - if (fan_below_layer_time > slowdown_below_layer_time) - out += "\n" + - GUI::format(_L("If estimated layer time is greater, but still below ~%1%s, " + if (fan_below_layer_time > slowdown_below_layer_time) { + out += "\n"; + if (min_fan_speed != max_fan_speed) + out += GUI::format(_L("If estimated layer time is greater, but still below ~%1%s, " "fan will run at a proportionally decreasing speed between %2%%% and %3%%%."), fan_below_layer_time, max_fan_speed, min_fan_speed); + else + out += GUI::format(_L("If estimated layer time is greater, but still below ~%1%s, " + "fan will run at %2%%%"), + fan_below_layer_time, min_fan_speed); + } out += "\n"; } if (preset.config.opt_bool("fan_always_on", 0)) {