Skip to content

Commit eaedfe7

Browse files
Jony01lukasmatena
authored andcommitted
SPE-2714: Hot fix of a crash in SLA support points generator
1 parent 216dfa9 commit eaedfe7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libslic3r/SLA/SupportIslands/UniformSupportIsland.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <libslic3r/SLA/SupportPointGenerator.hpp>
2020
#include <libslic3r/ExPolygonsIndex.hpp>
2121
#include <libslic3r/IntersectionPoints.hpp>
22+
#include <libslic3r/Exception.hpp>
2223

2324
#include "VoronoiGraph.hpp"
2425
#include "Parabola.hpp"
@@ -2121,6 +2122,12 @@ coord_t get_longest_distance(const IslandPartChanges& changes, Position* center
21212122

21222123
// case with center on change neighbor should be already handled
21232124
assert(node_distance != nullptr);
2125+
if (node_distance == nullptr)
2126+
// weird situation - hack to not crash on SPE-2714
2127+
throw Slic3r::RuntimeError("Can't sample island.");
2128+
2129+
//if (node_distance == nullptr)
2130+
// return farest_from_change;
21242131
assert(node_distance->shortest_distances[change_index].distance >= half_distance);
21252132
assert(prev_node_distance->shortest_distances[change_index].distance <= half_distance);
21262133
coord_t to_half_distance = half_distance - node_distance->shortest_distances[change_index].distance;

0 commit comments

Comments
 (0)