OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::OozePrevention Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/GCode.hpp>

Public Member Functions

 OozePrevention ()
std::string pre_toolchange (GCode &gcodegen)
std::string post_toolchange (GCode &gcodegen)

Public Attributes

bool enable

Private Member Functions

int _get_temp (const GCode &gcodegen) const

Detailed Description

Constructor & Destructor Documentation

◆ OozePrevention()

Slic3r::OozePrevention::OozePrevention ( )
inline
72: enable(false) {}
bool enable
Definition GCode.hpp:70

References enable.

Member Function Documentation

◆ _get_temp()

int Slic3r::OozePrevention::_get_temp ( const GCode & gcodegen) const
private
524 {
525 // Resolve the filament's per-variant config column (equals its id on static prints).
526 size_t fi = gcodegen.get_filament_config_index((int)gcodegen.writer().filament()->id());
527 // First layer temperature should be used when on the first layer (obviously) and when
528 // "other layers" is set to zero (which means it should not be used).
529 return (gcodegen.layer() == nullptr || gcodegen.layer()->id() == 0
530 || gcodegen.config().nozzle_temperature.get_at(fi) == 0)
531 ? gcodegen.config().nozzle_temperature_initial_layer.get_at(fi)
532 : gcodegen.config().nozzle_temperature.get_at(fi);
533 }

References Slic3r::GCode::config(), Slic3r::GCodeWriter::filament(), Slic3r::GCode::get_filament_config_index(), Slic3r::Extruder::id(), Slic3r::Layer::id(), Slic3r::GCode::layer(), and Slic3r::GCode::writer().

Referenced by post_toolchange(), and pre_toolchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ post_toolchange()

std::string Slic3r::OozePrevention::post_toolchange ( GCode & gcodegen)
517 {
518 return (gcodegen.config().standby_temperature_delta.value != 0) ?
519 gcodegen.writer().set_temperature(this->_get_temp(gcodegen), true, gcodegen.writer().filament()->id()) :
520 std::string();
521 }
int _get_temp(const GCode &gcodegen) const
Definition GCode.cpp:523

References _get_temp(), Slic3r::GCode::config(), Slic3r::GCodeWriter::filament(), Slic3r::Extruder::id(), Slic3r::GCodeWriter::set_temperature(), and Slic3r::GCode::writer().

Here is the call graph for this function:

◆ pre_toolchange()

std::string Slic3r::OozePrevention::pre_toolchange ( GCode & gcodegen)
482 {
483 unsigned int extruder_id = gcodegen.writer().filament()->id();
484
485 // Check if this tool will ever be used again in this print.
486 bool is_last_use = false;
487 if (gcodegen.m_print != nullptr && !gcodegen.m_print->tool_ordering().empty()) {
488 coordf_t current_z = gcodegen.layer() ? gcodegen.layer()->print_z : gcodegen.writer().get_position().z();
489 const auto& tool_ordering = gcodegen.m_print->tool_ordering();
490 const auto& cfg = gcodegen.config();
491 const int heater = imex_physical_heater_for(cfg.is_imex.value, cfg.physical_extruder_map, int(extruder_id));
492 is_last_use = tool_ordering.is_last_extrusion_layer(current_z, extruder_id);
493 for (unsigned int f : tool_ordering.all_extruders())
494 if (is_last_use && imex_physical_heater_for(cfg.is_imex.value, cfg.physical_extruder_map, int(f)) == heater)
495 is_last_use = tool_ordering.is_last_extrusion_layer(current_z, f);
496 }
497
498 int temp = 0;
499 if (!is_last_use) {
500 const auto& filament_idle_temp = gcodegen.config().idle_temperature;
501 if (filament_idle_temp.get_at(extruder_id) == 0) {
502 if (gcodegen.config().standby_temperature_delta.value == 0)
503 return std::string();
504 temp = this->_get_temp(gcodegen) + gcodegen.config().standby_temperature_delta.value;
505 } else {
506 temp = filament_idle_temp.get_at(extruder_id);
507 }
508 }
509
510 std::string gcode = gcodegen.writer().set_temperature(temp, false, extruder_id);
511 gcode.pop_back();
512 gcode += " ;cooldown\n"; // this is a marker for GCodeProcessor, so it can supress the commands when needed
513 return gcode;
514 }
@ gcode
Definition Time.hpp:14
int imex_physical_heater_for(bool is_imex, const ConfigOptionInts &pem, int logical_id)
Definition IMEXHelpers.cpp:88
double coordf_t
Definition GUI_ObjectList.hpp:46
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:124

References _get_temp(), Slic3r::GCode::config(), Slic3r::ToolOrdering::empty(), Slic3r::f(), Slic3r::GCodeWriter::filament(), Slic3r::GCodeWriter::get_position(), Slic3r::Extruder::id(), Slic3r::imex_physical_heater_for(), Slic3r::GCode::layer(), Slic3r::GCode::m_print, Slic3r::Layer::print_z, Slic3r::GCodeWriter::set_temperature(), Slic3r::Print::tool_ordering(), and Slic3r::GCode::writer().

Here is the call graph for this function:

Member Data Documentation

◆ enable

bool Slic3r::OozePrevention::enable

Referenced by OozePrevention().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/GCode.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/GCode.cpp