Fix of "Variable layer height feature breaks after rotating part #2073"

There was an approximate bounding box used at the GUI, while a snug
bounding box was used at the back end, causing invalidation
of the variable layer height editing profile on rotated objects.

A snug bounding box around the first instance is now cached.
This commit is contained in:
bubnikv 2019-04-13 14:15:54 +02:00
parent b0c33a1fe9
commit 1e455bc065
5 changed files with 54 additions and 38 deletions

View file

@ -1370,7 +1370,7 @@ void PrintObject::update_slicing_parameters()
this->print()->config(), m_config, unscale<double>(this->size(2)), this->object_extruders());
}
SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full_config, const ModelObject &model_object)
SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full_config, const ModelObject &model_object, float object_max_z)
{
PrintConfig print_config;
PrintObjectConfig object_config;
@ -1390,7 +1390,9 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full
object_extruders);
sort_remove_duplicates(object_extruders);
return SlicingParameters::create_from_config(print_config, object_config, model_object.bounding_box().max.z(), object_extruders);
if (object_max_z <= 0.f)
object_max_z = model_object.raw_bounding_box().size().z();
return SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders);
}
// returns 0-based indices of extruders used to print the object (without brim, support and other helper extrusions)