From b9ada2542a7d1b26b7b36323dc38b747dd18c3d4 Mon Sep 17 00:00:00 2001 From: mrmees <38006194+mrmees@users.noreply.github.com> Date: Mon, 26 Jan 2026 17:04:21 -0600 Subject: [PATCH] fix: adaptive layer height profile uses uncompensated Z height (#12080) layer_height_profile_adaptive() was using object_print_z_height() (shrinkage-compensated) to bound the profile, but update_layer_height_profile() validates against object_print_z_uncompensated_max. When shrinkage compensation is active, the mismatch causes the adaptive profile to be silently cleared every frame and replaced with flat layers. Use object_print_z_uncompensated_height() instead, matching both the validator and the existing layer_height_profile_from_ranges() implementation which already uses the uncompensated value. Co-authored-by: Claude Opus 4.5 --- src/libslic3r/Slicing.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Slicing.cpp b/src/libslic3r/Slicing.cpp index f3499b7d36..aa24b1074d 100644 --- a/src/libslic3r/Slicing.cpp +++ b/src/libslic3r/Slicing.cpp @@ -260,7 +260,7 @@ std::vector layer_height_profile_adaptive(const SlicingParameters& slici // last facet visited by the as.next_layer_height() function, where the facets are sorted by their increasing Z span. size_t current_facet = 0; // loop until we have at least one layer and the max slice_z reaches the object height - while (print_z + EPSILON < slicing_params.object_print_z_height()) { + while (print_z + EPSILON < slicing_params.object_print_z_uncompensated_height()) { float height = slicing_params.max_layer_height; // Slic3r::debugf "\n Slice layer: %d\n", $id; // determine next layer height @@ -331,10 +331,10 @@ std::vector layer_height_profile_adaptive(const SlicingParameters& slici print_z += height; } - double z_gap = slicing_params.object_print_z_height() - *(layer_height_profile.end() - 2); + double z_gap = slicing_params.object_print_z_uncompensated_height() - *(layer_height_profile.end() - 2); if (z_gap > 0.0) { - layer_height_profile.push_back(slicing_params.object_print_z_height()); + layer_height_profile.push_back(slicing_params.object_print_z_uncompensated_height()); layer_height_profile.push_back(std::clamp(z_gap, slicing_params.min_layer_height, slicing_params.max_layer_height)); }