mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 13:47:59 -06:00
Auto color change: Fixed some cases:
* first layer is a little bit less than all another (like for elephant foot compensation) * ignore small changes of the layer area
This commit is contained in:
parent
5aff44debe
commit
0bb5c2ef88
2 changed files with 12 additions and 1 deletions
|
@ -713,8 +713,15 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
|
|||
int i;
|
||||
for (i = 1; i < int(0.3 * num_layers); ++ i) {
|
||||
double cur_area = area(object->get_layer(i)->lslices);
|
||||
if (cur_area != bottom_area && fabs(cur_area - bottom_area) > scale_(scale_(1)))
|
||||
if (cur_area != bottom_area && fabs(cur_area - bottom_area) > scale_(scale_(1))) {
|
||||
// but due to the elephant foot compensation, the first layer may be slightly smaller than the others
|
||||
if (i == 1 && fabs(cur_area - bottom_area) / bottom_area < 0.1) {
|
||||
// So, let process this case and use second layer as a bottom
|
||||
bottom_area = cur_area;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i < int(0.3 * num_layers))
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue