Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_world_coordinates
This commit is contained in:
commit
275fe779ab
8 changed files with 23 additions and 44 deletions
|
@ -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<t_config_option_key, ConfigOptionDef> &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"));
|
||||
|
|
|
@ -577,7 +577,7 @@ private:
|
|||
|
||||
|
||||
template<class Level>
|
||||
Shapes calcnfp(const Item &trsh, Level)
|
||||
Shapes calcnfp(const Item &/*trsh*/, Level)
|
||||
{ // Function for arbitrary level of nfp implementation
|
||||
|
||||
// TODO: implement
|
||||
|
|
|
@ -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) {}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<typename PolygonsProvider>
|
||||
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<double>(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<PolygonsProvider>(paths), jointype, etClosedPolygon);
|
||||
|
||||
Paths result;
|
||||
offs.Execute(result, static_cast<double>(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
|
||||
|
|
|
@ -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 + "}"));
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue