ENH: [Tree Support] smooth_nodes and draw ellipse works

1. smooth nodes' positions
2. draw ellipse along movement direction
3. fix a bug of radius not smooth
4. fix a bug of Tree Strong having too large radius
5. fix a bug in plan_layer_heights: when wipe tower is
   enabled, independent_support_layer_height is false, and all support
   layers should be exactly the same as the object.
   Jira: STUDIO-1785
6. move support style popup message to on_value_change, so only show the
   popup when the user changes support type or style.

Change-Id: Ibced7a28f436d96000ee35a7194b68bb5a20a32d
(cherry picked from commit 0d814b07e433533c8de1b7a04bf52b577de0778d)
This commit is contained in:
Arthur 2022-12-07 20:32:33 +08:00 committed by Lane.Wei
parent 629e68f4a0
commit 3e7b5e7657
3 changed files with 75 additions and 61 deletions

View file

@ -349,30 +349,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
is_msg_dlg_already_exist = false;
}
// BBS
if (config->opt_bool("enable_support") && is_tree(config->opt_enum<SupportType>("support_type"))
&& (config->opt_enum<SupportMaterialStyle>("support_style")==smsDefault || config->opt_enum<SupportMaterialStyle>("support_style")==smsTreeSlim)
&& !(config->opt_float("support_top_z_distance")==0 && config->opt_int("support_interface_top_layers")==0 && 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"
"We recommand using it with: 0 interface layers, 0 top distance, 2 walls.\n"));
if (is_global_config)
msg_text += "\n" + _(L("Change these settings automatically? \n"
"Yes - Change these settings automatically\n"
"No - Do not change these settings for me"));
MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | (is_global_config ? wxYES | wxNO : wxOK));
DynamicPrintConfig new_conf = *config;
is_msg_dlg_already_exist = true;
auto answer = dialog.ShowModal();
if (!is_global_config || answer == wxID_YES) {
new_conf.set_key_value("support_top_z_distance", new ConfigOptionFloat(0));
new_conf.set_key_value("support_interface_top_layers", new ConfigOptionInt(0));
new_conf.set_key_value("tree_support_wall_count", new ConfigOptionInt(2));
}
apply(config, &new_conf);
is_msg_dlg_already_exist = false;
}
// BBS
int filament_cnt = wxGetApp().preset_bundle->filament_presets.size();
#if 0