#205 separate external perimeters and thin walls (speed & gcode layout).

This commit is contained in:
supermerill 2020-05-03 22:09:59 +02:00
parent 0d8d386c72
commit 0da98baa11
10 changed files with 30 additions and 5 deletions

View File

@ -189,8 +189,9 @@ group:label_width$8:Speed for print moves
line:Bridge speed
setting:label$_:width$4:bridge_speed
end_line
line:Gap fill speed
setting:label$_:width$4:gap_fill_speed
line:Thin extrusions speed
setting:width$4:gap_fill_speed
setting:width$4:thin_walls_speed
end_line
group:Speed for non-print moves
setting:travel_speed

View File

@ -274,6 +274,7 @@ std::string ExtrusionEntity::role_to_string(ExtrusionRole role)
case erSolidInfill : return L("Solid infill");
case erTopSolidInfill : return L("Top solid infill");
case erBridgeInfill : return L("Bridge infill");
case erThinWall : return L("Thin wall");
case erGapFill : return L("Gap fill");
case erSkirt : return L("Skirt");
case erSupportMaterial : return L("Support material");

View File

@ -23,6 +23,7 @@ enum ExtrusionRole : uint8_t {
erSolidInfill,
erTopSolidInfill,
erBridgeInfill,
erThinWall,
erGapFill,
erSkirt,
erSupportMaterial,
@ -54,6 +55,7 @@ inline bool is_perimeter(ExtrusionRole role)
{
return role == erPerimeter
|| role == erExternalPerimeter
|| role == erThinWall
|| role == erOverhangPerimeter;
}

View File

@ -3524,6 +3524,8 @@ std::string GCode::_before_extrude(const ExtrusionPath &path, const std::string
speed = m_config.get_abs_value("solid_infill_speed");
} else if (path.role() == erTopSolidInfill) {
speed = m_config.get_abs_value("top_solid_infill_speed");
} else if (path.role() == erThinWall) {
speed = m_config.get_abs_value("thin_walls_speed");
} else if (path.role() == erGapFill) {
speed = m_config.get_abs_value("gap_fill_speed");
} else if (path.role() == erNone) {
@ -3621,6 +3623,8 @@ std::string GCode::_before_extrude(const ExtrusionPath &path, const std::string
comment = ";_EXTRUDE_SET_SPEED";
if (path.role() == erExternalPerimeter)
comment += ";_EXTERNAL_PERIMETER";
if (path.role() == erThinWall)
comment += ";_EXTERNAL_PERIMETER";
}
// F is mm per minute.
gcode += m_writer.set_speed(F, "", comment);
@ -3995,6 +3999,8 @@ GCode::extrusion_role_to_string_for_parser(const ExtrusionRole & role) {
return "TopSolidInfill";
case erBridgeInfill:
return "BridgeInfill";
case erThinWall:
return "ThinWall";
case erGapFill:
return "GapFill";
case erSkirt:

View File

@ -118,6 +118,7 @@ const Color GCodePreviewData::Extrusion::Default_Extrusion_Role_Colors[erCount]
Color(1.0f, 0.0f, 1.0f, 1.0f), // erSolidInfill
Color(0.0f, 1.0f, 1.0f, 1.0f), // erTopSolidInfill
Color(0.5f, 0.5f, 0.5f, 1.0f), // erBridgeInfill
Color(0.0f, 1.0f, 0.4f, 1.0f), // erThinWall
Color(1.0f, 1.0f, 1.0f, 1.0f), // erGapFill
Color(0.5f, 0.0f, 0.0f, 1.0f), // erSkirt
Color(0.0f, 0.5f, 0.0f, 1.0f), // erSupportMaterial

View File

@ -613,7 +613,7 @@ void PerimeterGenerator::process()
// append thin walls
if (!thin_walls.empty()) {
ExtrusionEntityCollection tw = thin_variable_width
(thin_walls, erExternalPerimeter, this->ext_perimeter_flow);
(thin_walls, erThinWall, this->ext_perimeter_flow);
entities.append(tw.entities);
thin_walls.clear();
@ -814,7 +814,7 @@ ExtrusionEntityCollection PerimeterGenerator::_traverse_loops(
// append thin walls to the nearest-neighbor search (only for first iteration)
if (!thin_walls.empty()) {
ExtrusionEntityCollection tw = thin_variable_width(thin_walls, erExternalPerimeter, this->ext_perimeter_flow);
ExtrusionEntityCollection tw = thin_variable_width(thin_walls, erThinWall, this->ext_perimeter_flow);
coll.append(tw.entities);
thin_walls.clear();
}

View File

@ -2973,6 +2973,16 @@ void PrintConfigDef::init_fff_params()
def->min = 0;
def->set_default_value(new ConfigOptionFloatOrPercent(50, true));
def = this->add("thin_walls_speed", coFloat);
def->label = L("Thin walls");
def->full_label = L("Thin walls speed");
def->category = OptionCategory::speed;
def->tooltip = L("Speed for thin wall (external extrusion that are alone because the obect is too thin at these places).");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(30));
def = this->add("threads", coInt);
def->label = L("Threads");
def->tooltip = L("Threads are used to parallelize long-running tasks. Optimal threads number "

View File

@ -639,6 +639,7 @@ public:
ConfigOptionBool thin_walls;
ConfigOptionFloatOrPercent thin_walls_min_width;
ConfigOptionFloatOrPercent thin_walls_overlap;
ConfigOptionFloat thin_walls_speed;
ConfigOptionEnum<InfillPattern> top_fill_pattern;
ConfigOptionFloatOrPercent top_infill_extrusion_width;
ConfigOptionInt top_solid_layers;
@ -713,6 +714,7 @@ protected:
OPT_PTR(thin_walls);
OPT_PTR(thin_walls_min_width);
OPT_PTR(thin_walls_overlap);
OPT_PTR(thin_walls_speed);
OPT_PTR(top_fill_pattern);
OPT_PTR(top_infill_extrusion_width);
OPT_PTR(top_solid_infill_speed);

View File

@ -299,6 +299,7 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view
"Solid infill", "D732D7",
"Top solid infill", "FF1A1A",
"Bridge infill", "9999FF",
"Thin wall", "FFB000",
"Gap fill", "FFFFFF",
"Skirt", "845321",
"Support material", "00FF00",

View File

@ -506,7 +506,8 @@ const std::vector<std::string>& Preset::print_options()
, "infill_not_connected"
, "first_layer_infill_speed"
, "thin_walls_min_width"
, "thin_walls_overlap"
, "thin_walls_overlap",
"thin_walls_speed"
, "model_precision"
, "curve_smoothing_precision"
, "curve_smoothing_cutoff_dist"