mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-11 05:29:10 +08:00
Fixes of two crashes in paint-on supports
This commit is contained in:
parent
12f43736bd
commit
fd93d9768d
@ -2823,8 +2823,9 @@ void PrintObject::project_and_append_custom_supports(
|
|||||||
// Now append the collected polygons to respective layers.
|
// Now append the collected polygons to respective layers.
|
||||||
for (auto& trg : projections_of_triangles) {
|
for (auto& trg : projections_of_triangles) {
|
||||||
int layer_id = trg.first_layer_id;
|
int layer_id = trg.first_layer_id;
|
||||||
|
|
||||||
for (const LightPolygon& poly : trg.polygons) {
|
for (const LightPolygon& poly : trg.polygons) {
|
||||||
|
if (layer_id >= int(expolys.size()))
|
||||||
|
break; // part of triangle could be projected above top layer
|
||||||
expolys[layer_id].emplace_back(std::move(poly.pts));
|
expolys[layer_id].emplace_back(std::move(poly.pts));
|
||||||
++layer_id;
|
++layer_id;
|
||||||
}
|
}
|
||||||
|
@ -60,8 +60,9 @@ void TriangleSelector::select_patch(const Vec3f& hit, int facet_start,
|
|||||||
if (select_triangle(facet, new_state)) {
|
if (select_triangle(facet, new_state)) {
|
||||||
// add neighboring facets to list to be proccessed later
|
// add neighboring facets to list to be proccessed later
|
||||||
for (int n=0; n<3; ++n) {
|
for (int n=0; n<3; ++n) {
|
||||||
if (faces_camera(m_mesh->stl.neighbors_start[facet].neighbor[n]))
|
int neighbor_idx = m_mesh->stl.neighbors_start[facet].neighbor[n];
|
||||||
facets_to_check.push_back(m_mesh->stl.neighbors_start[facet].neighbor[n]);
|
if (neighbor_idx >=0 && faces_camera(neighbor_idx))
|
||||||
|
facets_to_check.push_back(neighbor_idx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user