ENH: change base pattern "None" to "Hollow"

1. change base pattern "None" to "Hollow", and add an icon image
2. fix a bug of not initializing m_highest_overhang_layer
3. fix a bug where normal(auto) with Tree* styles won't generate any
   supports.
4. add popup message when selecting support material for interface.
5. draw connected loops when wall count is larger than 1

Change-Id: I7ea211d2971b25c65724bb10d0f6cf6e0b68c6a1
(cherry picked from commit 4c1ae7f937239fc3e1397ec2cb3b290d886bb0f0)
This commit is contained in:
Arthur 2022-12-21 19:05:14 +08:00 committed by Lane.Wei
parent 2690b5b558
commit 854eb0af95
10 changed files with 138 additions and 85 deletions

View file

@ -5635,5 +5635,21 @@ void GUI_App::disassociate_files(std::wstring extend)
#endif // __WXMSW__
bool is_support_filament(int extruder_id)
{
auto &filament_presets = Slic3r::GUI::wxGetApp().preset_bundle->filament_presets;
auto &filaments = Slic3r::GUI::wxGetApp().preset_bundle->filaments;
if (extruder_id >= filament_presets.size()) return false;
Slic3r::Preset *filament = filaments.find_preset(filament_presets[extruder_id]);
if (filament == nullptr) return false;
Slic3r::ConfigOptionBools *support_option = dynamic_cast<Slic3r::ConfigOptionBools *>(filament->config.option("filament_is_support"));
if (support_option == nullptr) return false;
return support_option->get_at(0);
};
} // GUI
} //Slic3r

View file

@ -589,7 +589,9 @@ private:
DECLARE_APP(GUI_App)
wxDECLARE_EVENT(EVT_CONNECT_LAN_MODE_PRINT, wxCommandEvent);
} // GUI
bool is_support_filament(int extruder_id);
} // namespace GUI
} // Slic3r
#endif // slic3r_GUI_App_hpp_

View file

@ -1418,7 +1418,6 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
// BBS popup a message to ask the user to set optimum parameters for tree support
if (opt_key == "support_type" || opt_key == "support_style") {
// BBS
if (is_tree_slim(m_config->opt_enum<SupportType>("support_type"), m_config->opt_enum<SupportMaterialStyle>("support_style")) &&
!(m_config->opt_float("support_top_z_distance") == 0 && m_config->opt_int("support_interface_top_layers") == 0 && m_config->opt_int("tree_support_wall_count") == 2)) {
wxString msg_text = _L("We have added an experimental style \"Tree Slim\" that features smaller support volume but weaker strength.\n"
@ -1438,6 +1437,28 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
}
}
// BBS popup a message to ask the user to set optimum parameters for support interface if support materials are used
if (opt_key == "support_interface_filament") {
int interface_filament_id = m_config->opt_int("support_interface_filament") - 1; // the displayed id is based from 1, while internal id is based from 0
if (is_support_filament(interface_filament_id) && !(m_config->opt_float("support_top_z_distance") == 0 && m_config->opt_float("support_interface_spacing") == 0 &&
m_config->opt_enum<SupportMaterialInterfacePattern>("support_interface_pattern") == SupportMaterialInterfacePattern::smipConcentric)) {
wxString msg_text = _L("When using support material for the support interface, We recommand the following settings:\n"
"0 top distance, 0 interface spacing, concentric pattern.");
msg_text += "\n\n" + _L("Change these settings automatically? \n"
"Yes - Change these settings automatically\n"
"No - Do not change these settings for me");
MessageDialog dialog(wxGetApp().plater(), msg_text, "Suggestion", wxICON_WARNING | wxYES | wxNO);
DynamicPrintConfig new_conf = *m_config;
if (dialog.ShowModal() == wxID_YES) {
new_conf.set_key_value("support_top_z_distance", new ConfigOptionFloat(0));
new_conf.set_key_value("support_interface_spacing", new ConfigOptionFloat(0));
new_conf.set_key_value("support_interface_pattern", new ConfigOptionEnum<SupportMaterialInterfacePattern>(SupportMaterialInterfacePattern::smipConcentric));
m_config_manipulation.apply(m_config, &new_conf);
}
wxGetApp().plater()->update();
}
}
// BBS
#if 0
if (opt_key == "extruders_count")

View file

@ -611,24 +611,6 @@ void WipingPanel::update_warning_texts()
void WipingPanel::calc_flushing_volumes()
{
auto is_support_filament = [](int extruder_id) -> bool {
auto& filament_presets = Slic3r::GUI::wxGetApp().preset_bundle->filament_presets;
auto& filaments = Slic3r::GUI::wxGetApp().preset_bundle->filaments;
if (extruder_id >= filament_presets.size())
return false;
Slic3r::Preset* filament = filaments.find_preset(filament_presets[extruder_id]);
if (filament == nullptr)
return false;
Slic3r::ConfigOptionBools* support_option = dynamic_cast<Slic3r::ConfigOptionBools*>(filament->config.option("filament_is_support"));
if (support_option == nullptr)
return false;
return support_option->get_at(0);
};
for (int from_idx = 0; from_idx < m_colours.size(); from_idx++) {
const wxColour& from = m_colours[from_idx];
bool is_from_support = is_support_filament(from_idx);