Fixed: Correct calculation of the elephant's foot density layers (#13523)

This commit is contained in:
π²
2026-05-08 00:41:56 +03:00
committed by GitHub
parent a1be11126d
commit e131844cf5

View File

@@ -1324,12 +1324,12 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
params.density = f->print_object_config->internal_bridge_density.get_abs_value(1.0); params.density = f->print_object_config->internal_bridge_density.get_abs_value(1.0);
params.dont_adjust = true; params.dont_adjust = true;
} }
// Orca: Elefant foot compensation for solid layers above bottommost by infill density manipulation. // Orca: Elephant foot compensation for solid layers above bottommost by infill density manipulation.
float elefant_density = f->print_object_config->elefant_foot_layers_density.get_abs_value(1.0); float elefant_density = f->print_object_config->elefant_foot_layers_density.get_abs_value(1.0);
if (!is_approx(elefant_density, 1.0f) && surface_fill.surface.is_solid_infill()) { if (!is_approx(elefant_density, 1.0f) && surface_fill.surface.is_solid_infill()) {
size_t elefant_layers = f->print_object_config->elefant_foot_compensation_layers.value; size_t elefant_layers = f->print_object_config->elefant_foot_compensation_layers.value;
if (f->layer_id > 0 && f->layer_id <= elefant_layers) if (f->layer_id > 0 && f->layer_id <= elefant_layers)
params.density = elefant_density * (elefant_layers - (f->layer_id - 1)) / elefant_layers; params.density = 1.0f - (1.0f - elefant_density) * (elefant_layers - (f->layer_id - 1)) / elefant_layers; // Reverse calculation - The higher layer number means the higher density. Counting starts from the second layer.
} }
// make fill // make fill
f->fill_surface_extrusion(&surface_fill.surface, f->fill_surface_extrusion(&surface_fill.surface,