Porting curling calculations from Prusa Slier 2.6.1

This commit is contained in:
igiannakas 2023-09-10 18:44:46 +01:00
parent f30a18d658
commit 19ca3ee715
6 changed files with 152 additions and 108 deletions

View file

@ -8,6 +8,7 @@
#include "Layer.hpp"
#include "MutablePolygon.hpp"
#include "SupportMaterial.hpp"
#include "SupportSpotsGenerator.hpp"
#include "Support/TreeSupport.hpp"
#include "Surface.hpp"
#include "Slicing.hpp"
@ -498,6 +499,25 @@ void PrintObject::generate_support_material()
}
}
void PrintObject::estimate_curled_extrusions()
{
if (this->set_started(posEstimateCurledExtrusions)) {
if ( std::any_of(this->print()->m_print_regions.begin(), this->print()->m_print_regions.end(),
[](const PrintRegion *region) { return region->config().enable_overhang_speed.getBool(); })) {
// Estimate curling of support material and add it to the malformaition lines of each layer
float support_flow_width = support_material_flow(this, this->config().layer_height).width();
SupportSpotsGenerator::Params params{this->print()->m_config.filament_type.values,
float(this->print()->m_config.inner_wall_acceleration.getFloat()),
this->config().raft_layers.getInt(), this->config().brim_type.value,
float(this->config().brim_width.getFloat())};
SupportSpotsGenerator::estimate_malformations(this->layers(), params);
m_print->throw_if_canceled();
}
this->set_done(posEstimateCurledExtrusions);
}
}
void PrintObject::simplify_extrusion_path()
{
if (this->set_started(posSimplifyPath)) {