Calculate extrusion width %s as a function of nozzle width, not layer height (#1578)

* Calculate extrusion width %s as a function of nozzle width, not layer height

* handled more width conversions

* more missing percent handling

* even more missed percent handling

* even more more extrusion % handling

* some fixes

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Jason M-H 2023-07-27 11:37:47 -04:00 committed by GitHub
parent 71ddef9724
commit be54f6bc99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 187 additions and 121 deletions

View file

@ -239,7 +239,10 @@ std::vector<unsigned int> ToolOrdering::generate_first_layer_tool_order(const Pr
int extruder_id = layerm->region().config().option("wall_filament")->getInt();
for (auto expoly : layerm->raw_slices) {
if (offset_ex(expoly, -0.2 * scale_(print.config().initial_layer_line_width)).empty())
const double nozzle_diameter = print.config().nozzle_diameter.get_at(0);
const coordf_t initial_layer_line_width = print.config().get_abs_value("initial_layer_line_width", nozzle_diameter);
if (offset_ex(expoly, -0.2 * scale_(initial_layer_line_width)).empty())
continue;
double contour_area = expoly.contour.area();
@ -279,7 +282,10 @@ std::vector<unsigned int> ToolOrdering::generate_first_layer_tool_order(const Pr
for (auto layerm : first_layer->regions()) {
int extruder_id = layerm->region().config().option("wall_filament")->getInt();
for (auto expoly : layerm->raw_slices) {
if (offset_ex(expoly, -0.2 * scale_(object.config().line_width)).empty())
const double nozzle_diameter = object.print()->config().nozzle_diameter.get_at(0);
const coordf_t line_width = object.config().get_abs_value("line_width", nozzle_diameter);
if (offset_ex(expoly, -0.2 * scale_(line_width)).empty())
continue;
double contour_area = expoly.contour.area();