Merging with master, solving conflicts.

This commit is contained in:
tamasmeszaros 2019-03-26 11:13:28 +01:00
commit a49643ebdb
5 changed files with 49 additions and 19 deletions

View file

@ -5012,23 +5012,30 @@ void GLCanvas3D::_render_sla_slices() const
if ((bottom_obj_triangles.empty() || bottom_sup_triangles.empty() || top_obj_triangles.empty() || top_sup_triangles.empty()) &&
obj->is_step_done(slaposIndexSlices) && !obj->get_slice_index().empty())
{
double layer_height = print->default_object_config().layer_height.value;
double initial_layer_height = print->material_config().initial_layer_height.value;
coord_t key_zero = obj->get_slice_index().front().print_level();
coord_t key_low = coord_t((clip_min_z - initial_layer_height) / SCALING_FACTOR) + key_zero;
// Slice at the center of the slab starting at clip_min_z will be rendered for the lower plane.
coord_t key_low = coord_t((clip_min_z - initial_layer_height + layer_height) / SCALING_FACTOR) + key_zero;
// Slice at the center of the slab ending at clip_max_z will be rendered for the upper plane.
coord_t key_high = coord_t((clip_max_z - initial_layer_height) / SCALING_FACTOR) + key_zero;
SliceRecord slice_low = obj->closest_slice_to_print_level(key_low, coord_t(SCALED_EPSILON));
SliceRecord slice_high = obj->closest_slice_to_print_level(key_high, coord_t(SCALED_EPSILON));
const SliceRecord& slice_low = obj->closest_slice_to_print_level(key_low, coord_t(SCALED_EPSILON));
const SliceRecord& slice_high = obj->closest_slice_to_print_level(key_high, coord_t(SCALED_EPSILON));
// Offset to avoid OpenGL Z fighting between the object's horizontal surfaces and the triangluated surfaces of the cuts.
double plane_shift_z = 0.002;
if (! slice_low.is_valid()) {
const ExPolygons& obj_bottom = slice_low.get_slice(soModel);
const ExPolygons& sup_bottom = slice_low.get_slice(soSupport);
// calculate model bottom cap
if (bottom_obj_triangles.empty() && !obj_bottom.empty())
bottom_obj_triangles = triangulate_expolygons_3d(obj_bottom, clip_min_z, true);
bottom_obj_triangles = triangulate_expolygons_3d(obj_bottom, clip_min_z - plane_shift_z, true);
// calculate support bottom cap
if (bottom_sup_triangles.empty() && !sup_bottom.empty())
bottom_sup_triangles = triangulate_expolygons_3d(sup_bottom, clip_min_z, true);
bottom_sup_triangles = triangulate_expolygons_3d(sup_bottom, clip_min_z - plane_shift_z, true);
}
if (! slice_high.is_valid()) {
@ -5036,10 +5043,10 @@ void GLCanvas3D::_render_sla_slices() const
const ExPolygons& sup_top = slice_high.get_slice(soSupport);
// calculate model top cap
if (top_obj_triangles.empty() && !obj_top.empty())
top_obj_triangles = triangulate_expolygons_3d(obj_top, clip_max_z, false);
top_obj_triangles = triangulate_expolygons_3d(obj_top, clip_max_z + plane_shift_z, false);
// calculate support top cap
if (top_sup_triangles.empty() && !sup_top.empty())
top_sup_triangles = triangulate_expolygons_3d(sup_top, clip_max_z, false);
top_sup_triangles = triangulate_expolygons_3d(sup_top, clip_max_z + plane_shift_z, false);
}
}

View file

@ -14,6 +14,7 @@
#include <wx/menu.h>
#include <wx/menuitem.h>
#include <wx/filedlg.h>
#include <wx/progdlg.h>
#include <wx/dir.h>
#include <wx/wupdlock.h>
#include <wx/filefn.h>
@ -279,31 +280,50 @@ void GUI_App::set_label_clr_sys(const wxColour& clr) {
void GUI_App::recreate_GUI()
{
// Weird things happen as the Paint messages are floating around the windows being destructed.
// Avoid the Paint messages by hiding the main window.
// Also the application closes much faster without these unnecessary screen refreshes.
// In addition, there were some crashes due to the Paint events sent to already destructed windows.
mainframe->Show(false);
const auto msg_name = _(L("Changing of an application language")) + dots;
wxProgressDialog dlg(msg_name, msg_name);
dlg.Pulse();
// to make sure nobody accesses data from the soon-to-be-destroyed widgets:
tabs_list.clear();
plater_ = nullptr;
dlg.Update(10, _(L("Recreating")) + dots);
MainFrame* topwindow = mainframe;
mainframe = new MainFrame();
sidebar().obj_list()->init_objects(); // propagate model objects to object list
if (topwindow) {
SetTopWindow(mainframe);
dlg.Update(30, _(L("Recreating")) + dots);
topwindow->Destroy();
}
dlg.Update(80, _(L("Loading of a current presets")) + dots);
m_printhost_job_queue.reset(new PrintHostJobQueue(mainframe->printhost_queue_dlg()));
load_current_presets();
mainframe->Show(true);
// On OSX the UI was not initialized correctly if the wizard was called
// before the UI was up and running.
CallAfter([]() {
// Run the config wizard, don't offer the "reset user profile" checkbox.
config_wizard_startup(true);
});
dlg.Update(90, _(L("Loading of a mode view")) + dots);
update_mode();
// #ys_FIXME_delete_after_testing Do we still need this ?
// CallAfter([]() {
// // Run the config wizard, don't offer the "reset user profile" checkbox.
// config_wizard_startup(true);
// });
}
void GUI_App::system_info()