Skip to content

Commit

Permalink
SLA: Fix for crash with only 1 layer
Browse files Browse the repository at this point in the history
fixes #4836
  • Loading branch information
tamasmeszaros committed Oct 8, 2020
1 parent bcc2342 commit 267907e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libslic3r/SLAPrintSteps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ void SLAPrint::Steps::apply_printer_corrections(SLAPrintObject &po, SliceOrigin
coord_t clpr_offs = scaled(doffs);

faded_lyrs = std::min(po.m_slice_index.size(), faded_lyrs);
size_t faded_lyrs_efc = std::max(size_t(1), faded_lyrs - 1);

auto efc = [start_efc, faded_lyrs](size_t pos) {
return (faded_lyrs - 1 - pos) * start_efc / (faded_lyrs - 1);
auto efc = [start_efc, faded_lyrs_efc](size_t pos) {
return (faded_lyrs_efc - pos) * start_efc / faded_lyrs_efc;
};

std::vector<ExPolygons> &slices = o == soModel ?
Expand Down

0 comments on commit 267907e

Please sign in to comment.