Implemented top_solid_min_thickness / bottom_solid_min_thickness.

The two new config keys define a minimum vertical shell thickness.
The top shell thickness is calculated as a maximum of sum over
top_solid_layers * layer heights and top_solid_min_thickness,
the bottom shell thickness is calculated as a maximum of sum over
bottom_solid_layers * layer heights and bottom_solid_min_thickness.

The results of the formula above are shown at the Print parameter page
below the two new values to hint the user about the interaction
of the old versus new config values.

top_solid_min_thickness has no meaning if top_solid_layers is zero,
bottom_solid_min_thickness has no meaning if bottom_solid_layers is zero.
This commit is contained in:
bubnikv 2020-02-05 16:53:26 +01:00
parent 6f777264a1
commit 495a71ed00
14 changed files with 246 additions and 52 deletions

View file

@ -41,6 +41,23 @@ inline coordf_t max_layer_height_from_nozzle(const PrintConfig &print_config, in
return std::max(min_layer_height, (max_layer_height == 0.) ? (0.75 * nozzle_dmr) : max_layer_height);
}
// Minimum layer height for the variable layer height algorithm.
coordf_t Slicing::min_layer_height_from_nozzle(const DynamicPrintConfig &print_config, int idx_nozzle)
{
coordf_t min_layer_height = print_config.opt_float("min_layer_height", idx_nozzle - 1);
return (min_layer_height == 0.) ? MIN_LAYER_HEIGHT_DEFAULT : std::max(MIN_LAYER_HEIGHT, min_layer_height);
}
// Maximum layer height for the variable layer height algorithm, 3/4 of a nozzle dimaeter by default,
// it should not be smaller than the minimum layer height.
coordf_t Slicing::max_layer_height_from_nozzle(const DynamicPrintConfig &print_config, int idx_nozzle)
{
coordf_t min_layer_height = min_layer_height_from_nozzle(print_config, idx_nozzle);
coordf_t max_layer_height = print_config.opt_float("max_layer_height", idx_nozzle - 1);
coordf_t nozzle_dmr = print_config.opt_float("nozzle_diameter", idx_nozzle - 1);
return std::max(min_layer_height, (max_layer_height == 0.) ? (0.75 * nozzle_dmr) : max_layer_height);
}
SlicingParameters SlicingParameters::create_from_config(
const PrintConfig &print_config,
const PrintObjectConfig &object_config,