diff options
author | supermerill <merill@fr.fr> | 2019-11-02 04:28:16 +0300 |
---|---|---|
committer | supermerill <merill@fr.fr> | 2019-11-02 04:28:54 +0300 |
commit | 6064dfe2c711aebca88e9657012e9cd9a596afd1 (patch) | |
tree | 32ad65283ec3925dee13f4b4336b9f2606a603f6 | |
parent | 7802f276e40ffc5f26c81ad901ed85f9bc734e91 (diff) |
Update on the spacing of perimeters.
#113
-rw-r--r-- | src/libslic3r/Flow.cpp | 6 | ||||
-rw-r--r-- | src/libslic3r/Flow.hpp | 4 | ||||
-rw-r--r-- | src/libslic3r/PerimeterGenerator.cpp | 11 | ||||
-rw-r--r-- | src/libslic3r/PrintConfig.cpp | 2 | ||||
-rw-r--r-- | src/slic3r/GUI/PresetHints.cpp | 15 |
5 files changed, 20 insertions, 18 deletions
diff --git a/src/libslic3r/Flow.cpp b/src/libslic3r/Flow.cpp index a2409c389..b87edf00f 100644 --- a/src/libslic3r/Flow.cpp +++ b/src/libslic3r/Flow.cpp @@ -58,7 +58,7 @@ Flow Flow::new_from_spacing(float spacing, float nozzle_diameter, float height, // For normal extrusons, extrusion width is wider than the spacing due to the rounding and squishing of the extrusions. // For bridge extrusions, the extrusions are placed with a tiny BRIDGE_EXTRA_SPACING gaps between the threads. float width = float(bridge ? - (spacing - BRIDGE_EXTRA_SPACING) : + (spacing - BRIDGE_EXTRA_SPACING_MULT * nozzle_diameter) : #ifdef HAS_PERIMETER_LINE_OVERLAP (spacing + PERIMETER_LINE_OVERLAP_FACTOR * height * (1. - 0.25 * PI)); #else @@ -78,7 +78,7 @@ float Flow::spacing() const float min_flow_spacing = this->width - this->height * (1. - 0.25 * PI); float res = this->width - PERIMETER_LINE_OVERLAP_FACTOR * (this->width - min_flow_spacing); #else - float res = float(this->bridge ? (this->width + BRIDGE_EXTRA_SPACING) : (this->width - this->height * (1. - 0.25 * PI))); + float res = float(this->bridge ? (this->width + BRIDGE_EXTRA_SPACING_MULT * nozzle_diameter) : (this->width - this->height * (1. - 0.25 * PI))); #endif // assert(res > 0.f); if (res <= 0.f) @@ -94,7 +94,7 @@ float Flow::spacing(const Flow &other) const assert(this->height == other.height); assert(this->bridge == other.bridge); float res = float(this->bridge ? - 0.5 * this->width + 0.5 * other.width + BRIDGE_EXTRA_SPACING : + 0.5 * this->width + 0.5 * other.width + BRIDGE_EXTRA_SPACING_MULT * nozzle_diameter : 0.5 * this->spacing() + 0.5 * other.spacing()); // assert(res > 0.f); if (res <= 0.f) diff --git a/src/libslic3r/Flow.hpp b/src/libslic3r/Flow.hpp index 0d7eb22de..28b7b5d0a 100644 --- a/src/libslic3r/Flow.hpp +++ b/src/libslic3r/Flow.hpp @@ -9,8 +9,8 @@ namespace Slic3r { class PrintObject; -// Extra spacing of bridge threads, in mm. -#define BRIDGE_EXTRA_SPACING 0.05 +// Extra spacing of bridge threads, in mult of nozzle_width/extrusion_width. 0.05 for 0.4 +#define BRIDGE_EXTRA_SPACING_MULT 0.125 // Overlap factor of perimeter lines. Currently no overlap. #ifdef HAS_PERIMETER_LINE_OVERLAP diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp index 012ace35e..c6210d265 100644 --- a/src/libslic3r/PerimeterGenerator.cpp +++ b/src/libslic3r/PerimeterGenerator.cpp @@ -63,9 +63,9 @@ void PerimeterGenerator::process() // external loops (which is the correct way) instead of using ext_perimeter_spacing2 // which is the spacing between external and internal, which is not correct // and would make the collapsing (thus the details resolution) dependent on - // internal flow which is unrelated. - coord_t min_spacing = (coord_t)( perimeter_spacing * (1 - INSET_OVERLAP_TOLERANCE) ); - coord_t ext_min_spacing = (coord_t)( ext_perimeter_spacing * (1 - INSET_OVERLAP_TOLERANCE) ); + // internal flow which is unrelated. <- i don't undertand, so revert to ext_perimeter_spacing2 + coord_t min_spacing = (coord_t)( perimeter_spacing * (1 - 0.05/*INSET_OVERLAP_TOLERANCE*/) ); + coord_t ext_min_spacing = (coord_t)( ext_perimeter_spacing2 * (1 - 0.05/*INSET_OVERLAP_TOLERANCE*/) ); // prepare grown lower layer slices for overhang detection if (this->lower_slices != NULL && this->config->overhangs) { @@ -353,7 +353,10 @@ void PerimeterGenerator::process() if (i == 0) { // compute next onion, without taking care of thin_walls : destroy too thin areas. if (!this->config->thin_walls) - next_onion = offset_ex(last, double( - ext_perimeter_width / 2)); + next_onion = offset2_ex( + last, + -(float)(ext_perimeter_width / 2 + ext_min_spacing / 2 - 1), + +(float)(ext_min_spacing / 2 - 1)); // look for thin walls diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 0819d4c8b..d6ebab929 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -581,7 +581,7 @@ void PrintConfigDef::init_fff_params() def->full_label = L("External perimeters width"); def->category = L("Extrusion Width"); def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for external perimeters. " - "If left zero, default extrusion width will be used if set, otherwise 1.125 x nozzle diameter will be used. " + "If left zero, default extrusion width will be used if set, otherwise 1.05 x nozzle diameter will be used. " "If expressed as percentage (for example 112.5%), it will be computed over nozzle diameter."); def->sidetext = L("mm or %"); def->mode = comAdvanced; diff --git a/src/slic3r/GUI/PresetHints.cpp b/src/slic3r/GUI/PresetHints.cpp index e547e3c73..6e48a4d70 100644 --- a/src/slic3r/GUI/PresetHints.cpp +++ b/src/slic3r/GUI/PresetHints.cpp @@ -266,15 +266,14 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre if (num_perimeters > 0) { - int num_lines = std::min(num_perimeters * 2, 10); - out += (boost::format(_utf8(L("Recommended object min wall thickness for layer height %.2f and"))) % layer_height).str() + " "; + int num_lines = std::min(num_perimeters, 6); + out += (boost::format(_utf8(L("Recommended object min (thick) wall thickness for layer height %.2f and"))) % layer_height).str() + " "; + out += (boost::format(_utf8(L("%d perimeter: %.2f mm"))) % 1 % (external_perimeter_flow.width + external_perimeter_flow.spacing())).str() + " "; // Start with the width of two closely spaced - double width = external_perimeter_flow.width + external_perimeter_flow.spacing(); - for (int i = 2; i <= num_lines; thin_walls ? ++ i : i += 2) { - if (i > 2) - out += ", "; - out += (boost::format(_utf8(L("%d perimeter: %.2f mm"))) % i % width).str() + " "; - width += perimeter_flow.spacing() * (thin_walls ? 1.f : 2.f); + double width = 2*(external_perimeter_flow.width + external_perimeter_flow.spacing(perimeter_flow)); + for (int i = 2; i <= num_lines; thin_walls ? ++ i : i ++) { + out += ", " + (boost::format(_utf8(L("%d perimeter: %.2f mm"))) % i % width).str() + " "; + width += perimeter_flow.spacing()*2; } } return out; |