ENH: expor core spec 3mf

Change-Id: I97ccd87f29668833881b9327b251c2ca110ecd31
This commit is contained in:
chunmao.guo 2022-08-26 17:13:14 +08:00 committed by Lane.Wei
parent 29267b58d3
commit 0fa82b5e18
3 changed files with 12 additions and 0 deletions

View File

@ -1765,6 +1765,9 @@ void MainFrame::init_menubar_as_editor()
append_menu_item(export_menu, wxID_ANY, _L("Export all objects as STL") + dots, _L("Export all objects as STL"),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_stl(); }, "menu_export_stl", nullptr,
[this](){return can_export_model(); }, this);
append_menu_item(export_menu, wxID_ANY, _L("Export Generic 3MF") + dots/* + "\tCtrl+G"*/, _L("Export 3mf file without using some 3mf-extensions"),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_core_3mf(); }, "menu_export_sliced_file", nullptr,
[this](){return can_export_model(); }, this);
// BBS export .gcode.3mf
append_menu_item(export_menu, wxID_ANY, _L("Export Sliced File") + dots/* + "\tCtrl+G"*/, _L("Export current Sliced file"),
[this](wxCommandEvent&) { if (m_plater) wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_EXPORT_SLICED_FILE)); }, "menu_export_sliced_file", nullptr,

View File

@ -8057,6 +8057,14 @@ void Plater::export_gcode_3mf()
}
}
void Plater::export_core_3mf()
{
wxString path = p->get_export_file(FT_3MF);
if (path.empty()) { return; }
const std::string path_u8 = into_u8(path);
export_3mf(path_u8, SaveStrategy::Silence);
}
void Plater::export_stl(bool extended, bool selection_only)
{
if (p->model.objects.empty()) { return; }

View File

@ -297,6 +297,7 @@ public:
void export_gcode(bool prefer_removable);
void export_gcode_3mf();
void export_core_3mf();
void export_stl(bool extended = false, bool selection_only = false);
//BBS: remove amf
//void export_amf();