mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 00:07:52 -06:00
Add a new handy model: Orca string hell (#3892)
* add string hell * tweak message
This commit is contained in:
parent
da349202d2
commit
d1eea4c677
2 changed files with 52 additions and 20 deletions
BIN
resources/handy_models/Orca_stringhell.stl
Normal file
BIN
resources/handy_models/Orca_stringhell.stl
Normal file
Binary file not shown.
|
@ -2,6 +2,7 @@
|
||||||
///|/
|
///|/
|
||||||
///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
||||||
///|/
|
///|/
|
||||||
|
#include "libslic3r/Config.hpp"
|
||||||
#include "libslic3r/libslic3r.h"
|
#include "libslic3r/libslic3r.h"
|
||||||
#include "libslic3r/PresetBundle.hpp"
|
#include "libslic3r/PresetBundle.hpp"
|
||||||
#include "libslic3r/Model.hpp"
|
#include "libslic3r/Model.hpp"
|
||||||
|
@ -23,8 +24,11 @@
|
||||||
#include "Gizmos/GLGizmoSVG.hpp"
|
#include "Gizmos/GLGizmoSVG.hpp"
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
#include "slic3r/GUI/Tab.hpp"
|
||||||
#include "slic3r/Utils/FixModelByWin10.hpp"
|
#include "slic3r/Utils/FixModelByWin10.hpp"
|
||||||
#include "ParamsPanel.hpp"
|
#include "ParamsPanel.hpp"
|
||||||
|
#include "MsgDialog.hpp"
|
||||||
|
#include "wx/utils.h"
|
||||||
|
|
||||||
namespace Slic3r
|
namespace Slic3r
|
||||||
{
|
{
|
||||||
|
@ -518,11 +522,12 @@ wxMenu* MenuFactory::append_submenu_add_handy_model(wxMenu* menu, ModelVolumeTyp
|
||||||
auto sub_menu = new wxMenu;
|
auto sub_menu = new wxMenu;
|
||||||
|
|
||||||
for (auto &item : {L("Orca Cube"), L("3DBenchy"), L("Autodesk FDM Test"),
|
for (auto &item : {L("Orca Cube"), L("3DBenchy"), L("Autodesk FDM Test"),
|
||||||
L("Voron Cube"), L("Stanford Bunny")}) {
|
L("Voron Cube"), L("Stanford Bunny"), L("Orca String Hell") }) {
|
||||||
append_menu_item(
|
append_menu_item(
|
||||||
sub_menu, wxID_ANY, _(item), "",
|
sub_menu, wxID_ANY, _(item), "",
|
||||||
[type, item](wxCommandEvent &) {
|
[type, item](wxCommandEvent&) {
|
||||||
std::vector<boost::filesystem::path> input_files;
|
std::vector<boost::filesystem::path> input_files;
|
||||||
|
bool is_stringhell = false;
|
||||||
std::string file_name = item;
|
std::string file_name = item;
|
||||||
if (file_name == L("Orca Cube"))
|
if (file_name == L("Orca Cube"))
|
||||||
file_name = "OrcaCube_v2.3mf";
|
file_name = "OrcaCube_v2.3mf";
|
||||||
|
@ -534,12 +539,39 @@ wxMenu* MenuFactory::append_submenu_add_handy_model(wxMenu* menu, ModelVolumeTyp
|
||||||
file_name = "Voron_Design_Cube_v7.stl";
|
file_name = "Voron_Design_Cube_v7.stl";
|
||||||
else if (file_name == L("Stanford Bunny"))
|
else if (file_name == L("Stanford Bunny"))
|
||||||
file_name = "Stanford_Bunny.stl";
|
file_name = "Stanford_Bunny.stl";
|
||||||
else
|
else if (file_name == L("Orca String Hell")) {
|
||||||
|
file_name = "Orca_stringhell.stl";
|
||||||
|
is_stringhell = true;
|
||||||
|
} else
|
||||||
return;
|
return;
|
||||||
input_files.push_back(
|
input_files.push_back((boost::filesystem::path(Slic3r::resources_dir()) / "handy_models" / file_name));
|
||||||
(boost::filesystem::path(Slic3r::resources_dir()) /
|
|
||||||
"handy_models" / file_name));
|
|
||||||
plater()->load_files(input_files, LoadStrategy::LoadModel);
|
plater()->load_files(input_files, LoadStrategy::LoadModel);
|
||||||
|
|
||||||
|
// Suggest to change settings for stringhell
|
||||||
|
// This serves as mini tutorial for new users
|
||||||
|
if (is_stringhell) {
|
||||||
|
wxGetApp().CallAfter([=] {
|
||||||
|
DynamicPrintConfig* m_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||||
|
|
||||||
|
bool is_only_one_wall_top = m_config->opt_bool("only_one_wall_top");
|
||||||
|
auto min_width_top_surface = m_config->option<ConfigOptionFloatOrPercent>("min_width_top_surface")->value;
|
||||||
|
if (is_only_one_wall_top && min_width_top_surface > 0) {
|
||||||
|
wxString msg_text = _L("This model features text embossment on the top surface. For optimal results, it is "
|
||||||
|
"advisable to set the 'One Wall Threshold(min_width_top_surface)' "
|
||||||
|
"to 0 for the 'Only One Wall on Top Surfaces' to work best.\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);
|
||||||
|
if (dialog.ShowModal() == wxID_YES) {
|
||||||
|
m_config->set_key_value("min_width_top_surface", new ConfigOptionFloatOrPercent(0, false));
|
||||||
|
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty();
|
||||||
|
wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config();
|
||||||
|
}
|
||||||
|
wxGetApp().plater()->update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"", menu);
|
"", menu);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue