mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-12 16:49:03 +08:00
Reduce bounds on auto width again (the math likes to go very wide which is not feasible if your nozzle isn't really big).
Should address #4212
This commit is contained in:
parent
d8a331fda0
commit
54e86b7307
@ -90,18 +90,18 @@ Flow::_bridge_width(float nozzle_diameter, float bridge_flow_ratio) {
|
||||
|
||||
/* This static method returns a sane extrusion width default. */
|
||||
float
|
||||
Flow::_auto_width(FlowRole role, float nozzle_diameter, float height) {
|
||||
Flow::_auto_width(FlowRole role, float nozzle_diameter, float height) const {
|
||||
// here we calculate a sane default by matching the flow speed (at the nozzle) and the feed rate
|
||||
// shape: rectangle with semicircles at the ends
|
||||
float width = ((nozzle_diameter*nozzle_diameter) * PI + (height*height) * (4.0 - PI)) / (4.0 * height);
|
||||
|
||||
float min = nozzle_diameter * 1.05;
|
||||
float max = nozzle_diameter * 3; // cap width to 3x nozzle diameter
|
||||
float max = nozzle_diameter * 1.25; // cap width to 1.25x nozzle diameter
|
||||
if (role == frExternalPerimeter || role == frSupportMaterial || role == frSupportMaterialInterface) {
|
||||
min = max = nozzle_diameter;
|
||||
min = max = nozzle_diameter*1.1;
|
||||
} else if (role != frInfill) {
|
||||
// do not limit width for sparse infill so that we use full native flow for it
|
||||
max = nozzle_diameter * 1.7;
|
||||
// limit width a bit for sparse infill to avoid unwanted overextrusion.
|
||||
max = nozzle_diameter * 1.4;
|
||||
}
|
||||
if (width > max) width = max;
|
||||
if (width < min) width = min;
|
||||
|
@ -69,7 +69,8 @@ class Flow
|
||||
static float _bridge_width(float nozzle_diameter, float bridge_flow_ratio);
|
||||
/// Calculate a relatively sane extrusion width, based on height and nozzle diameter.
|
||||
/// Algorithm used does not play nice with layer heights < 0.1mm.
|
||||
static float _auto_width(FlowRole role, float nozzle_diameter, float height);
|
||||
/// To avoid extra headaches, min and max are capped at 105% and 125% of nozzle diameter.
|
||||
static float _auto_width(FlowRole role, float nozzle_diameter, float height) const;
|
||||
static float _width_from_spacing(float spacing, float nozzle_diameter, float height, bool bridge);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user