From 7c3319ede2c54f04f602c1cac46807ae83e46bd1 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 23 Jan 2019 14:27:11 +0100 Subject: [PATCH 1/2] Place on bed optimization --- src/slic3r/GUI/GLGizmo.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/GLGizmo.cpp b/src/slic3r/GUI/GLGizmo.cpp index 7efb8786c6..2eba6f741e 100644 --- a/src/slic3r/GUI/GLGizmo.cpp +++ b/src/slic3r/GUI/GLGizmo.cpp @@ -1585,15 +1585,17 @@ void GLGizmoFlatten::update_planes() m_planes.pop_back(); } + // Let's prepare transformation of the normal vector from mesh to instance coordinates. + Geometry::Transformation t(inst_matrix); + Vec3d scaling = t.get_scaling_factor(); + t.set_scaling_factor(Vec3d(1./scaling(0), 1./scaling(1), 1./scaling(2))); + // Now we'll go through all the polygons, transform the points into xy plane to process them: for (unsigned int polygon_id=0; polygon_id < m_planes.size(); ++polygon_id) { Pointf3s& polygon = m_planes[polygon_id].vertices; const Vec3d& normal = m_planes[polygon_id].normal; - // let's transform the normal accodring to the instance matrix: - Geometry::Transformation t(inst_matrix); - Vec3d scaling = t.get_scaling_factor(); - t.set_scaling_factor(Vec3d(1./(scaling(0)*scaling(0)), 1./(scaling(0)*scaling(0)), 1./(scaling(0)*scaling(0)))); + // transform the normal according to the instance matrix: Vec3d normal_transformed = t.get_matrix() * normal; // We are going to rotate about z and y to flatten the plane From d3fa82e41b5500874d37d0e6855954a4112806af Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Wed, 23 Jan 2019 14:38:05 +0100 Subject: [PATCH 2/2] Fix assert on empty datadir --- src/slic3r/GUI/GUI_App.cpp | 2 ++ src/slic3r/GUI/MainFrame.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 9991fee751..462f3c3286 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -194,6 +194,8 @@ bool GUI_App::OnInit() preset_updater->slic3r_update_notify(); } preset_updater->sync(preset_bundle); + + load_current_presets(); }); diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 9c74861c93..46a46e950d 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -155,7 +155,6 @@ void MainFrame::create_preset_tabs() add_created_tab(new TabSLAPrint(m_tabpanel)); add_created_tab(new TabSLAMaterial(m_tabpanel)); add_created_tab(new TabPrinter(m_tabpanel)); - GUI::wxGetApp().load_current_presets(); } void MainFrame::add_created_tab(Tab* panel)