Fix of cut gizmo: contour placed incorrectly with elevated objects

This commit is contained in:
Lukas Matena 2022-02-23 11:01:02 +01:00
parent dbc3cfc004
commit d3e7a9613e

View File

@ -299,6 +299,8 @@ void GLGizmoCut::update_contours()
MeshSlicingParams slicing_params; MeshSlicingParams slicing_params;
slicing_params.trafo = first_glvolume->get_instance_transformation().get_matrix(); slicing_params.trafo = first_glvolume->get_instance_transformation().get_matrix();
slicing_params.trafo.pretranslate(Vec3d(0., 0., first_glvolume->get_sla_shift_z()));
const Polygons polys = slice_mesh(m_cut_contours.mesh.its, m_cut_z, slicing_params); const Polygons polys = slice_mesh(m_cut_contours.mesh.its, m_cut_z, slicing_params);
if (!polys.empty()) { if (!polys.empty()) {
m_cut_contours.contours.init_from(polys, static_cast<float>(m_cut_z)); m_cut_contours.contours.init_from(polys, static_cast<float>(m_cut_z));