mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 21:41:59 +08:00
SPE-2409: Fix adaptive layer height when Z shrinkage compensation is used.
This commit is contained in:
parent
d9ef0f1781
commit
42630f59f7
@ -261,7 +261,7 @@ std::vector<double> 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.
|
// 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;
|
size_t current_facet = 0;
|
||||||
// loop until we have at least one layer and the max slice_z reaches the object height
|
// 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;
|
float height = slicing_params.max_layer_height;
|
||||||
// Slic3r::debugf "\n Slice layer: %d\n", $id;
|
// Slic3r::debugf "\n Slice layer: %d\n", $id;
|
||||||
// determine next layer height
|
// determine next layer height
|
||||||
@ -320,10 +320,10 @@ std::vector<double> layer_height_profile_adaptive(const SlicingParameters& slici
|
|||||||
print_z += height;
|
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)
|
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));
|
layer_height_profile.push_back(std::clamp(z_gap, slicing_params.min_layer_height, slicing_params.max_layer_height));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user