Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits

This commit is contained in:
enricoturri1966 2021-05-19 08:27:27 +02:00
commit d60893b990
22 changed files with 561 additions and 488 deletions

View file

@ -2327,6 +2327,7 @@ void ObjectList::update_info_items(size_t obj_idx)
should_show = printer_technology() == ptFFF
&& ! model_object->layer_height_profile.empty();
break;
default: break;
}
if (! shows && should_show) {
@ -2509,8 +2510,8 @@ void ObjectList::select_object_item(bool is_msr_gizmo)
{
if (wxDataViewItem item = GetSelection()) {
ItemType type = m_objects_model->GetItemType(item);
bool is_volume_item = type == itVolume || type == itSettings && m_objects_model->GetItemType(m_objects_model->GetParent(item)) == itVolume;
if (is_msr_gizmo && is_volume_item || type == itObject)
bool is_volume_item = type == itVolume || (type == itSettings && m_objects_model->GetItemType(m_objects_model->GetParent(item)) == itVolume);
if ((is_msr_gizmo && is_volume_item) || type == itObject)
return;
if (wxDataViewItem obj_item = m_objects_model->GetTopParent(item)) {

View file

@ -675,7 +675,7 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
if (cur_area != bottom_area && fabs(cur_area - bottom_area) > scale_(scale_(1)))
break;
}
if (i < size_t(0.3 * num_layers))
if (i < int(0.3 * num_layers))
continue;
// bottom layer have to be a biggest, so control relation between bottom layer and object size

View file

@ -545,7 +545,7 @@ void MainFrame::init_tabpanel()
m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, [this](wxBookCtrlEvent& e) {
#if ENABLE_VALIDATE_CUSTOM_GCODE
if (int old_selection = e.GetOldSelection();
old_selection != wxNOT_FOUND && old_selection < m_tabpanel->GetPageCount()) {
old_selection != wxNOT_FOUND && old_selection < static_cast<int>(m_tabpanel->GetPageCount())) {
Tab* old_tab = dynamic_cast<Tab*>(m_tabpanel->GetPage(old_selection));
if (old_tab)
old_tab->validate_custom_gcodes();

View file

@ -29,7 +29,6 @@ void MeshClipper::set_mesh(const TriangleMesh& mesh)
m_mesh = &mesh;
m_triangles_valid = false;
m_triangles2d.resize(0);
m_tms.reset(nullptr);
}
}
@ -68,11 +67,6 @@ void MeshClipper::render_cut()
void MeshClipper::recalculate_triangles()
{
if (! m_tms) {
m_tms.reset(new TriangleMeshSlicer);
m_tms->init(m_mesh, [](){});
}
const Transform3f& instance_matrix_no_translation_no_scaling = m_trafo.get_matrix(true,false,true).cast<float>();
const Vec3f& scaling = m_trafo.get_scaling_factor().cast<float>();
// Calculate clipping plane normal in mesh coordinates.
@ -82,16 +76,15 @@ void MeshClipper::recalculate_triangles()
float height_mesh = m_plane.distance(m_trafo.get_offset()) * (up_noscale.norm()/up.norm());
// Now do the cutting
std::vector<ExPolygons> list_of_expolys;
m_tms->set_up_direction(up.cast<float>());
m_tms->slice(std::vector<float>{height_mesh}, MeshSlicingParamsExtended{}, &list_of_expolys);
MeshSlicingParamsEx slicing_params;
slicing_params.trafo.rotate(Eigen::Quaternion<double, Eigen::DontAlign>::FromTwoVectors(up, Vec3d::UnitZ()));
assert(m_mesh->has_shared_vertices());
std::vector<ExPolygons> list_of_expolys = slice_mesh_ex(m_mesh->its, std::vector<float>{height_mesh}, slicing_params);
if (m_negative_mesh && !m_negative_mesh->empty()) {
TriangleMeshSlicer negative_tms{m_negative_mesh};
negative_tms.set_up_direction(up.cast<float>());
std::vector<ExPolygons> neg_polys;
negative_tms.slice(std::vector<float>{height_mesh}, MeshSlicingParamsExtended{}, &neg_polys);
assert(m_negative_mesh->has_shared_vertices());
std::vector<ExPolygons> neg_polys = slice_mesh_ex(m_negative_mesh->its, std::vector<float>{height_mesh}, slicing_params);
list_of_expolys.front() = diff_ex(list_of_expolys.front(), neg_polys.front());
}

View file

@ -3,7 +3,6 @@
#include "libslic3r/Point.hpp"
#include "libslic3r/Geometry.hpp"
#include "libslic3r/TriangleMeshSlicer.hpp"
#include "libslic3r/SLA/IndexedMesh.hpp"
#include "admesh/stl.h"
@ -96,7 +95,6 @@ private:
std::vector<Vec2f> m_triangles2d;
GLIndexedVertexArray m_vertex_array;
bool m_triangles_valid = false;
std::unique_ptr<TriangleMeshSlicer> m_tms;
};

View file

@ -2044,6 +2044,9 @@ void Plater::priv::update(unsigned int flags)
this->restart_background_process(update_status);
else
this->schedule_background_process();
if (get_config("autocenter") == "1" && this->sidebar->obj_manipul()->IsShown())
this->sidebar->obj_manipul()->UpdateAndShow(true);
}
void Plater::priv::select_view(const std::string& direction)