minor changes

1. when default hotend model
2. apply speed change for current path
This commit is contained in:
SoftFever 2023-05-10 22:24:27 +08:00
parent 35f8dba5ab
commit 79a43da863
3 changed files with 7 additions and 6 deletions

View file

@ -4274,15 +4274,16 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
}
}
gcode +=
m_writer.extrude_to_xy(p, e_per_mm * line_length, GCodeWriter::full_gcode_comment ? description : "");
prev = p;
double new_speed = std::max((float)EXTRUDER_CONFIG(slow_down_min_speed), processed_point.speed) * 60.0;
if (last_set_speed != new_speed) {
gcode += m_writer.set_speed(new_speed, "", comment);
last_set_speed = new_speed;
}
gcode +=
m_writer.extrude_to_xy(p, e_per_mm * line_length, GCodeWriter::full_gcode_comment ? description : "");
prev = p;
}
if (is_overhang_fan_on) {
is_overhang_fan_on = false;

View file

@ -3189,7 +3189,7 @@ namespace PresetUtils {
out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->hotend_model;
}
if(out.empty())
if (out.empty() ||!boost::filesystem::exists(boost::filesystem::path(out)))
out = Slic3r::resources_dir() + "/profiles/hotend.stl";
return out;
}

View file

@ -504,7 +504,7 @@ std::string PresetBundle::get_hotend_model_for_printer_model(std::string model_n
out = Slic3r::resources_dir() + "/profiles/" + vendor_name + "/" + hotend_stl;
}
if (out.empty())
if (out.empty() ||!boost::filesystem::exists(boost::filesystem::path(out)))
out = Slic3r::resources_dir() + "/profiles/hotend.stl";
return out;