mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 22:35:51 +08:00
Follow-up to 79eb59b9f23c281125dbd0dd989b979fe171a401
Fix of #7168: Crash when layer count exceeds 4095 This time the crash was fixed for top / bottom propagation of multi-material segmentation.
This commit is contained in:
parent
ef0dae8c97
commit
cd13af59f4
@ -332,7 +332,7 @@ void slice_facet_at_zs(
|
|||||||
if (min_z != max_z && slice_facet(*it, vertices, indices, edge_ids, idx_vertex_lowest, false, il) == FacetSliceType::Slicing) {
|
if (min_z != max_z && slice_facet(*it, vertices, indices, edge_ids, idx_vertex_lowest, false, il) == FacetSliceType::Slicing) {
|
||||||
assert(il.edge_type != IntersectionLine::FacetEdgeType::Horizontal);
|
assert(il.edge_type != IntersectionLine::FacetEdgeType::Horizontal);
|
||||||
size_t slice_id = it - zs.begin();
|
size_t slice_id = it - zs.begin();
|
||||||
boost::lock_guard<std::mutex> l(lines_mutex[slice_id % 64]);
|
boost::lock_guard<std::mutex> l(lines_mutex[slice_id % lines_mutex.size()]);
|
||||||
lines[slice_id].emplace_back(il);
|
lines[slice_id].emplace_back(il);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -446,7 +446,7 @@ void slice_facet_with_slabs(
|
|||||||
auto emit_slab_edge = [&lines, &lines_mutex](IntersectionLine il, size_t slab_id, bool reverse) {
|
auto emit_slab_edge = [&lines, &lines_mutex](IntersectionLine il, size_t slab_id, bool reverse) {
|
||||||
if (reverse)
|
if (reverse)
|
||||||
il.reverse();
|
il.reverse();
|
||||||
boost::lock_guard<std::mutex> l(lines_mutex[(slab_id + 32) >> 6]);
|
boost::lock_guard<std::mutex> l(lines_mutex[(slab_id + lines_mutex.size() / 2) % lines_mutex.size()]);
|
||||||
lines.between_slices[slab_id].emplace_back(il);
|
lines.between_slices[slab_id].emplace_back(il);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -472,7 +472,7 @@ void slice_facet_with_slabs(
|
|||||||
};
|
};
|
||||||
// Don't flip the FacetEdgeType::Top edge, it will be flipped when chaining.
|
// Don't flip the FacetEdgeType::Top edge, it will be flipped when chaining.
|
||||||
// if (! ProjectionFromTop) il.reverse();
|
// if (! ProjectionFromTop) il.reverse();
|
||||||
boost::lock_guard<std::mutex> l(lines_mutex[line_id >> 6]);
|
boost::lock_guard<std::mutex> l(lines_mutex[line_id % lines_mutex.size()]);
|
||||||
lines.at_slice[line_id].emplace_back(il);
|
lines.at_slice[line_id].emplace_back(il);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -582,7 +582,7 @@ void slice_facet_with_slabs(
|
|||||||
if (! ProjectionFromTop)
|
if (! ProjectionFromTop)
|
||||||
il.reverse();
|
il.reverse();
|
||||||
size_t line_id = it - zs.begin();
|
size_t line_id = it - zs.begin();
|
||||||
boost::lock_guard<std::mutex> l(lines_mutex[line_id >> 6]);
|
boost::lock_guard<std::mutex> l(lines_mutex[line_id % lines_mutex.size()]);
|
||||||
lines.at_slice[line_id].emplace_back(il);
|
lines.at_slice[line_id].emplace_back(il);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user