Fixed duplication of auxiliary volumes when GLCanvas3D::reload_scene() is called for SLA printers

This commit is contained in:
enricoturri1966 2023-03-23 10:16:13 +01:00
parent 760f74ce6a
commit e585fd2221
2 changed files with 19 additions and 15 deletions

View File

@ -603,6 +603,7 @@ void GLVolumeCollection::load_object_auxiliary(
}; };
// Get the support mesh. // Get the support mesh.
if (milestone == SLAPrintObjectStep::slaposSupportTree) {
TriangleMesh supports_mesh = print_object->support_mesh(); TriangleMesh supports_mesh = print_object->support_mesh();
if (!supports_mesh.empty()) { if (!supports_mesh.empty()) {
supports_mesh.transform(mesh_trafo_inv); supports_mesh.transform(mesh_trafo_inv);
@ -612,8 +613,10 @@ void GLVolumeCollection::load_object_auxiliary(
add_volume(obj_idx, (int)instance_idx.first, model_instance, slaposSupportTree, supports_mesh, GLVolume::SLA_SUPPORT_COLOR, convex_hull); add_volume(obj_idx, (int)instance_idx.first, model_instance, slaposSupportTree, supports_mesh, GLVolume::SLA_SUPPORT_COLOR, convex_hull);
} }
} }
}
// Get the pad mesh. // Get the pad mesh.
if (milestone == SLAPrintObjectStep::slaposPad) {
TriangleMesh pad_mesh = print_object->pad_mesh(); TriangleMesh pad_mesh = print_object->pad_mesh();
if (!pad_mesh.empty()) { if (!pad_mesh.empty()) {
pad_mesh.transform(mesh_trafo_inv); pad_mesh.transform(mesh_trafo_inv);
@ -623,6 +626,7 @@ void GLVolumeCollection::load_object_auxiliary(
add_volume(obj_idx, (int)instance_idx.first, model_instance, slaposPad, pad_mesh, GLVolume::SLA_PAD_COLOR, convex_hull); add_volume(obj_idx, (int)instance_idx.first, model_instance, slaposPad, pad_mesh, GLVolume::SLA_PAD_COLOR, convex_hull);
} }
} }
}
} }
GLVolume* GLVolumeCollection::new_toolpath_volume(const ColorRGBA& rgba) GLVolume* GLVolumeCollection::new_toolpath_volume(const ColorRGBA& rgba)