Enabling object skirt. (#6487)

Implements individual object skirts, as requested in  **Individual skirts when printing by object. #3486** and  **Skirt around each object when using "by object" sequence #2652**

Now skirt type could be
![image](https://github.com/user-attachments/assets/532ecd91-fe3e-4bdb-b22f-ef28439ab7a6)

This PR based on several refactorings, including  **Configure skirt start point #6490** PR. To make review more easy each step was committed individually. Obviously them could be separated to different PRs or dropped.

I removed `prime_extruder && first_layer && extruder_id == first_extruder_id` as explicit object skirt is available.

Open question : do we need both common and object skirt together, probably with separate loop number?


All four combinations are possible.

Print by layer, common skirt:
![image](https://github.com/user-attachments/assets/5509f10b-ed3b-4243-8763-7ddcb101c67a)

Print by layer, object skirt:
![image](https://github.com/user-attachments/assets/deca3ca6-8bf7-4e5b-a356-2f5dd6e81566)

Print by object , object skirt:
![image](https://github.com/user-attachments/assets/7d1b2ddc-e61f-4d77-9ed4-e33fdd62d290)

Print by object , common skirt (any meaning?):
![image](https://github.com/user-attachments/assets/e7883eb4-b1a3-4158-a7f4-ce0658bc1939)
This commit is contained in:
SoftFever 2024-09-07 23:46:54 +08:00 committed by GitHub
commit 415bedef94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 342 additions and 381 deletions

View file

@ -61,7 +61,7 @@ namespace GUI {
#define DISABLE_UNDO_SYS
static const std::vector<std::string> plate_keys = { "curr_bed_type", "first_layer_print_sequence", "first_layer_sequence_choice", "other_layers_print_sequence", "other_layers_sequence_choice", "print_sequence", "spiral_mode"};
static const std::vector<std::string> plate_keys = { "curr_bed_type", "skirt_start_angle", "first_layer_print_sequence", "first_layer_sequence_choice", "other_layers_print_sequence", "other_layers_sequence_choice", "print_sequence", "spiral_mode"};
void Tab::Highlighter::set_timer_owner(wxEvtHandler* owner, int timerid/* = wxID_ANY*/)
{
@ -2312,9 +2312,11 @@ void TabPrint::build()
page = add_options_page(L("Others"), "custom-gcode_other"); // ORCA: icon only visible on placeholders
optgroup = page->new_optgroup(L("Skirt"), L"param_skirt");
optgroup->append_single_option_line("skirt_type");
optgroup->append_single_option_line("skirt_loops");
optgroup->append_single_option_line("min_skirt_length");
optgroup->append_single_option_line("skirt_distance");
optgroup->append_single_option_line("skirt_start_angle");
optgroup->append_single_option_line("skirt_height");
optgroup->append_single_option_line("skirt_speed");
optgroup->append_single_option_line("draft_shield");
@ -2783,6 +2785,7 @@ void TabPrintPlate::build()
auto page = add_options_page(L("Plate Settings"), "empty");
auto optgroup = page->new_optgroup("");
optgroup->append_single_option_line("curr_bed_type");
optgroup->append_single_option_line("skirt_start_angle");
optgroup->append_single_option_line("print_sequence");
optgroup->append_single_option_line("spiral_mode");
optgroup->append_single_option_line("first_layer_sequence_choice");
@ -2831,6 +2834,8 @@ void TabPrintPlate::on_value_change(const std::string& opt_key, const boost::any
auto plate = dynamic_cast<PartPlate*>(plate_item.first);
if (k == "curr_bed_type")
plate->reset_bed_type();
if (k == "skirt_start_angle")
plate->config()->erase("skirt_start_angle");
if (k == "print_sequence")
plate->set_print_seq(PrintSequence::ByDefault);
if (k == "first_layer_sequence_choice")
@ -2854,6 +2859,10 @@ void TabPrintPlate::on_value_change(const std::string& opt_key, const boost::any
bed_type = m_config->opt_enum<BedType>("curr_bed_type");
plate->set_bed_type(BedType(bed_type));
}
if (k == "skirt_start_angle") {
float angle = m_config->opt_float("skirt_start_angle");
plate->config()->set_key_value("skirt_start_angle", new ConfigOptionFloat(angle));
}
if (k == "print_sequence") {
print_seq = m_config->opt_enum<PrintSequence>("print_sequence");
plate->set_print_seq(print_seq);