From 8309a9e8ee8b3fcf4c0dbc8ba8c6261ba2f542a8 Mon Sep 17 00:00:00 2001 From: Ian Bassi Date: Fri, 3 Jul 2026 17:19:24 -0300 Subject: [PATCH] Exposing STEP import values (#14484) Co-authored-by: yw4z --- src/libslic3r/AppConfig.cpp | 13 ++++++-- src/libslic3r/Format/STEP.cpp | 22 +++++++------- src/libslic3r/Format/STEP.hpp | 12 ++++---- src/libslic3r/Model.cpp | 8 ++--- src/libslic3r/Model.hpp | 4 +-- src/slic3r/GUI/GUI_ObjectList.cpp | 8 ++--- src/slic3r/GUI/Plater.cpp | 20 ++++++------- src/slic3r/GUI/Preferences.cpp | 50 +++++++++++++++++++++++++++++++ src/slic3r/GUI/Preferences.hpp | 1 + src/slic3r/GUI/StepMeshDialog.cpp | 28 +++++++++++------ src/slic3r/GUI/StepMeshDialog.hpp | 5 ++-- 11 files changed, 120 insertions(+), 51 deletions(-) diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index e84f469670..c81e6c391c 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -579,9 +579,16 @@ void AppConfig::set_defaults() if (get("enable_step_mesh_setting").empty()) { set_bool("enable_step_mesh_setting", true); } - if (get("linear_defletion", "angle_defletion").empty()) { - set("linear_defletion", "0.003"); - set("angle_defletion", "0.5"); + // Migrate legacy misspelled keys (linear_defletion/angle_defletion) to the corrected spelling. + if (get("linear_deflection").empty() && !get("linear_defletion").empty()) + set("linear_deflection", get("linear_defletion")); + if (get("angle_deflection").empty() && !get("angle_defletion").empty()) + set("angle_deflection", get("angle_defletion")); + if (get("linear_deflection").empty()) { + set("linear_deflection", "0.003"); + } + if (get("angle_deflection").empty()) { + set("angle_deflection", "0.5"); } if (get("is_split_compound").empty()) { set_bool("is_split_compound", false); diff --git a/src/libslic3r/Format/STEP.cpp b/src/libslic3r/Format/STEP.cpp index 3ea3de5914..8b07286c5b 100644 --- a/src/libslic3r/Format/STEP.cpp +++ b/src/libslic3r/Format/STEP.cpp @@ -230,8 +230,8 @@ static void getNamedSolids(const TopLoc_Location& location, } //bool load_step(const char *path, Model *model, bool& is_cancel, -// double linear_defletion/*=0.003*/, -// double angle_defletion/*= 0.5*/, +// double linear_deflection/*=0.003*/, +// double angle_deflection/*= 0.5*/, // bool isSplitCompound, // ImportStepProgressFn stepFn, StepIsUtf8Fn isUtf8Fn, long& mesh_face_num) //{ @@ -288,7 +288,7 @@ static void getNamedSolids(const TopLoc_Location& location, // stl.resize(namedSolids.size()); // tbb::parallel_for(tbb::blocked_range(0, namedSolids.size()), [&](const tbb::blocked_range &range) { // for (size_t i = range.begin(); i < range.end(); i++) { -// BRepMesh_IncrementalMesh mesh(namedSolids[i].solid, linear_defletion, false, angle_defletion, true); +// BRepMesh_IncrementalMesh mesh(namedSolids[i].solid, linear_deflection, false, angle_deflection, true); // // BBS: calculate total number of the nodes and triangles // int aNbNodes = 0; // int aNbTriangles = 0; @@ -511,8 +511,8 @@ Step::Step_Status Step::load() Step::Step_Status Step::mesh(Model* model, bool& is_cancel, bool isSplitCompound, - double linear_defletion/*=0.003*/, - double angle_defletion/*= 0.5*/) + double linear_deflection/*=0.003*/, + double angle_deflection/*= 0.5*/) { bool task_result = false; @@ -544,7 +544,7 @@ Step::Step_Status Step::mesh(Model* model, stl.resize(namedSolids.size()); tbb::parallel_for(tbb::blocked_range(0, namedSolids.size()), [&](const tbb::blocked_range& range) { for (size_t i = range.begin(); i < range.end(); i++) { - BRepMesh_IncrementalMesh mesh(namedSolids[i].solid, linear_defletion, false, angle_defletion, true); + BRepMesh_IncrementalMesh mesh(namedSolids[i].solid, linear_deflection, false, angle_deflection, true); // BBS: calculate total number of the nodes and triangles int aNbNodes = 0; int aNbTriangles = 0; @@ -689,15 +689,15 @@ void Step::clean_mesh_data() } } -unsigned int Step::get_triangle_num(double linear_defletion, double angle_defletion) +unsigned int Step::get_triangle_num(double linear_deflection, double angle_deflection) { unsigned int tri_num = 0; try { Handle(StepProgressIncdicator) progress = new StepProgressIncdicator(m_stop_mesh); clean_mesh_data(); IMeshTools_Parameters param; - param.Deflection = linear_defletion; - param.Angle = angle_defletion; + param.Deflection = linear_deflection; + param.Angle = angle_deflection; param.InParallel = true; for (int i = 0; i < m_name_solids.size(); ++i) { BRepMesh_IncrementalMesh mesh(m_name_solids[i].solid, param, progress->Start()); @@ -719,7 +719,7 @@ unsigned int Step::get_triangle_num(double linear_defletion, double angle_deflet return tri_num; } -unsigned int Step::get_triangle_num_tbb(double linear_defletion, double angle_defletion) +unsigned int Step::get_triangle_num_tbb(double linear_deflection, double angle_deflection) { unsigned int tri_num = 0; clean_mesh_data(); @@ -727,7 +727,7 @@ unsigned int Step::get_triangle_num_tbb(double linear_defletion, double angle_de [&](const tbb::blocked_range& range) { for (size_t i = range.begin(); i < range.end(); i++) { unsigned int solids_tri_num = 0; - BRepMesh_IncrementalMesh mesh(m_name_solids[i].solid, linear_defletion, false, angle_defletion, true); + BRepMesh_IncrementalMesh mesh(m_name_solids[i].solid, linear_deflection, false, angle_deflection, true); for (TopExp_Explorer anExpSF(m_name_solids[i].solid, TopAbs_FACE); anExpSF.More(); anExpSF.Next()) { TopLoc_Location aLoc; Handle(Poly_Triangulation) aTriangulation = BRep_Tool::Triangulation(TopoDS::Face(anExpSF.Current()), aLoc); diff --git a/src/libslic3r/Format/STEP.hpp b/src/libslic3r/Format/STEP.hpp index 3253553567..1a65d5956b 100644 --- a/src/libslic3r/Format/STEP.hpp +++ b/src/libslic3r/Format/STEP.hpp @@ -38,8 +38,8 @@ struct NamedSolid //BBS: Load an step file into a provided model. extern bool load_step(const char *path, Model *model, bool& is_cancel, - double linear_defletion = 0.003, - double angle_defletion = 0.5, + double linear_deflection = 0.003, + double angle_deflection = 0.5, bool isSplitCompound = false, ImportStepProgressFn proFn = nullptr, StepIsUtf8Fn isUtf8Fn = nullptr, @@ -98,14 +98,14 @@ public: Step(std::string path, ImportStepProgressFn stepFn = nullptr, StepIsUtf8Fn isUtf8Fn = nullptr); ~Step(); Step_Status load(); - unsigned int get_triangle_num(double linear_defletion, double angle_defletion); - unsigned int get_triangle_num_tbb(double linear_defletion, double angle_defletion); + unsigned int get_triangle_num(double linear_deflection, double angle_deflection); + unsigned int get_triangle_num_tbb(double linear_deflection, double angle_deflection); void clean_mesh_data(); Step_Status mesh(Model* model, bool& is_cancel, bool isSplitCompound, - double linear_defletion = 0.003, - double angle_defletion = 0.5); + double linear_deflection = 0.003, + double angle_deflection = 0.5); std::atomic m_stop_mesh{false}; void update_process(int load_stage, int current, int total, bool& cancel); diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index ede9a15d33..233c259424 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -187,8 +187,8 @@ Model Model::read_from_step(const std::string& ImportStepProgressFn stepFn, StepIsUtf8Fn stepIsUtf8Fn, std::function step_mesh_fn, - double linear_defletion, - double angle_defletion, + double linear_deflection, + double angle_deflection, bool is_split_compound) { Model model; @@ -201,13 +201,13 @@ Model Model::read_from_step(const std::string& goto _finished; } if (step_mesh_fn) { - if (step_mesh_fn(step_file, linear_defletion, angle_defletion, is_split_compound) == -1) { + if (step_mesh_fn(step_file, linear_deflection, angle_deflection, is_split_compound) == -1) { status = Step::Step_Status::CANCEL; goto _finished; } } - status = step_file.mesh(&model, is_cb_cancel, is_split_compound, linear_defletion, angle_defletion); + status = step_file.mesh(&model, is_cb_cancel, is_split_compound, linear_deflection, angle_deflection); _finished: diff --git a/src/libslic3r/Model.hpp b/src/libslic3r/Model.hpp index d8697adb41..d04a6095c7 100644 --- a/src/libslic3r/Model.hpp +++ b/src/libslic3r/Model.hpp @@ -1588,8 +1588,8 @@ public: ImportStepProgressFn stepFn, StepIsUtf8Fn stepIsUtf8Fn, std::function step_mesh_fn, - double linear_defletion, - double angle_defletion, + double linear_deflection, + double angle_deflection, bool is_split_compound); //BBS: add part plate related logic diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index d56439f05a..fcdf005aad 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2316,9 +2316,9 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo try { if (boost::iends_with(input_file, ".stp") || boost::iends_with(input_file, ".step")) { - double linear = string_to_double_decimal_point(wxGetApp().app_config->get("linear_defletion")); + double linear = string_to_double_decimal_point(wxGetApp().app_config->get("linear_deflection")); if (linear <= 0) linear = 0.003; - double angle = string_to_double_decimal_point(wxGetApp().app_config->get("angle_defletion")); + double angle = string_to_double_decimal_point(wxGetApp().app_config->get("angle_deflection")); if (angle <= 0) angle = 0.5; bool split_compound = wxGetApp().app_config->get_bool("is_split_compound"); model = Model::read_from_step( @@ -2328,8 +2328,8 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo if (wxGetApp().app_config->get_bool("enable_step_mesh_setting")) { StepMeshDialog mesh_dlg(nullptr, file, linear, angle); if (mesh_dlg.ShowModal() == wxID_OK) { - linear_value = mesh_dlg.get_linear_defletion(); - angle_value = mesh_dlg.get_angle_defletion(); + linear_value = mesh_dlg.get_linear_deflection(); + angle_value = mesh_dlg.get_angle_deflection(); is_split = mesh_dlg.get_split_compound_value(); return 1; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 1c37e70b37..1f3436187a 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6637,9 +6637,9 @@ std::vector Plater::priv::load_files(const std::vector& input_ }; if (boost::iends_with(path.string(), ".stp") || boost::iends_with(path.string(), ".step")) { - double linear = string_to_double_decimal_point(wxGetApp().app_config->get("linear_defletion")); + double linear = string_to_double_decimal_point(wxGetApp().app_config->get("linear_deflection")); if (linear <= 0) linear = 0.003; - double angle = string_to_double_decimal_point(wxGetApp().app_config->get("angle_defletion")); + double angle = string_to_double_decimal_point(wxGetApp().app_config->get("angle_deflection")); if (angle <= 0) angle = 0.5; bool split_compound = wxGetApp().app_config->get_bool("is_split_compound"); model = Slic3r::Model:: read_from_step(path.string(), strategy, @@ -6671,8 +6671,8 @@ std::vector Plater::priv::load_files(const std::vector& input_ if (wxGetApp().app_config->get_bool("enable_step_mesh_setting")) { StepMeshDialog mesh_dlg(nullptr, file, linear, angle); if (mesh_dlg.ShowModal() == wxID_OK) { - linear_value = mesh_dlg.get_linear_defletion(); - angle_value = mesh_dlg.get_angle_defletion(); + linear_value = mesh_dlg.get_linear_deflection(); + angle_value = mesh_dlg.get_angle_deflection(); is_split = mesh_dlg.get_split_compound_value(); return 1; } @@ -8418,8 +8418,8 @@ bool Plater::priv::replace_volume_with_stl(int object_idx, int volume_idx, const const bool is_step = boost::algorithm::iends_with(path, ".stp") || boost::algorithm::iends_with(path, ".step"); if (is_step) { auto config = wxGetApp().app_config; - double linear = std::max(0.003, string_to_double_decimal_point(config->get("linear_defletion"))); - double angle = std::max(0.5, string_to_double_decimal_point(config->get("angle_defletion"))); + double linear = std::max(0.003, string_to_double_decimal_point(config->get("linear_deflection"))); + double angle = std::max(0.5, string_to_double_decimal_point(config->get("angle_deflection"))); bool split_compound = config->get_bool("is_split_compound"); bool is_user_cancel = false; @@ -8427,8 +8427,8 @@ bool Plater::priv::replace_volume_with_stl(int object_idx, int volume_idx, const if (wxGetApp().app_config->get_bool("enable_step_mesh_setting")) { StepMeshDialog mesh_dlg(nullptr, file, linear, angle); if (mesh_dlg.ShowModal() == wxID_OK) { - linear_value = mesh_dlg.get_linear_defletion(); - angle_value = mesh_dlg.get_angle_defletion(); + linear_value = mesh_dlg.get_linear_deflection(); + angle_value = mesh_dlg.get_angle_deflection(); is_split = mesh_dlg.get_split_compound_value(); return 1; } @@ -8911,8 +8911,8 @@ void Plater::priv::reload_from_disk() // BBS: backup if (boost::iends_with(path, ".stp") || boost::iends_with(path, ".step")) { - double linear = string_to_double_decimal_point(wxGetApp().app_config->get("linear_defletion")); - double angle = string_to_double_decimal_point(wxGetApp().app_config->get("angle_defletion")); + double linear = string_to_double_decimal_point(wxGetApp().app_config->get("linear_deflection")); + double angle = string_to_double_decimal_point(wxGetApp().app_config->get("angle_deflection")); bool is_split = wxGetApp().app_config->get_bool("is_split_compound"); new_model = Model::read_from_step(path, LoadStrategy::AddDefaultInstances | LoadStrategy::LoadModel, nullptr, nullptr, nullptr, linear, angle, is_split); }else { diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index 01c616faee..b0aba418dc 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -783,6 +783,47 @@ wxBoxSizer *PreferencesDialog::create_camera_orbit_mult_input(wxString title, wx return m_sizer; } +wxBoxSizer *PreferencesDialog::create_item_decimal_input(wxString title, wxString title2, wxString tooltip, std::string param, double min, double max, int decimals, const wxString wiki_url) +{ + auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty + + wxBoxSizer *m_sizer = create_item_label(title, tip, wiki_url); + + auto input = new ::TextInput(m_parent, wxEmptyString, title2, wxEmptyString, wxDefaultPosition, DESIGN_INPUT_SIZE, wxTE_PROCESS_ENTER); + StateColor input_bg(std::pair(wxColour("#F0F0F1"), StateColor::Disabled), std::pair(*wxWHITE, StateColor::Enabled)); + input->SetBackgroundColor(input_bg); + input->GetTextCtrl()->SetValue(app_config->get(param)); + wxTextValidator validator(wxFILTER_NUMERIC); + input->SetToolTip(tooltip); + input->GetTextCtrl()->SetValidator(validator); + + m_sizer->Add(input, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(5)); + + auto apply_value = [this, param, input, min, max, decimals]() { + auto value = input->GetTextCtrl()->GetValue(); + double conv = min; + if (value.ToCDouble(&conv)) { + conv = conv < min ? min : conv > max ? max : conv; + auto strval = std::string(wxString::FromCDouble(conv, decimals).mb_str()); + input->GetTextCtrl()->SetValue(strval); + app_config->set(param, strval); + } + }; + + input->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [apply_value](wxCommandEvent &e) { + apply_value(); + wxGetApp().app_config->save(); + e.Skip(); + }); + + input->GetTextCtrl()->Bind(wxEVT_KILL_FOCUS, [apply_value](wxFocusEvent &e) { + apply_value(); + e.Skip(); + }); + + return m_sizer; +} + wxBoxSizer *PreferencesDialog::create_item_backup(wxString title, wxString tooltip) { auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty @@ -1605,6 +1646,15 @@ void PreferencesDialog::create_items() ); g_sizer->Add(item_step_dialog); + auto item_step_linear = create_item_decimal_input(_L("STEP importing: linear deflection"), "mm", _L("Linear deflection used when meshing imported STEP files.\nSmaller values produce higher-quality meshes but increase processing time.\nUsed as the default in the import dialog, or directly when the import dialog is disabled.\nDefault: 0.003 mm."), "linear_deflection", 0.001, 0.1, 3); + g_sizer->Add(item_step_linear); + + auto item_step_angle = create_item_decimal_input(_L("STEP importing: angle deflection"), "", _L("Angle deflection used when meshing imported STEP files.\nSmaller values produce higher-quality meshes but increase processing time.\nUsed as the default in the import dialog, or directly when the import dialog is disabled.\nDefault: 0.5."), "angle_deflection", 0.01, 1.0, 2); + g_sizer->Add(item_step_angle); + + auto item_step_split = create_item_checkbox(_L("STEP importing: Split into multiple objects"), _L("If enabled, compound and compsolid shapes in imported STEP files are split into multiple objects.\nUsed as the default in the import dialog, or directly when the import dialog is disabled.\nDefault: disabled."), "is_split_compound"); + g_sizer->Add(item_step_split); + auto item_draco_bits = create_item_spinctrl(_L("Quality level for Draco export"), "", _L("bits"), _L("Controls the quantization bit depth used when compressing the mesh to Draco format.\n" diff --git a/src/slic3r/GUI/Preferences.hpp b/src/slic3r/GUI/Preferences.hpp index 86d1e06358..95bfcb5367 100644 --- a/src/slic3r/GUI/Preferences.hpp +++ b/src/slic3r/GUI/Preferences.hpp @@ -96,6 +96,7 @@ public: wxBoxSizer *create_item_input(wxString title, wxString title2, wxString tooltip, std::string param, std::function onchange = {}, const wxString wiki_url = ""); wxBoxSizer *create_item_spinctrl(wxString title, wxString title2, wxString side_label, wxString tooltip, std::string param, int min, int max, std::function onchange = nullptr, const wxString wiki_url = ""); wxBoxSizer *create_camera_orbit_mult_input(wxString title, wxString tooltip); + wxBoxSizer *create_item_decimal_input(wxString title, wxString title2, wxString tooltip, std::string param, double min, double max, int decimals, const wxString wiki_url = ""); wxBoxSizer *create_item_backup(wxString title, wxString tooltip); wxBoxSizer *create_item_auto_reslice(wxString title, wxString checkbox_tooltip, wxString delay_tooltip); wxBoxSizer *create_item_bambu_cloud(wxString title, wxString tooltip); diff --git a/src/slic3r/GUI/StepMeshDialog.cpp b/src/slic3r/GUI/StepMeshDialog.cpp index 5f74a79b7d..33e1c4914a 100644 --- a/src/slic3r/GUI/StepMeshDialog.cpp +++ b/src/slic3r/GUI/StepMeshDialog.cpp @@ -144,7 +144,7 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line linear_sizer->Add(linear_title, 0, wxALIGN_LEFT); linear_sizer->AddStretchSpacer(1); wxSlider* linear_slider = new wxSlider(this, wxID_ANY, - SLIDER_SCALE(get_linear_defletion()), + SLIDER_SCALE(get_linear_deflection()), 1, 100, wxDefaultPosition, wxSize(SLIDER_WIDTH, SLIDER_HEIGHT), wxSL_HORIZONTAL); @@ -199,7 +199,7 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line angle_sizer->Add(angle_title, 0, wxALIGN_LEFT); angle_sizer->AddStretchSpacer(1); wxSlider* angle_slider = new wxSlider(this, wxID_ANY, - SLIDER_SCALE_10(get_angle_defletion()), + SLIDER_SCALE_10(get_angle_deflection()), 1, 100, wxDefaultPosition, wxSize(SLIDER_WIDTH, SLIDER_HEIGHT), wxSL_HORIZONTAL); @@ -265,6 +265,14 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line mesh_face_number_sizer->Add(mesh_face_number_text, 0, wxALIGN_LEFT); bSizer->Add(mesh_face_number_sizer, 0, wxEXPAND | wxALL, LEFT_RIGHT_PADING); + wxBoxSizer* save_default_sizer = new wxBoxSizer(wxHORIZONTAL); + m_save_default_checkbox = new wxCheckBox(this, wxID_ANY, _L("Save these settings as default"), wxDefaultPosition, wxDefaultSize, 0); + m_save_default_checkbox->SetFont(::Label::Body_14); + m_save_default_checkbox->SetForegroundColour(StateColor::darkModeColorFor(FONT_COLOR)); + m_save_default_checkbox->SetToolTip(_L("If enabled, the values above are stored as the defaults used for future STEP imports (and shown in Preferences).")); + save_default_sizer->Add(m_save_default_checkbox, 0, wxALIGN_LEFT); + bSizer->Add(save_default_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, LEFT_RIGHT_PADING); + wxBoxSizer* bSizer_button = new wxBoxSizer(wxHORIZONTAL); bSizer_button->SetMinSize(wxSize(FromDIP(100), -1)); m_checkbox = new wxCheckBox(this, wxID_ANY, _L("Don't show again"), wxDefaultPosition, wxDefaultSize, 0); @@ -284,9 +292,11 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line if (m_checkbox->IsChecked()) { wxGetApp().app_config->set_bool("enable_step_mesh_setting", false); } - wxGetApp().app_config->set_bool("is_split_compound", m_split_compound_checkbox->GetValue()); - wxGetApp().app_config->set("linear_defletion", float_to_string_decimal_point(get_linear_defletion(), 3)); - wxGetApp().app_config->set("angle_defletion", float_to_string_decimal_point(get_angle_defletion(), 2)); + if (m_save_default_checkbox->IsChecked()) { + wxGetApp().app_config->set_bool("is_split_compound", m_split_compound_checkbox->GetValue()); + wxGetApp().app_config->set("linear_deflection", float_to_string_decimal_point(get_linear_deflection(), 3)); + wxGetApp().app_config->set("angle_deflection", float_to_string_decimal_point(get_angle_deflection(), 2)); + } EndModal(wxID_OK); } @@ -354,21 +364,21 @@ void StepMeshDialog::stop_task() void StepMeshDialog::update_mesh_number_text() { - if ((m_last_linear == get_linear_defletion()) && (m_last_angle == get_angle_defletion()) && (m_mesh_number != 0)) + if ((m_last_linear == get_linear_deflection()) && (m_last_angle == get_angle_deflection()) && (m_mesh_number != 0)) return; wxString newText = wxString::Format(_L("Calculating, please wait...")); mesh_face_number_text->SetLabel(newText); stop_task(); if (!m_task) { m_task = new boost::thread(Slic3r::create_thread([this]() -> void { - m_mesh_number = m_file.get_triangle_num(get_linear_defletion(), get_angle_defletion()); + m_mesh_number = m_file.get_triangle_num(get_linear_deflection(), get_angle_deflection()); if (m_mesh_number != 0) { wxString number_text = wxString::Format("%d", m_mesh_number); wxCommandEvent event(wxEVT_THREAD_DONE); event.SetString(number_text); wxPostEvent(this, event); - m_last_linear = get_linear_defletion(); - m_last_angle = get_angle_defletion(); + m_last_linear = get_linear_deflection(); + m_last_angle = get_angle_deflection(); } })); } diff --git a/src/slic3r/GUI/StepMeshDialog.hpp b/src/slic3r/GUI/StepMeshDialog.hpp index 6b14ecfc66..af7f150157 100644 --- a/src/slic3r/GUI/StepMeshDialog.hpp +++ b/src/slic3r/GUI/StepMeshDialog.hpp @@ -14,7 +14,7 @@ public: StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double linear_init, double angle_init); ~StepMeshDialog() override; void on_dpi_changed(const wxRect& suggested_rect) override; - inline double get_linear_defletion() { + inline double get_linear_deflection() { double value; if (m_linear_last.ToDouble(&value)) { return value; @@ -22,7 +22,7 @@ public: return m_last_linear; } } - inline double get_angle_defletion() { + inline double get_angle_deflection() { double value; if (m_angle_last.ToDouble(&value)) { return value; @@ -37,6 +37,7 @@ private: Slic3r::Step& m_file; wxCheckBox* m_checkbox = nullptr; wxCheckBox* m_split_compound_checkbox = nullptr; + wxCheckBox* m_save_default_checkbox = nullptr; wxString m_linear_last; wxString m_angle_last; wxStaticText* mesh_face_number_text;