mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-06-04 11:14:17 +08:00
Fix trianglemesh slicer error with empty meshes
This commit is contained in:
parent
a6e737f05a
commit
3b0241c98b
@ -131,7 +131,7 @@ void GLGizmoHollow::on_render() const
|
|||||||
|
|
||||||
void GLGizmoHollow::render_clipping_plane(const Selection& selection) const
|
void GLGizmoHollow::render_clipping_plane(const Selection& selection) const
|
||||||
{
|
{
|
||||||
if (m_clipping_plane_distance == 0.f)
|
if (m_clipping_plane_distance == 0.f || mesh()->empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Get transformation of the instance
|
// Get transformation of the instance
|
||||||
@ -172,7 +172,7 @@ void GLGizmoHollow::render_clipping_plane(const Selection& selection) const
|
|||||||
if (m_print_object_idx >= 0) {
|
if (m_print_object_idx >= 0) {
|
||||||
const SLAPrintObject* print_object = m_parent.sla_print()->objects()[m_print_object_idx];
|
const SLAPrintObject* print_object = m_parent.sla_print()->objects()[m_print_object_idx];
|
||||||
|
|
||||||
if (print_object->is_step_done(slaposSupportTree)) {
|
if (print_object->is_step_done(slaposSupportTree) && !print_object->get_mesh(slaposSupportTree).empty()) {
|
||||||
// If the supports are already calculated, save the timestamp of the respective step
|
// If the supports are already calculated, save the timestamp of the respective step
|
||||||
// so we can later tell they were recalculated.
|
// so we can later tell they were recalculated.
|
||||||
size_t timestamp = print_object->step_state_with_timestamp(slaposSupportTree).timestamp;
|
size_t timestamp = print_object->step_state_with_timestamp(slaposSupportTree).timestamp;
|
||||||
|
@ -136,7 +136,7 @@ void GLGizmoSlaSupports::on_render() const
|
|||||||
|
|
||||||
void GLGizmoSlaSupports::render_clipping_plane(const Selection& selection) const
|
void GLGizmoSlaSupports::render_clipping_plane(const Selection& selection) const
|
||||||
{
|
{
|
||||||
if (m_clipping_plane_distance == 0.f)
|
if (m_clipping_plane_distance == 0.f || m_mesh->empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Get transformation of the instance
|
// Get transformation of the instance
|
||||||
@ -177,7 +177,7 @@ void GLGizmoSlaSupports::render_clipping_plane(const Selection& selection) const
|
|||||||
if (m_print_object_idx >= 0) {
|
if (m_print_object_idx >= 0) {
|
||||||
const SLAPrintObject* print_object = m_parent.sla_print()->objects()[m_print_object_idx];
|
const SLAPrintObject* print_object = m_parent.sla_print()->objects()[m_print_object_idx];
|
||||||
|
|
||||||
if (print_object->is_step_done(slaposSupportTree)) {
|
if (print_object->is_step_done(slaposSupportTree) && !print_object->get_mesh(slaposSupportTree).empty()) {
|
||||||
// If the supports are already calculated, save the timestamp of the respective step
|
// If the supports are already calculated, save the timestamp of the respective step
|
||||||
// so we can later tell they were recalculated.
|
// so we can later tell they were recalculated.
|
||||||
size_t timestamp = print_object->step_state_with_timestamp(slaposSupportTree).timestamp;
|
size_t timestamp = print_object->step_state_with_timestamp(slaposSupportTree).timestamp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user