fix: slicing crash on an object too thin for any layer with a raft (#17013)

With a raft, an object too thin for any layer gets an empty layer
list. Two functions read it as if it had an entry.

- groupingVolumesForBrim() reads the first layer, and slice() calls it
  before its own check for an empty list.
- With Precise Z height on, adjust_layer_series_to_align_object_height()
  read the last entry. This also runs in Print::validate(), so it
  crashed before slicing started.

Both functions now return early on an empty list, so slicing reaches
the existing "No layers were detected" error.

Fixes #17009

(cherry picked from commit 59f0cc3806)
This commit is contained in:
Kris Austin authored and SoftFever committed 2026-11-01 09:53:53 +08:00
1 parent 61eb4622ea
commit a45cd836d9
3 files changed
+25

No files matched your search

+3
View File
@@ -864,6 +864,9 @@ std::string fix_slicing_errors(PrintObject* object, LayerPtrs &layers, const std
void groupingVolumesForBrim(PrintObject* object, LayerPtrs& layers, int firstLayerReplacedBy)
{
if (layers.empty())
return;
const auto scaled_resolution = scaled<double>(object->print()->config().resolution.value);
auto partsObjSliceByVolume = findPartVolumes(object->firstLayerObjSliceMod(), object->model_object()->volumes);
groupingVolumes(partsObjSliceByVolume, object->firstLayerObjGroupsMod(), scaled_resolution, firstLayerReplacedBy);