mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-18 05:45:42 -07:00
Merge 49097055e5 into 97c8da4d03
This commit is contained in:
commit
bf31c7a32e
9 changed files with 70 additions and 18 deletions
|
|
@ -5748,8 +5748,11 @@ std::string GCode::extrude_infill(const Print &print, const std::vector<ObjectBy
|
|||
if ((ee->role() == erIroning) == ironing)
|
||||
extrusions.emplace_back(ee);
|
||||
if (! extrusions.empty()) {
|
||||
m_config.apply(print.get_print_region(®ion - &by_region.front()).config());
|
||||
const PrintRegionConfig& region_config = print.get_print_region(®ion - &by_region.front()).config();
|
||||
m_config.apply(region_config);
|
||||
chain_and_reorder_extrusion_entities(extrusions, &m_last_pos);
|
||||
if (ironing && region_config.ironing_flow == 0)
|
||||
gcode += this->writer().emit_retract(region_config.ironing_retract, " ; ironing retract");
|
||||
for (const ExtrusionEntity *fill : extrusions) {
|
||||
auto *eec = dynamic_cast<const ExtrusionEntityCollection*>(fill);
|
||||
if (eec) {
|
||||
|
|
@ -5758,6 +5761,8 @@ std::string GCode::extrude_infill(const Print &print, const std::vector<ObjectBy
|
|||
} else
|
||||
gcode += this->extrude_entity(*fill, extrusion_name);
|
||||
}
|
||||
if (ironing && region_config.ironing_flow == 0)
|
||||
gcode += this->writer().emit_unretract(region_config.ironing_retract + region_config.ironing_unretract_extra, " ; ironing retract");
|
||||
}
|
||||
}
|
||||
return gcode;
|
||||
|
|
|
|||
|
|
@ -3741,6 +3741,11 @@ void GCodeProcessor::process_G1(const std::array<std::optional<double>, 4>& axes
|
|||
return;
|
||||
|
||||
EMoveType type = move_type(delta_pos);
|
||||
|
||||
if (m_extrusion_role == erIroning && m_end_position[Z] == m_extruded_last_z) {
|
||||
type = EMoveType::Extrude;
|
||||
}
|
||||
|
||||
if (type == EMoveType::Extrude) {
|
||||
const float delta_xyz = std::sqrt(sqr(delta_pos[X]) + sqr(delta_pos[Y]) + sqr(delta_pos[Z]));
|
||||
m_travel_dist = delta_xyz;
|
||||
|
|
|
|||
|
|
@ -964,13 +964,7 @@ std::string GCodeWriter::_retract(double length, double restart_extra, const std
|
|||
gcode = FLAVOR_IS(gcfMachinekit) ? "G22 ; retract\n" : "G10 ; retract\n";
|
||||
}
|
||||
else {
|
||||
// BBS
|
||||
GCodeG1Formatter w;
|
||||
w.emit_e(filament()->E());
|
||||
w.emit_f(filament()->retract_speed() * 60.);
|
||||
// BBS
|
||||
w.emit_comment(GCodeWriter::full_gcode_comment, comment);
|
||||
gcode = w.string();
|
||||
this->emit_retract(filament()->E(), comment);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -993,20 +987,39 @@ std::string GCodeWriter::unretract()
|
|||
gcode += this->reset_e();
|
||||
}
|
||||
else {
|
||||
//BBS
|
||||
// use G1 instead of G0 because G0 will blend the restart with the previous travel move
|
||||
GCodeG1Formatter w;
|
||||
w.emit_e(filament()->E());
|
||||
w.emit_f(filament()->deretract_speed() * 60.);
|
||||
//BBS
|
||||
w.emit_comment(GCodeWriter::full_gcode_comment, " ; unretract");
|
||||
gcode += w.string();
|
||||
this->emit_unretract(filament()->E(), " ; unretract");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return gcode;
|
||||
}
|
||||
|
||||
std::string GCodeWriter::emit_retract(double E, std::string comment)
|
||||
{
|
||||
//BBS
|
||||
// use G1 instead of G0 because G0 will blend the restart with the previous travel move
|
||||
GCodeG1Formatter w;
|
||||
w.emit_e(-E);
|
||||
w.emit_f(filament()->retract_speed() * 60.);
|
||||
//BBS
|
||||
w.emit_comment(GCodeWriter::full_gcode_comment, comment);
|
||||
|
||||
return w.string();
|
||||
}
|
||||
|
||||
std::string GCodeWriter::emit_unretract(double E, std::string comment)
|
||||
{
|
||||
//BBS
|
||||
// use G1 instead of G0 because G0 will blend the restart with the previous travel move
|
||||
GCodeG1Formatter w;
|
||||
w.emit_e(E);
|
||||
w.emit_f(filament()->deretract_speed() * 60.);
|
||||
//BBS
|
||||
w.emit_comment(GCodeWriter::full_gcode_comment, comment);
|
||||
|
||||
return w.string();
|
||||
}
|
||||
|
||||
|
||||
std::string GCodeWriter::unlift()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -84,6 +84,8 @@ public:
|
|||
std::string retract(bool before_wipe = false, double retract_length = 0);
|
||||
std::string retract_for_toolchange(bool before_wipe = false, double retract_length = 0);
|
||||
std::string unretract();
|
||||
std::string emit_retract(double E, std::string comment);
|
||||
std::string emit_unretract(double E, std::string comment);
|
||||
// do lift instantly
|
||||
std::string eager_lift(const LiftType type);
|
||||
// record a lift request, do realy lift in next travel
|
||||
|
|
|
|||
|
|
@ -895,7 +895,7 @@ static std::vector<std::string> s_Preset_print_options {
|
|||
"infill_direction", "solid_infill_direction", "counterbore_hole_bridging","infill_shift_step", "sparse_infill_rotate_template", "solid_infill_rotate_template", "symmetric_infill_y_axis","skeleton_infill_density", "infill_lock_depth", "skin_infill_depth", "skin_infill_density",
|
||||
"align_infill_direction_to_model", "extra_solid_infills",
|
||||
"minimum_sparse_infill_area", "reduce_infill_retraction","internal_solid_infill_pattern","gap_fill_target",
|
||||
"ironing_type", "ironing_pattern", "ironing_flow", "ironing_speed", "ironing_spacing", "ironing_angle", "ironing_angle_fixed", "ironing_inset",
|
||||
"ironing_type", "ironing_pattern", "ironing_flow", "ironing_retract", "ironing_unretract_extra", "ironing_speed", "ironing_spacing", "ironing_angle", "ironing_angle_fixed", "ironing_inset",
|
||||
"support_ironing", "support_ironing_pattern", "support_ironing_flow", "support_ironing_spacing",
|
||||
"max_travel_detour_distance",
|
||||
"fuzzy_skin", "fuzzy_skin_thickness", "fuzzy_skin_point_distance", "fuzzy_skin_first_layer", "fuzzy_skin_noise_type", "fuzzy_skin_mode", "fuzzy_skin_scale", "fuzzy_skin_octaves", "fuzzy_skin_persistence",
|
||||
|
|
|
|||
|
|
@ -3952,6 +3952,26 @@ void PrintConfigDef::init_fff_params()
|
|||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionPercent(10));
|
||||
|
||||
def = this->add("ironing_retract", coFloat);
|
||||
def->label = L("Ironing retract");
|
||||
def->category = L("Quality");
|
||||
def->tooltip = L("Retract length before ironing with zero flow.");
|
||||
def->sidetext = "mm";
|
||||
def->min = 0;
|
||||
def->max = 100;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(20));
|
||||
|
||||
def = this->add("ironing_unretract_extra", coFloat);
|
||||
def->label = L("Ironing unretract extra");
|
||||
def->category = L("Quality");
|
||||
def->tooltip = L("Extra unretract length after ironing with zero flow.");
|
||||
def->sidetext = "mm";
|
||||
def->min = -20;
|
||||
def->max = 20;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(0));
|
||||
|
||||
def = this->add("ironing_spacing", coFloat);
|
||||
def->label = L("Ironing line spacing");
|
||||
def->category = L("Quality");
|
||||
|
|
|
|||
|
|
@ -1095,6 +1095,8 @@ PRINT_CONFIG_CLASS_DEFINE(
|
|||
((ConfigOptionEnum<IroningType>, ironing_type))
|
||||
((ConfigOptionEnum<InfillPattern>, ironing_pattern))
|
||||
((ConfigOptionPercent, ironing_flow))
|
||||
((ConfigOptionFloat, ironing_retract))
|
||||
((ConfigOptionFloat, ironing_unretract_extra))
|
||||
((ConfigOptionFloat, ironing_spacing))
|
||||
((ConfigOptionFloat, ironing_inset))
|
||||
((ConfigOptionFloat, ironing_direction))
|
||||
|
|
|
|||
|
|
@ -797,6 +797,9 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
|||
for (auto el : { "ironing_pattern", "ironing_flow", "ironing_spacing", "ironing_angle", "ironing_inset", "ironing_angle_fixed" })
|
||||
toggle_line(el, has_ironing);
|
||||
|
||||
for (auto el : { "ironing_retract", "ironing_unretract_extra"})
|
||||
toggle_line(el, has_ironing && config->opt<ConfigOptionPercent>("ironing_flow")->value == 0);
|
||||
|
||||
toggle_line("ironing_speed", has_ironing || has_support_ironing);
|
||||
|
||||
bool have_sequential_printing = (config->opt_enum<PrintSequence>("print_sequence") == PrintSequence::ByObject);
|
||||
|
|
|
|||
|
|
@ -2343,6 +2343,8 @@ void TabPrint::build()
|
|||
optgroup->append_single_option_line("ironing_type", "quality_settings_ironing#type");
|
||||
optgroup->append_single_option_line("ironing_pattern", "quality_settings_ironing#pattern");
|
||||
optgroup->append_single_option_line("ironing_flow", "quality_settings_ironing#flow");
|
||||
optgroup->append_single_option_line("ironing_retract", "quality_settings_ironing#flow");
|
||||
optgroup->append_single_option_line("ironing_unretract_extra", "quality_settings_ironing#flow");
|
||||
optgroup->append_single_option_line("ironing_spacing", "quality_settings_ironing#line-spacing");
|
||||
optgroup->append_single_option_line("ironing_inset", "quality_settings_ironing#inset");
|
||||
optgroup->append_single_option_line("ironing_angle", "quality_settings_ironing#angle-offset");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue