mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 06:04:01 -06:00
Make sure the m_extrusion_quality_estimator.set_current_object()
is called after regional config has been applied (SoftFever/OrcaSlicer#7946)
This commit is contained in:
parent
e315586125
commit
d13d4a47b7
2 changed files with 16 additions and 14 deletions
|
@ -4190,9 +4190,6 @@ LayerResult GCode::process_layer(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_config.enable_overhang_speed && !m_config.overhang_speed_classic)
|
|
||||||
m_extrusion_quality_estimator.set_current_object(&instance_to_print.print_object);
|
|
||||||
|
|
||||||
// When starting a new object, use the external motion planner for the first travel move.
|
// When starting a new object, use the external motion planner for the first travel move.
|
||||||
const Point &offset = instance_to_print.print_object.instances()[instance_to_print.instance_id].shift;
|
const Point &offset = instance_to_print.print_object.instances()[instance_to_print.instance_id].shift;
|
||||||
std::pair<const PrintObject*, Point> this_object_copy(&instance_to_print.print_object, offset);
|
std::pair<const PrintObject*, Point> this_object_copy(&instance_to_print.print_object, offset);
|
||||||
|
@ -4293,10 +4290,10 @@ LayerResult GCode::process_layer(
|
||||||
|
|
||||||
has_insert_timelapse_gcode = true;
|
has_insert_timelapse_gcode = true;
|
||||||
}
|
}
|
||||||
gcode += this->extrude_infill(print, by_region_specific, false);
|
gcode += this->extrude_infill(instance_to_print.print_object, by_region_specific, false);
|
||||||
gcode += this->extrude_perimeters(print, by_region_specific);
|
gcode += this->extrude_perimeters(instance_to_print.print_object, by_region_specific);
|
||||||
} else {
|
} else {
|
||||||
gcode += this->extrude_perimeters(print, by_region_specific);
|
gcode += this->extrude_perimeters(instance_to_print.print_object, by_region_specific);
|
||||||
if (!has_wipe_tower && need_insert_timelapse_gcode_for_traditional && !has_insert_timelapse_gcode && has_infill(by_region_specific)) {
|
if (!has_wipe_tower && need_insert_timelapse_gcode_for_traditional && !has_insert_timelapse_gcode && has_infill(by_region_specific)) {
|
||||||
gcode += this->retract(false, false, LiftType::NormalLift);
|
gcode += this->retract(false, false, LiftType::NormalLift);
|
||||||
|
|
||||||
|
@ -4313,10 +4310,10 @@ LayerResult GCode::process_layer(
|
||||||
|
|
||||||
has_insert_timelapse_gcode = true;
|
has_insert_timelapse_gcode = true;
|
||||||
}
|
}
|
||||||
gcode += this->extrude_infill(print,by_region_specific, false);
|
gcode += this->extrude_infill(instance_to_print.print_object, by_region_specific, false);
|
||||||
}
|
}
|
||||||
// ironing
|
// ironing
|
||||||
gcode += this->extrude_infill(print,by_region_specific, true);
|
gcode += this->extrude_infill(instance_to_print.print_object, by_region_specific, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->config().gcode_label_objects) {
|
if (this->config().gcode_label_objects) {
|
||||||
|
@ -4911,12 +4908,14 @@ std::string GCode::extrude_path(ExtrusionPath path, std::string description, dou
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extrude perimeters: Decide where to put seams (hide or align seams).
|
// Extrude perimeters: Decide where to put seams (hide or align seams).
|
||||||
std::string GCode::extrude_perimeters(const Print &print, const std::vector<ObjectByExtruder::Island::Region> &by_region)
|
std::string GCode::extrude_perimeters(const PrintObject& print_object, const std::vector<ObjectByExtruder::Island::Region>& by_region)
|
||||||
{
|
{
|
||||||
std::string gcode;
|
std::string gcode;
|
||||||
for (const ObjectByExtruder::Island::Region ®ion : by_region)
|
for (const ObjectByExtruder::Island::Region ®ion : by_region)
|
||||||
if (! region.perimeters.empty()) {
|
if (! region.perimeters.empty()) {
|
||||||
m_config.apply(print.get_print_region(®ion - &by_region.front()).config());
|
m_config.apply(print_object.print()->get_print_region(®ion - &by_region.front()).config());
|
||||||
|
if (m_config.enable_overhang_speed && !m_config.overhang_speed_classic)
|
||||||
|
m_extrusion_quality_estimator.set_current_object(&print_object);
|
||||||
|
|
||||||
for (const ExtrusionEntity* ee : region.perimeters)
|
for (const ExtrusionEntity* ee : region.perimeters)
|
||||||
gcode += this->extrude_entity(*ee, "perimeter", -1., region.perimeters);
|
gcode += this->extrude_entity(*ee, "perimeter", -1., region.perimeters);
|
||||||
|
@ -4925,7 +4924,7 @@ std::string GCode::extrude_perimeters(const Print &print, const std::vector<Obje
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chain the paths hierarchically by a greedy algorithm to minimize a travel distance.
|
// Chain the paths hierarchically by a greedy algorithm to minimize a travel distance.
|
||||||
std::string GCode::extrude_infill(const Print &print, const std::vector<ObjectByExtruder::Island::Region> &by_region, bool ironing)
|
std::string GCode::extrude_infill(const PrintObject &print_object, const std::vector<ObjectByExtruder::Island::Region> &by_region, bool ironing)
|
||||||
{
|
{
|
||||||
std::string gcode;
|
std::string gcode;
|
||||||
ExtrusionEntitiesPtr extrusions;
|
ExtrusionEntitiesPtr extrusions;
|
||||||
|
@ -4938,7 +4937,10 @@ std::string GCode::extrude_infill(const Print &print, const std::vector<ObjectBy
|
||||||
if ((ee->role() == erIroning) == ironing)
|
if ((ee->role() == erIroning) == ironing)
|
||||||
extrusions.emplace_back(ee);
|
extrusions.emplace_back(ee);
|
||||||
if (! extrusions.empty()) {
|
if (! extrusions.empty()) {
|
||||||
m_config.apply(print.get_print_region(®ion - &by_region.front()).config());
|
m_config.apply(print_object.print()->get_print_region(®ion - &by_region.front()).config());
|
||||||
|
if (m_config.enable_overhang_speed && !m_config.overhang_speed_classic)
|
||||||
|
m_extrusion_quality_estimator.set_current_object(&print_object);
|
||||||
|
|
||||||
chain_and_reorder_extrusion_entities(extrusions, &m_last_pos);
|
chain_and_reorder_extrusion_entities(extrusions, &m_last_pos);
|
||||||
for (const ExtrusionEntity *fill : extrusions) {
|
for (const ExtrusionEntity *fill : extrusions) {
|
||||||
auto *eec = dynamic_cast<const ExtrusionEntityCollection*>(fill);
|
auto *eec = dynamic_cast<const ExtrusionEntityCollection*>(fill);
|
||||||
|
|
|
@ -445,8 +445,8 @@ private:
|
||||||
// For sequential print, the instance of the object to be printing has to be defined.
|
// For sequential print, the instance of the object to be printing has to be defined.
|
||||||
const size_t single_object_instance_idx);
|
const size_t single_object_instance_idx);
|
||||||
|
|
||||||
std::string extrude_perimeters(const Print& print, const std::vector<ObjectByExtruder::Island::Region>& by_region);
|
std::string extrude_perimeters(const PrintObject &print_object, const std::vector<ObjectByExtruder::Island::Region>& by_region);
|
||||||
std::string extrude_infill(const Print& print, const std::vector<ObjectByExtruder::Island::Region>& by_region, bool ironing);
|
std::string extrude_infill(const PrintObject &print_object, const std::vector<ObjectByExtruder::Island::Region>& by_region, bool ironing);
|
||||||
std::string extrude_support(const ExtrusionEntityCollection& support_fills);
|
std::string extrude_support(const ExtrusionEntityCollection& support_fills);
|
||||||
|
|
||||||
// BBS
|
// BBS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue