Add elephant foot compensation over multiple layers (#2254)

#https://github.com/prusa3d/PrusaSlicer/pull/10976

Co-authored-by: Roberto Mozzicato <bitblasters@gmail.com>
This commit is contained in:
bitingsock 2023-09-30 03:12:12 -07:00 committed by GitHub
parent 3b5f42cf49
commit bda8249e06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 2 deletions

View file

@ -1085,7 +1085,9 @@ void PrintObject::slice_volumes()
m_print->throw_if_canceled();
Layer *layer = m_layers[layer_id];
// Apply size compensation and perform clipping of multi-part objects.
float elfoot = (layer_id == 0) ? elephant_foot_compensation_scaled : 0.f;
float elfoot = elephant_foot_compensation_scaled > 0 && layer_id < m_config.elefant_foot_compensation_layers.value ?
elephant_foot_compensation_scaled - (elephant_foot_compensation_scaled / m_config.elefant_foot_compensation_layers.value) * layer_id :
0.f;
if (layer->m_regions.size() == 1) {
// Optimized version for a single region layer.
// Single region, growing or shrinking.