Fix crash with cut gizmo

This commit is contained in:
tamasmeszaros 2023-01-18 15:15:01 +01:00
parent b403ba10c1
commit ee15fe6238

View file

@ -259,9 +259,11 @@ void Raycaster::on_update()
bool force_raycaster_regeneration = false;
if (wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA) {
// For sla printers we use the mesh generated by the backend
std::shared_ptr<const indexed_triangle_set> preview_mesh_ptr;
const SLAPrintObject* po = get_pool()->selection_info()->print_object();
assert(po != nullptr);
std::shared_ptr<const indexed_triangle_set> preview_mesh_ptr = po->get_mesh_to_print();
if (po)
preview_mesh_ptr = po->get_mesh_to_print();
if (preview_mesh_ptr)
m_sla_mesh_cache = TriangleMesh{*preview_mesh_ptr};
@ -323,12 +325,13 @@ void ObjectClipper::on_update()
if (wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA) {
// For sla printers we use the mesh generated by the backend
const SLAPrintObject* po = get_pool()->selection_info()->print_object();
assert(po != nullptr);
auto partstoslice = po->get_parts_to_slice();
if (! partstoslice.empty()) {
mc = std::make_unique<MeshClipper>();
mc->set_mesh(range(partstoslice));
mc_tr = Geometry::Transformation{po->trafo().inverse().cast<double>()};
if (po) {
auto partstoslice = po->get_parts_to_slice();
if (! partstoslice.empty()) {
mc = std::make_unique<MeshClipper>();
mc->set_mesh(range(partstoslice));
mc_tr = Geometry::Transformation{po->trafo().inverse().cast<double>()};
}
}
}