Fixed a false positive empty layer report
Reported in https://github.com/prusa3d/PrusaSlicer/issues/2752 and was a result of setting support contact z distance to negative value. This lowered the maximum allowed print_z of the next layer, even though previous layer had object layers too, so the penalty from the contact z should not have been applied. Fixed simply by rejecting the negative contact_z.
This commit is contained in:
parent
ba15c99c2f
commit
c189140221
1 changed files with 4 additions and 1 deletions
|
@ -467,7 +467,10 @@ std::vector<GCode::LayerToPrint> GCode::collect_layers_to_print(const PrintObjec
|
||||||
: 0.;
|
: 0.;
|
||||||
double maximal_print_z = (last_extrusion_layer ? last_extrusion_layer->print_z() : 0.)
|
double maximal_print_z = (last_extrusion_layer ? last_extrusion_layer->print_z() : 0.)
|
||||||
+ layer_to_print.layer()->height
|
+ layer_to_print.layer()->height
|
||||||
+ support_contact_z;
|
+ std::max(0., support_contact_z);
|
||||||
|
// Negative support_contact_z is not taken into account, it can result in false positives in cases
|
||||||
|
// where previous layer has object extrusions too (https://github.com/prusa3d/PrusaSlicer/issues/2752)
|
||||||
|
|
||||||
|
|
||||||
if (layer_to_print.print_z() > maximal_print_z + EPSILON)
|
if (layer_to_print.print_z() > maximal_print_z + EPSILON)
|
||||||
throw std::runtime_error(_(L("Empty layers detected, the output would not be printable.")) + "\n\n" +
|
throw std::runtime_error(_(L("Empty layers detected, the output would not be printable.")) + "\n\n" +
|
||||||
|
|
Loading…
Reference in a new issue