Skip to content

Commit

Permalink
#224 setting to force one skirt with complete_objects
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed May 10, 2020
1 parent 04f2554 commit 6f9dc88
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 7 deletions.
1 change: 1 addition & 0 deletions resources/ui_layout/print.ui
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ group:Plater
setting:duplicate_distance
group:Sequential printing
setting:complete_objects
setting:complete_objects_one_skirt
line:Extruder clearance (mm)
setting:width$6:extruder_clearance_radius
setting:width$6:extruder_clearance_height
Expand Down
3 changes: 2 additions & 1 deletion src/libslic3r/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|| opt_key == "draft_shield"
|| opt_key == "skirt_distance"
|| opt_key == "min_skirt_length"
|| opt_key == "complete_objects_one_skirt"
|| opt_key == "ooze_prevention"
|| opt_key == "wipe_tower_x"
|| opt_key == "wipe_tower_y"
Expand Down Expand Up @@ -1646,7 +1647,7 @@ void Print::process()
}
if (this->has_skirt()) {
this->set_status(88, L("Generating skirt"));
if (config().complete_objects){
if (config().complete_objects && !config().complete_objects_one_skirt){
for (PrintObject *obj : m_objects){
//create a skirt "pattern" (one per object)
const std::vector<PrintInstance> copies{ obj->instances() };
Expand Down
14 changes: 11 additions & 3 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,17 @@ void PrintConfigDef::init_fff_params()
def->label = L("Complete individual objects");
def->category = OptionCategory::output;
def->tooltip = L("When printing multiple objects or copies, this feature will complete "
"each object before moving onto next one (and starting it from its bottom layer). "
"This feature is useful to avoid the risk of ruined prints. "
"Slic3r should warn and prevent you from extruder collisions, but beware.");
"each object before moving onto next one (and starting it from its bottom layer). "
"This feature is useful to avoid the risk of ruined prints. "
"Slic3r should warn and prevent you from extruder collisions, but beware.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));

def = this->add("complete_objects_one_skirt", coBool);
def->label = L("Allow only one skirt loop");
def->category = OptionCategory::output;
def->tooltip = L("When using 'Complete individual objects', the default behavior is to draw the skirt around each object."
" if you prefer to have only one skirt for the whole plater, use this option.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));

Expand Down
2 changes: 2 additions & 0 deletions src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,7 @@ class PrintConfig : public MachineEnvelopeConfig, public GCodeConfig
ConfigOptionInts bridge_fan_speed;
ConfigOptionInts chamber_temperature;
ConfigOptionBool complete_objects;
ConfigOptionBool complete_objects_one_skirt;
ConfigOptionFloats colorprint_heights;
ConfigOptionBools cooling;
ConfigOptionFloat default_acceleration;
Expand Down Expand Up @@ -1053,6 +1054,7 @@ class PrintConfig : public MachineEnvelopeConfig, public GCodeConfig
OPT_PTR(bridge_fan_speed);
OPT_PTR(chamber_temperature);
OPT_PTR(complete_objects);
OPT_PTR(complete_objects_one_skirt);
OPT_PTR(colorprint_heights);
OPT_PTR(cooling);
OPT_PTR(default_acceleration);
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/ConfigManipulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
toggle_field("support_material_speed", have_support_material || have_brim || have_skirt);

bool have_sequential_printing = config->opt_bool("complete_objects");
for (auto el : { "extruder_clearance_radius", "extruder_clearance_height" })
for (auto el : { "extruder_clearance_radius", "extruder_clearance_height", "complete_objects_one_skirt" })
toggle_field(el, have_sequential_printing);

bool have_ooze_prevention = config->opt_bool("ooze_prevention");
Expand Down
5 changes: 4 additions & 1 deletion src/slic3r/GUI/Plater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,10 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
: q(q)
, main_frame(main_frame)
, config(Slic3r::DynamicPrintConfig::new_from_defaults_keys({
"bed_shape", "bed_custom_texture", "bed_custom_model", "complete_objects", "duplicate_distance", "extruder_clearance_radius", "skirts", "skirt_distance",
"bed_shape", "bed_custom_texture", "bed_custom_model",
"complete_objects",
"complete_objects_one_skirt",
"duplicate_distance", "extruder_clearance_radius", "skirts", "skirt_distance",
"brim_width", "variable_layer_height", "serial_port", "serial_speed", "host_type", "print_host",
"printhost_apikey", "printhost_cafile", "nozzle_diameter", "single_extruder_multi_material",
"wipe_tower", "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_rotation_angle",
Expand Down
5 changes: 4 additions & 1 deletion src/slic3r/GUI/Preset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ const std::vector<std::string>& Preset::print_options()
, "support_material_contact_distance_type"
, "support_material_contact_distance_top"
, "support_material_contact_distance_bottom"
, "support_material_buildplate_only", "dont_support_bridges", "notes", "complete_objects", "extruder_clearance_radius",
, "support_material_buildplate_only", "dont_support_bridges", "notes",
"complete_objects",
"complete_objects_one_skirt",
"extruder_clearance_radius",
"extruder_clearance_height", "gcode_comments", "gcode_label_objects", "output_filename_format", "post_process", "perimeter_extruder",
"infill_extruder", "solid_infill_extruder", "support_material_extruder", "support_material_interface_extruder",
"ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width",
Expand Down

0 comments on commit 6f9dc88

Please sign in to comment.