mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 10:25:56 +08:00
CutGizmo: Put the check of groove flaps validity to the has_valid_groove() function to avoid perform a cut with non valid groove
This commit is contained in:
parent
0c2913f20c
commit
89d66737b5
@ -3427,10 +3427,8 @@ bool GLGizmoCut3D::can_perform_cut() const
|
|||||||
if (! m_invalid_connectors_idxs.empty() || (!m_keep_upper && !m_keep_lower) || m_connectors_editing)
|
if (! m_invalid_connectors_idxs.empty() || (!m_keep_upper && !m_keep_lower) || m_connectors_editing)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (CutMode(m_mode) == CutMode::cutTongueAndGroove) {
|
if (CutMode(m_mode) == CutMode::cutTongueAndGroove)
|
||||||
const float flaps_width = -2.f * m_groove_depth / tan(m_groove_flaps_angle);
|
return has_valid_groove();
|
||||||
return flaps_width < m_groove_width && has_valid_groove();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_part_selection.valid())
|
if (m_part_selection.valid())
|
||||||
return ! m_part_selection.is_one_object();
|
return ! m_part_selection.is_one_object();
|
||||||
@ -3443,6 +3441,10 @@ bool GLGizmoCut3D::has_valid_groove() const
|
|||||||
if (CutMode(m_mode) != CutMode::cutTongueAndGroove)
|
if (CutMode(m_mode) != CutMode::cutTongueAndGroove)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
const float flaps_width = -2.f * m_groove_depth / tan(m_groove_flaps_angle);
|
||||||
|
if (flaps_width > m_groove_width)
|
||||||
|
return false;
|
||||||
|
|
||||||
const Selection& selection = m_parent.get_selection();
|
const Selection& selection = m_parent.get_selection();
|
||||||
const auto&list = selection.get_volume_idxs();
|
const auto&list = selection.get_volume_idxs();
|
||||||
// is more volumes selected?
|
// is more volumes selected?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user