Update on the spacing of perimeters.

#113
This commit is contained in:
supermerill 2019-11-02 02:28:16 +01:00
parent 7802f276e4
commit 6064dfe2c7
5 changed files with 20 additions and 18 deletions

View File

@ -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 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. // For bridge extrusions, the extrusions are placed with a tiny BRIDGE_EXTRA_SPACING gaps between the threads.
float width = float(bridge ? float width = float(bridge ?
(spacing - BRIDGE_EXTRA_SPACING) : (spacing - BRIDGE_EXTRA_SPACING_MULT * nozzle_diameter) :
#ifdef HAS_PERIMETER_LINE_OVERLAP #ifdef HAS_PERIMETER_LINE_OVERLAP
(spacing + PERIMETER_LINE_OVERLAP_FACTOR * height * (1. - 0.25 * PI)); (spacing + PERIMETER_LINE_OVERLAP_FACTOR * height * (1. - 0.25 * PI));
#else #else
@ -78,7 +78,7 @@ float Flow::spacing() const
float min_flow_spacing = this->width - this->height * (1. - 0.25 * PI); 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); float res = this->width - PERIMETER_LINE_OVERLAP_FACTOR * (this->width - min_flow_spacing);
#else #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 #endif
// assert(res > 0.f); // assert(res > 0.f);
if (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->height == other.height);
assert(this->bridge == other.bridge); assert(this->bridge == other.bridge);
float res = float(this->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()); 0.5 * this->spacing() + 0.5 * other.spacing());
// assert(res > 0.f); // assert(res > 0.f);
if (res <= 0.f) if (res <= 0.f)

View File

@ -9,8 +9,8 @@ namespace Slic3r {
class PrintObject; class PrintObject;
// Extra spacing of bridge threads, in mm. // Extra spacing of bridge threads, in mult of nozzle_width/extrusion_width. 0.05 for 0.4
#define BRIDGE_EXTRA_SPACING 0.05 #define BRIDGE_EXTRA_SPACING_MULT 0.125
// Overlap factor of perimeter lines. Currently no overlap. // Overlap factor of perimeter lines. Currently no overlap.
#ifdef HAS_PERIMETER_LINE_OVERLAP #ifdef HAS_PERIMETER_LINE_OVERLAP

View File

@ -63,9 +63,9 @@ void PerimeterGenerator::process()
// external loops (which is the correct way) instead of using ext_perimeter_spacing2 // 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 // which is the spacing between external and internal, which is not correct
// and would make the collapsing (thus the details resolution) dependent on // and would make the collapsing (thus the details resolution) dependent on
// internal flow which is unrelated. // internal flow which is unrelated. <- i don't undertand, so revert to ext_perimeter_spacing2
coord_t min_spacing = (coord_t)( perimeter_spacing * (1 - INSET_OVERLAP_TOLERANCE) ); coord_t min_spacing = (coord_t)( perimeter_spacing * (1 - 0.05/*INSET_OVERLAP_TOLERANCE*/) );
coord_t ext_min_spacing = (coord_t)( ext_perimeter_spacing * (1 - 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 // prepare grown lower layer slices for overhang detection
if (this->lower_slices != NULL && this->config->overhangs) { if (this->lower_slices != NULL && this->config->overhangs) {
@ -353,7 +353,10 @@ void PerimeterGenerator::process()
if (i == 0) { if (i == 0) {
// compute next onion, without taking care of thin_walls : destroy too thin areas. // compute next onion, without taking care of thin_walls : destroy too thin areas.
if (!this->config->thin_walls) 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 // look for thin walls

View File

@ -581,7 +581,7 @@ void PrintConfigDef::init_fff_params()
def->full_label = L("External perimeters width"); def->full_label = L("External perimeters width");
def->category = L("Extrusion 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. " 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."); "If expressed as percentage (for example 112.5%), it will be computed over nozzle diameter.");
def->sidetext = L("mm or %"); def->sidetext = L("mm or %");
def->mode = comAdvanced; def->mode = comAdvanced;

View File

@ -266,15 +266,14 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre
if (num_perimeters > 0) { if (num_perimeters > 0) {
int num_lines = std::min(num_perimeters * 2, 10); int num_lines = std::min(num_perimeters, 6);
out += (boost::format(_utf8(L("Recommended object min wall thickness for layer height %.2f and"))) % layer_height).str() + " "; 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 // Start with the width of two closely spaced
double width = external_perimeter_flow.width + external_perimeter_flow.spacing(); double width = 2*(external_perimeter_flow.width + external_perimeter_flow.spacing(perimeter_flow));
for (int i = 2; i <= num_lines; thin_walls ? ++ i : i += 2) { for (int i = 2; i <= num_lines; thin_walls ? ++ i : i ++) {
if (i > 2) out += ", " + (boost::format(_utf8(L("%d perimeter: %.2f mm"))) % i % width).str() + " ";
out += ", "; width += perimeter_flow.spacing()*2;
out += (boost::format(_utf8(L("%d perimeter: %.2f mm"))) % i % width).str() + " ";
width += perimeter_flow.spacing() * (thin_walls ? 1.f : 2.f);
} }
} }
return out; return out;