mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-10 03:21:47 +08:00
Fix crash with cut gizmo
This commit is contained in:
parent
b403ba10c1
commit
ee15fe6238
@ -259,9 +259,11 @@ void Raycaster::on_update()
|
|||||||
bool force_raycaster_regeneration = false;
|
bool force_raycaster_regeneration = false;
|
||||||
if (wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA) {
|
if (wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA) {
|
||||||
// For sla printers we use the mesh generated by the backend
|
// 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();
|
const SLAPrintObject* po = get_pool()->selection_info()->print_object();
|
||||||
assert(po != nullptr);
|
if (po)
|
||||||
std::shared_ptr<const indexed_triangle_set> preview_mesh_ptr = po->get_mesh_to_print();
|
preview_mesh_ptr = po->get_mesh_to_print();
|
||||||
|
|
||||||
if (preview_mesh_ptr)
|
if (preview_mesh_ptr)
|
||||||
m_sla_mesh_cache = TriangleMesh{*preview_mesh_ptr};
|
m_sla_mesh_cache = TriangleMesh{*preview_mesh_ptr};
|
||||||
|
|
||||||
@ -323,7 +325,7 @@ void ObjectClipper::on_update()
|
|||||||
if (wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA) {
|
if (wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA) {
|
||||||
// For sla printers we use the mesh generated by the backend
|
// For sla printers we use the mesh generated by the backend
|
||||||
const SLAPrintObject* po = get_pool()->selection_info()->print_object();
|
const SLAPrintObject* po = get_pool()->selection_info()->print_object();
|
||||||
assert(po != nullptr);
|
if (po) {
|
||||||
auto partstoslice = po->get_parts_to_slice();
|
auto partstoslice = po->get_parts_to_slice();
|
||||||
if (! partstoslice.empty()) {
|
if (! partstoslice.empty()) {
|
||||||
mc = std::make_unique<MeshClipper>();
|
mc = std::make_unique<MeshClipper>();
|
||||||
@ -331,6 +333,7 @@ void ObjectClipper::on_update()
|
|||||||
mc_tr = Geometry::Transformation{po->trafo().inverse().cast<double>()};
|
mc_tr = Geometry::Transformation{po->trafo().inverse().cast<double>()};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!mc && meshes.empty()) {
|
if (!mc && meshes.empty()) {
|
||||||
for (const ModelVolume* mv : mo->volumes) {
|
for (const ModelVolume* mv : mo->volumes) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user