OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::WipeTowerWriter Class Reference
Collaboration diagram for Slic3r::WipeTowerWriter:

Public Member Functions

 WipeTowerWriter (float layer_height, float line_width, GCodeFlavor flavor, const std::vector< WipeTower::FilamentParameters > &filament_parameters, bool enable_arc_fitting)
WipeTowerWriter & change_analyzer_line_width (float line_width)
WipeTowerWriter & set_initial_position (const Vec2f &pos, float width=0.f, float depth=0.f, float internal_angle=0.f)
WipeTowerWriter & set_initial_tool (size_t tool)
WipeTowerWriter & set_z (float z)
WipeTowerWriter & set_extrusion_flow (float flow)
WipeTowerWriter & set_y_shift (float shift)
WipeTowerWriter & disable_linear_advance ()
WipeTowerWriter & suppress_preview ()
WipeTowerWriter & resume_preview ()
WipeTowerWriter & feedrate (float f)
const std::string & gcode () const
const std::vector< WipeTower::Extrusion > & extrusions () const
float x () const
float y () const
const Vec2f & pos () const
const Vec2f start_pos_rotated () const
const Vec2f pos_rotated () const
float elapsed_time () const
float get_and_reset_used_filament_length ()
WipeTowerWriter & extrude_explicit (float x, float y, float e, float f=0.f, bool record_length=false, LimitFlow limit_flow=LimitFlow::LimitPrintFlow)
WipeTowerWriter & extrude_arc_explicit (ArcSegment &arc, float f=0.f, bool record_length=false, LimitFlow limit_flow=LimitFlow::LimitPrintFlow)
WipeTowerWriter & extrude_explicit (const Vec2f &dest, float e, float f=0.f, bool record_length=false, LimitFlow limit_flow=LimitFlow::LimitPrintFlow)
WipeTowerWriter & travel (float x, float y, float f=0.f)
WipeTowerWriter & travel (const Vec2f &dest, float f=0.f)
WipeTowerWriter & extrude (float x, float y, float f=0.f, LimitFlow limit_flow=LimitFlow::LimitPrintFlow)
WipeTowerWriter & extrude_arc (ArcSegment &arc, float f=0.f, LimitFlow limit_flow=LimitFlow::LimitPrintFlow)
WipeTowerWriter & extrude (const Vec2f &dest, const float f=0.f)
WipeTowerWriter & rectangle (const Vec2f &ld, float width, float height, const float f=0.f)
WipeTowerWriter & rectangle_fill_box (const WipeTower *wipe_tower, const Vec2f &ld, float width, float height, const float f=0.f)
WipeTowerWriter & line (const WipeTower *wipe_tower, Vec2f p0, Vec2f p1, const float f=0.f)
WipeTowerWriter & rectangle_fill_box (const WipeTower *wipe_tower, const WipeTower::box_coordinates &fill_box, std::vector< Vec2f > &finish_rect_wipe_path, const float f=0.f)
WipeTowerWriter & rectangle (const WipeTower::box_coordinates &box, const float f=0.f)
WipeTowerWriter & polygon (const Polygon &wall_polygon, const float f=0.f)
WipeTowerWriter & load (float e, float f=0.f)
WipeTowerWriter & retract (float e, float f=0.f)
WipeTowerWriter & load_move_x_advanced (float farthest_x, float loading_dist, float loading_speed, float max_x_speed=50.f)
WipeTowerWriter & z_hop (float hop, float f=0.f)
WipeTowerWriter & z_hop_reset (float f=0.f)
WipeTowerWriter & ram (float x1, float x2, float dy, float e0, float e, float f)
WipeTowerWriter & cool (float x1, float x2, float e1, float e2, float f)
WipeTowerWriter & set_tool (size_t tool)
WipeTowerWriter & set_extruder_temp (int temperature, bool wait=false)
WipeTowerWriter & wait (float time)
WipeTowerWriter & speed_override (int speed)
WipeTowerWriter & speed_override_backup ()
WipeTowerWriter & speed_override_restore ()
WipeTowerWriter & set_extruder_trimpot (int current)
WipeTowerWriter & flush_planner_queue ()
WipeTowerWriter & reset_extruder ()
WipeTowerWriter & comment_with_value (const char *comment, int value)
WipeTowerWriter & set_fan (unsigned speed)
WipeTowerWriter & append (const std::string &text)
const std::vector< Vec2f > & wipe_path () const
WipeTowerWriter & add_wipe_point (const Vec2f &pt)
WipeTowerWriter & add_wipe_point (float x, float y)
WipeTowerWriter & add_wipe_path (const Polygon &polygon, double wipe_dist)
void generate_path (Polylines &pls, float feedrate, float retract_length, float retract_speed, bool used_fillet)
void spiral_flat_ironing (const Vec2f &center, float area, float step_length, float feedrate)
WipeTowerWriter & format_line_M104 (int target_temp, int target_extruder, bool wait_for_moves=true, const std::string &comment=std::string())
WipeTowerWriter & format_line_M109 (int target_temp, int target_extruder, const std::string &comment=std::string())
void set_first_layer (bool is_first_layer)
void set_normal_acceleration (const std::vector< unsigned int > &accelerations)
void set_first_layer_normal_acceleration (const std::vector< unsigned int > &accelerations)
void set_travel_acceleration (const std::vector< unsigned int > &accelerations)
void set_first_layer_travel_acceleration (const std::vector< unsigned int > &accelerations)
void set_max_acceleration (unsigned int acceleration)
void set_accel_to_decel_enable (bool enable)
void set_accel_to_decel_factor (float factor)
void set_layer_id (int layer_id)
void set_multi_nozzle_group_result (const MultiNozzleUtils::LayeredNozzleGroupResult *multi_nozzle_group_result)
void set_physical_extruder_map (const std::vector< int > &physical_extruder_map)

Private Member Functions

std::string set_normal_acceleration ()
std::string set_travel_acceleration ()
std::string set_acceleration_impl (unsigned int acceleration)
std::string set_format_X (float x)
std::string set_format_Y (float y)
std::string set_format_Z (float z)
std::string set_format_E (float e)
std::string set_format_F (float f)
std::string set_format_I (float i)
std::string set_format_J (float j)
WipeTowerWriter & operator= (const WipeTowerWriter &rhs)
Vec2f rotate (Vec2f pt) const

Private Attributes

std::vector< unsigned int > m_normal_accelerations
std::vector< unsigned int > m_first_layer_normal_accelerations
std::vector< unsigned int > m_travel_accelerations
std::vector< unsigned int > m_first_layer_travel_accelerations
bool m_is_first_layer {false}
unsigned int m_max_acceleration {0}
unsigned int m_last_acceleration {0}
bool m_accel_to_decel_enable
float m_accel_to_decel_factor
const MultiNozzleUtils::LayeredNozzleGroupResult * m_multi_nozzle_group_result {nullptr}
int m_layer_id = -1
std::vector< int > m_physical_extruder_map
Vec2f m_start_pos
Vec2f m_current_pos
std::vector< Vec2f > m_wipe_path
float m_current_z
float m_current_feedrate
size_t m_current_tool
float m_layer_height
float m_extrusion_flow
bool m_preview_suppressed
std::string m_gcode
std::vector< WipeTower::Extrusion > m_extrusions
float m_elapsed_time
float m_internal_angle = 0.f
float m_y_shift = 0.f
float m_wipe_tower_width = 0.f
float m_wipe_tower_depth = 0.f
unsigned m_last_fan_speed = 0
int current_temp = -1
float m_used_filament_length = 0.f
GCodeFlavor m_gcode_flavor
bool m_enable_arc_fitting = true
const std::vector< WipeTower::FilamentParameters > & m_filpar

Detailed Description

Constructor & Destructor Documentation

◆ WipeTowerWriter()

Slic3r::WipeTowerWriter::WipeTowerWriter ( float layer_height,
float line_width,
GCodeFlavor flavor,
const std::vector< WipeTower::FilamentParameters > & filament_parameters,
bool enable_arc_fitting )
inline
734 :
735 m_current_pos(std::numeric_limits<float>::max(), std::numeric_limits<float>::max()),
736 m_current_z(0.f),
739 m_extrusion_flow(0.f),
741 m_elapsed_time(0.f),
742#if ENABLE_GCODE_VIEWER_DATA_CHECKING
743 m_default_analyzer_line_width(line_width),
744#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
745 m_gcode_flavor(flavor),
746 m_enable_arc_fitting(enable_arc_fitting),
747 m_filpar(filament_parameters)
748 {
749 // ORCA: This class is only used by BBL printers, so set the parameter appropriately.
750 // This fixes an issue where the wipe tower was using BBL tags resulting in statistics for purging in the purge tower not being displayed.
752 // adds tag for analyzer:
753 std::ostringstream str;
754 str << ";" << GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Height) << Slic3r::float_to_string_decimal_point(m_layer_height, 6) << "\n"; // don't rely on GCodeAnalyzer knowing the layer height - it knows nothing at priming
756 m_gcode += str.str();
757 change_analyzer_line_width(line_width);
758 }
static std::string role_to_string(ExtrusionRole role)
Definition ExtrusionEntity.cpp:673
static const std::string & reserved_tag(ETags tag)
Definition GCodeProcessor.hpp:636
@ Role
Definition GCodeProcessor.hpp:604
@ Height
Definition GCodeProcessor.hpp:607
static bool s_IsBBLPrinter
Definition GCodeProcessor.hpp:650
float m_current_z
Definition WipeTower.cpp:1569
Vec2f m_current_pos
Definition WipeTower.cpp:1567
const std::vector< WipeTower::FilamentParameters > & m_filpar
Definition WipeTower.cpp:1590
bool m_preview_suppressed
Definition WipeTower.cpp:1574
GCodeFlavor m_gcode_flavor
Definition WipeTower.cpp:1588
float m_elapsed_time
Definition WipeTower.cpp:1577
bool m_enable_arc_fitting
Definition WipeTower.cpp:1589
WipeTowerWriter & change_analyzer_line_width(float line_width)
Definition WipeTower.cpp:760
float m_layer_height
Definition WipeTower.cpp:1572
std::string m_gcode
Definition WipeTower.cpp:1575
float m_current_feedrate
Definition WipeTower.cpp:1570
float m_extrusion_flow
Definition WipeTower.cpp:1573
layer_height((ConfigOptionInt, faded_layers))((ConfigOptionFloat
@ erWipeTower
Definition ExtrusionEntity.hpp:44
std::string float_to_string_decimal_point(double value, int precision)
Definition LocalesUtils.cpp:108

References change_analyzer_line_width(), Slic3r::erWipeTower, Slic3r::float_to_string_decimal_point(), Slic3r::GCodeProcessor::Height, Slic3r::layer_height(), m_current_feedrate, m_current_pos, m_current_z, m_elapsed_time, m_enable_arc_fitting, m_extrusion_flow, m_filpar, m_gcode, m_gcode_flavor, m_layer_height, m_preview_suppressed, Slic3r::GCodeProcessor::reserved_tag(), Slic3r::GCodeProcessor::Role, Slic3r::ExtrusionEntity::role_to_string(), and Slic3r::GCodeProcessor::s_IsBBLPrinter.

Referenced by add_wipe_path(), add_wipe_point(), add_wipe_point(), append(), change_analyzer_line_width(), comment_with_value(), cool(), disable_linear_advance(), extrude(), extrude(), extrude_arc(), extrude_arc_explicit(), extrude_explicit(), extrude_explicit(), feedrate(), flush_planner_queue(), format_line_M104(), format_line_M109(), line(), load(), load_move_x_advanced(), operator=(), polygon(), ram(), rectangle(), rectangle(), rectangle_fill_box(), rectangle_fill_box(), reset_extruder(), resume_preview(), retract(), set_extruder_temp(), set_extruder_trimpot(), set_extrusion_flow(), set_fan(), set_initial_position(), set_initial_tool(), set_tool(), set_y_shift(), set_z(), speed_override(), speed_override_backup(), speed_override_restore(), suppress_preview(), travel(), travel(), wait(), z_hop(), and z_hop_reset().

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

Member Function Documentation

◆ add_wipe_path()

WipeTowerWriter & Slic3r::WipeTowerWriter::add_wipe_path ( const Polygon & polygon,
double wipe_dist )
inline
1353 {
1354 int closest_idx = polygon.closest_point_index(scaled(m_current_pos));
1355 Polyline wipe_path = polygon.split_at_index(closest_idx);
1356 wipe_path.reverse();
1357 for (int i = 0; i < wipe_path.size(); ++i) {
1358 if (wipe_dist < EPSILON) break;
1360 if (i != 0) wipe_dist -= (unscaled(wipe_path[i]) - unscaled(wipe_path[i - 1])).norm();
1361 }
1362 return *this;
1363 }
#define EPSILON
Definition ColorUtils.cpp:64
const std::vector< Vec2f > & wipe_path() const
Definition WipeTower.cpp:1336
WipeTowerWriter & polygon(const Polygon &wall_polygon, const float f=0.f)
Definition WipeTower.cpp:1122
WipeTowerWriter & add_wipe_point(const Vec2f &pt)
Definition WipeTower.cpp:1341
BoundingBox scaled(const BoundingBoxf &bb)
Definition BoundingBox.hpp:284
constexpr Eigen::Matrix< Tout, 2, EigenArgs... > unscaled(const Slic3r::Point &v) noexcept
Definition Arrange.cpp:81

References WipeTowerWriter(), add_wipe_point(), EPSILON, m_current_pos, polygon(), Slic3r::scaled(), Slic3r::unscaled(), and wipe_path().

Referenced by Slic3r::WipeTower::finish_layer_new(), and Slic3r::WipeTower::only_generate_out_wall().

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

◆ add_wipe_point() [1/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::add_wipe_point ( const Vec2f & pt)
inline
1342 {
1343 m_wipe_path.push_back(rotate(pt));
1344 return *this;
1345 }
Vec2f rotate(Vec2f pt) const
Definition WipeTower.cpp:1623
std::vector< Vec2f > m_wipe_path
Definition WipeTower.cpp:1568

References WipeTowerWriter(), m_wipe_path, and rotate().

Referenced by add_wipe_path(), add_wipe_point(), Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_block_solid(), Slic3r::WipeTower::finish_layer_new(), Slic3r::WipeTower::toolchange_Wipe(), and Slic3r::WipeTower::toolchange_wipe_new().

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

◆ add_wipe_point() [2/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::add_wipe_point ( float x,
float y )
inline
1348 {
1349 return add_wipe_point(Vec2f(x, y));
1350 }
float x() const
Definition WipeTower.cpp:836
float y() const
Definition WipeTower.cpp:837
Eigen::Matrix< float, 2, 1, Eigen::DontAlign > Vec2f
Definition Point.hpp:64

References WipeTowerWriter(), add_wipe_point(), x(), and y().

Here is the call graph for this function:

◆ append()

WipeTowerWriter & Slic3r::WipeTowerWriter::append ( const std::string & text)
inline
1334{ m_gcode += text; return *this; }

References WipeTowerWriter(), and m_gcode.

Referenced by Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_block_solid(), Slic3r::WipeTower::finish_layer_new(), format_line_M104(), format_line_M109(), line(), Slic3r::WipeTower::only_generate_out_wall(), Slic3r::WipeTower::ramming(), rectangle_fill_box(), Slic3r::WipeTower::tool_change(), Slic3r::WipeTower::tool_change_new(), Slic3r::WipeTower::toolchange_Change(), Slic3r::WipeTower::toolchange_Load(), Slic3r::WipeTower::toolchange_Unload(), Slic3r::WipeTower::toolchange_Wipe(), and Slic3r::WipeTower::toolchange_wipe_new().

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

◆ change_analyzer_line_width()

WipeTowerWriter & Slic3r::WipeTowerWriter::change_analyzer_line_width ( float line_width)
inline
760 {
761 // adds tag for analyzer:
762 std::stringstream str;
764 m_gcode += str.str();
765 return *this;
766 }
@ Width
Definition GCodeProcessor.hpp:608

References WipeTowerWriter(), Slic3r::float_to_string_decimal_point(), m_gcode, Slic3r::GCodeProcessor::reserved_tag(), and Slic3r::GCodeProcessor::Width.

Referenced by WipeTowerWriter(), Slic3r::WipeTower::toolchange_Unload(), and Slic3r::WipeTower::toolchange_wipe_new().

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

◆ comment_with_value()

WipeTowerWriter & Slic3r::WipeTowerWriter::comment_with_value ( const char * comment,
int value )
inline
1316 {
1317 m_gcode += std::string(";") + comment + std::to_string(value) + "\n";
1318 return *this;
1319 }

References WipeTowerWriter(), and m_gcode.

Referenced by Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_block_solid(), Slic3r::WipeTower::finish_layer_new(), Slic3r::WipeTower::tool_change(), and Slic3r::WipeTower::tool_change_new().

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

◆ cool()

WipeTowerWriter & Slic3r::WipeTowerWriter::cool ( float x1,
float x2,
float e1,
float e2,
float f )
inline
1235 {
1236 extrude_explicit(x1, m_current_pos.y(), e1, f, false, LimitFlow::None);
1237 extrude_explicit(x2, m_current_pos.y(), e2, 0.f, false, LimitFlow::None);
1238 return *this;
1239 }
WipeTowerWriter & extrude_explicit(float x, float y, float e, float f=0.f, bool record_length=false, LimitFlow limit_flow=LimitFlow::LimitPrintFlow)
Definition WipeTower.cpp:845
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:124
@ None
Definition WipeTower.cpp:50

References WipeTowerWriter(), extrude_explicit(), Slic3r::f(), m_current_pos, and Slic3r::None.

Here is the call graph for this function:

◆ disable_linear_advance()

WipeTowerWriter & Slic3r::WipeTowerWriter::disable_linear_advance ( )
inline
803 {
805 m_gcode += "SET_PRESSURE_ADVANCE ADVANCE=0\n";
807 m_gcode += std::string("M572 D") + std::to_string(m_current_tool) + " S0\n";
808 else
809 m_gcode += "M900 K0\n";
810
811 return *this;
812 }
size_t m_current_tool
Definition WipeTower.cpp:1571
@ gcfKlipper
Definition PrintConfig.hpp:53
@ gcfRepRapFirmware
Definition PrintConfig.hpp:54

References WipeTowerWriter(), Slic3r::gcfKlipper, Slic3r::gcfRepRapFirmware, m_current_tool, m_gcode, and m_gcode_flavor.

Referenced by Slic3r::WipeTower::toolchange_Unload().

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

◆ elapsed_time()

float Slic3r::WipeTowerWriter::elapsed_time ( ) const
inline
841{ return m_elapsed_time; }

References m_elapsed_time.

Referenced by Slic3r::WipeTower::construct_block_tcr(), and Slic3r::WipeTower::construct_tcr().

Here is the caller graph for this function:

◆ extrude() [1/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::extrude ( const Vec2f & dest,
const float f = 0.f )
inline
1015 { return extrude(dest.x(), dest.y(), f); }
WipeTowerWriter & extrude(float x, float y, float f=0.f, LimitFlow limit_flow=LimitFlow::LimitPrintFlow)
Definition WipeTower.cpp:1003

References WipeTowerWriter(), extrude(), and Slic3r::f().

Here is the call graph for this function:

◆ extrude() [2/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::extrude ( float x,
float y,
float f = 0.f,
LimitFlow limit_flow = LimitFlow::LimitPrintFlow )
inline
1004 {
1005 float dx = x - m_current_pos.x();
1006 float dy = y - m_current_pos.y();
1007 return extrude_explicit(x, y, std::sqrt(dx * dx + dy * dy) * m_extrusion_flow, f, false, limit_flow);
1008 }

References WipeTowerWriter(), extrude_explicit(), Slic3r::f(), Slic3r::LimitPrintFlow, m_current_pos, m_extrusion_flow, x(), and y().

Referenced by extrude(), Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_block_solid(), Slic3r::WipeTower::finish_layer_new(), generate_path(), Slic3r::WipeTower::generate_support_wall(), line(), polygon(), Slic3r::WipeTower::ramming(), rectangle(), rectangle_fill_box(), Slic3r::WipeTower::toolchange_Unload(), Slic3r::WipeTower::toolchange_Wipe(), and Slic3r::WipeTower::toolchange_wipe_new().

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

◆ extrude_arc()

WipeTowerWriter & Slic3r::WipeTowerWriter::extrude_arc ( ArcSegment & arc,
float f = 0.f,
LimitFlow limit_flow = LimitFlow::LimitPrintFlow )
inline
1010 {
1011 return extrude_arc_explicit(arc, f, false , limit_flow);
1012 }
WipeTowerWriter & extrude_arc_explicit(ArcSegment &arc, float f=0.f, bool record_length=false, LimitFlow limit_flow=LimitFlow::LimitPrintFlow)
Definition WipeTower.cpp:913

References WipeTowerWriter(), extrude_arc_explicit(), Slic3r::f(), and Slic3r::LimitPrintFlow.

Referenced by generate_path(), and polygon().

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

◆ extrude_arc_explicit()

WipeTowerWriter & Slic3r::WipeTowerWriter::extrude_arc_explicit ( ArcSegment & arc,
float f = 0.f,
bool record_length = false,
LimitFlow limit_flow = LimitFlow::LimitPrintFlow )
inline
914 {
915 float x = (float)unscale(arc.end_point).x();
916 float y = (float)unscale(arc.end_point).y();
917 float len = unscaled<float>(arc.length);
918 float e = len * m_extrusion_flow;
919 if (len < (float) EPSILON && e == 0.f && (f == 0.f || f == m_current_feedrate))
920 // Neither extrusion nor a travel move.
921 return *this;
922 if (record_length) m_used_filament_length += e;
923
924 // Now do the "internal rotation" with respect to the wipe tower center
925 Vec2f rotated_current_pos(this->pos_rotated());
926 Vec2f rot(this->rotate(Vec2f(x, y))); // this is where we want to go
927
928 if (!m_preview_suppressed && e > 0.f && len > 0.f) {
929#if ENABLE_GCODE_VIEWER_DATA_CHECKING
930 change_analyzer_mm3_per_mm(len, e);
931#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
932 // Width of a squished extrusion, corrected for the roundings of the squished extrusions.
933 // This is left zero if it is a travel move.
934 float width = e * m_filpar[0].filament_area / (len * m_layer_height);
935 // Correct for the roundings of a squished extrusion.
936 width += m_layer_height * float(1. - M_PI / 4.);
937 if (m_extrusions.empty() || m_extrusions.back().pos != rotated_current_pos) m_extrusions.emplace_back(WipeTower::Extrusion(rotated_current_pos, 0, m_current_tool));
938 {
939 int n = arc_fit_size;
940 for (int j = 0; j < n; j++) {
941 float cur_angle = arc.polar_start_theta + (float) j / n * arc.angle_radians;
942 if (cur_angle > 2 * PI)
943 cur_angle -= 2 * PI;
944 else if (cur_angle < 0)
945 cur_angle += 2 * PI;
946 Point tmp = arc.center + Point{arc.radius * std::cos(cur_angle), arc.radius * std::sin(cur_angle)};
947 m_extrusions.emplace_back(WipeTower::Extrusion(this->rotate(unscaled<float>(tmp)), width, m_current_tool));
948 }
949 m_extrusions.emplace_back(WipeTower::Extrusion(rot, width, m_current_tool));
950 }
951
952 }
953
954 if (e == 0.f) {
956 } else {
958 }
959
960 m_gcode += arc.direction == ArcDirection::Arc_Dir_CCW ? "G3" : "G2";
961 const Vec2f center_offset = this->rotate(unscaled<float>(arc.center)) - rotated_current_pos;
962 m_gcode += set_format_X(rot.x());
963 m_gcode += set_format_Y(rot.y());
964 m_gcode += set_format_I(center_offset.x());
965 m_gcode += set_format_J(center_offset.y());
966
967 if (e != 0.f) m_gcode += set_format_E(e);
968
969 if (f != 0.f && f != m_current_feedrate) {
970 if (limit_flow != LimitFlow::None) {
971 float e_speed = e / (((len == 0.f) ? std::abs(e) : len) / f * 60.f);
972 float tmp = m_filpar[m_current_tool].max_e_speed;
973 if (limit_flow == LimitFlow::LimitRammingFlow) tmp = m_filpar[m_current_tool].max_e_ramming_speed.first;
974 else if (limit_flow == LimitFlow::LimitRammingFlowNC)
975 tmp = m_filpar[m_current_tool].max_e_ramming_speed.second;
976 f /= std::max(1.f, e_speed / tmp);
977 }
979 }
980
981 m_current_pos.x() = x;
982 m_current_pos.y() = y;
983
984 // Update the elapsed time with a rough estimate.
985 m_elapsed_time += ((len == 0.f) ? std::abs(e) : len) / m_current_feedrate * 60.f;
986 m_gcode += "\n";
987 return *this;
988 }
#define M_PI
Definition ExtrusionSimulator.cpp:31
std::string set_format_I(float i)
Definition WipeTower.cpp:1617
std::string set_normal_acceleration()
Definition WipeTower.cpp:1489
std::string set_travel_acceleration()
Definition WipeTower.cpp:1501
std::string set_format_Y(float y)
Definition WipeTower.cpp:1598
std::string set_format_X(float x)
Definition WipeTower.cpp:1592
std::string set_format_F(float f)
Definition WipeTower.cpp:1611
std::vector< WipeTower::Extrusion > m_extrusions
Definition WipeTower.cpp:1576
float m_used_filament_length
Definition WipeTower.cpp:1587
const Vec2f pos_rotated() const
Definition WipeTower.cpp:840
std::string set_format_E(float e)
Definition WipeTower.cpp:1607
std::string set_format_J(float j)
Definition WipeTower.cpp:1618
static constexpr double PI
Definition libslic3r.h:81
void arc(std::vector< std::pair< Vec2d, Vec2d > > &out, double cx, double cy, double rx, double ry, double a0, double a1, int n=14)
Definition DesignSketchTool.cpp:7759
Kernel::Point_3 Point
Definition MeshRepair.cpp:81
coord_t width(const BoundingBox &box)
Definition Arrange.cpp:1184
T unscale(Q v)
Definition libslic3r.h:138
static constexpr int arc_fit_size
Definition WipeTower.cpp:48
@ LimitRammingFlow
Definition WipeTower.cpp:50
@ LimitRammingFlowNC
Definition WipeTower.cpp:50
@ Arc_Dir_CCW
Definition Circle.hpp:63

References WipeTowerWriter(), Slic3r::Arc_Dir_CCW, Slic3r::arc_fit_size, EPSILON, Slic3r::f(), Slic3r::LimitPrintFlow, Slic3r::LimitRammingFlow, Slic3r::LimitRammingFlowNC, m_current_feedrate, m_current_pos, m_current_tool, m_elapsed_time, m_extrusion_flow, m_extrusions, m_filpar, m_gcode, m_layer_height, M_PI, m_preview_suppressed, m_used_filament_length, Slic3r::None, PI, pos_rotated(), rotate(), set_format_E(), set_format_F(), set_format_I(), set_format_J(), set_format_X(), set_format_Y(), set_normal_acceleration(), set_travel_acceleration(), Slic3r::unscale(), Slic3r::unscaled(), x(), and y().

Referenced by extrude_arc().

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

◆ extrude_explicit() [1/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::extrude_explicit ( const Vec2f & dest,
float e,
float f = 0.f,
bool record_length = false,
LimitFlow limit_flow = LimitFlow::LimitPrintFlow )
inline
991 {
992 return extrude_explicit(dest.x(), dest.y(), e, f, record_length, limit_flow);
993 }

References WipeTowerWriter(), extrude_explicit(), Slic3r::f(), and Slic3r::LimitPrintFlow.

Here is the call graph for this function:

◆ extrude_explicit() [2/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::extrude_explicit ( float x,
float y,
float e,
float f = 0.f,
bool record_length = false,
LimitFlow limit_flow = LimitFlow::LimitPrintFlow )
inline
846 {
847 if ((std::abs(x - m_current_pos.x()) <= (float)EPSILON) && (std::abs(y - m_current_pos.y()) < (float)EPSILON) && e == 0.f && (f == 0.f || f == m_current_feedrate))
848 // Neither extrusion nor a travel move.
849 return *this;
850
851 float dx = x - m_current_pos.x();
852 float dy = y - m_current_pos.y();
853 float len = std::sqrt(dx*dx+dy*dy);
854 if (record_length)
856
857 // Now do the "internal rotation" with respect to the wipe tower center
858 Vec2f rotated_current_pos(this->pos_rotated());
859 Vec2f rot(this->rotate(Vec2f(x,y))); // this is where we want to go
860
861 if (! m_preview_suppressed && e > 0.f && len > 0.f) {
862#if ENABLE_GCODE_VIEWER_DATA_CHECKING
863 change_analyzer_mm3_per_mm(len, e);
864#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
865 // Width of a squished extrusion, corrected for the roundings of the squished extrusions.
866 // This is left zero if it is a travel move.
867 float width = e * m_filpar[0].filament_area / (len * m_layer_height);
868 // Correct for the roundings of a squished extrusion.
869 width += m_layer_height * float(1. - M_PI / 4.);
870 if (m_extrusions.empty() || m_extrusions.back().pos != rotated_current_pos)
871 m_extrusions.emplace_back(WipeTower::Extrusion(rotated_current_pos, 0, m_current_tool));
872 m_extrusions.emplace_back(WipeTower::Extrusion(rot, width, m_current_tool));
873 }
874
875 if (e == 0.f) {
877 } else {
879 }
880
881 m_gcode += "G1";
882 if (std::abs(rot.x() - rotated_current_pos.x()) > (float)EPSILON)
883 m_gcode += set_format_X(rot.x());
884
885 if (std::abs(rot.y() - rotated_current_pos.y()) > (float)EPSILON)
886 m_gcode += set_format_Y(rot.y());
887
888
889 if (e != 0.f)
890 m_gcode += set_format_E(e);
891
892 if (f != 0.f && f != m_current_feedrate) {
893 if (limit_flow!= LimitFlow::None) {
894 float e_speed = e / (((len == 0.f) ? std::abs(e) : len) / f * 60.f);
895 float tmp = m_filpar[m_current_tool].max_e_speed;
896 if (limit_flow == LimitFlow::LimitRammingFlow) tmp = m_filpar[m_current_tool].max_e_ramming_speed.first;
897 else if (limit_flow == LimitFlow::LimitRammingFlowNC) tmp = m_filpar[m_current_tool].max_e_ramming_speed.second;
898 f /= std::max(1.f, e_speed / tmp);
899 }
901 }
902
903 m_current_pos.x() = x;
904 m_current_pos.y() = y;
905
906 // Update the elapsed time with a rough estimate.
907 m_elapsed_time += ((len == 0.f) ? std::abs(e) : len) / m_current_feedrate * 60.f;
908 m_gcode += "\n";
909 return *this;
910 }

References WipeTowerWriter(), EPSILON, Slic3r::f(), Slic3r::LimitPrintFlow, Slic3r::LimitRammingFlow, Slic3r::LimitRammingFlowNC, m_current_feedrate, m_current_pos, m_current_tool, m_elapsed_time, m_extrusions, m_filpar, m_gcode, m_layer_height, M_PI, m_preview_suppressed, m_used_filament_length, Slic3r::None, pos_rotated(), rotate(), set_format_E(), set_format_F(), set_format_X(), set_format_Y(), set_normal_acceleration(), set_travel_acceleration(), x(), and y().

Referenced by cool(), extrude(), extrude_explicit(), load_move_x_advanced(), ram(), travel(), and travel().

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

◆ extrusions()

const std::vector< WipeTower::Extrusion > & Slic3r::WipeTowerWriter::extrusions ( ) const
inline
835{ return m_extrusions; }

References m_extrusions.

Referenced by Slic3r::WipeTower::construct_block_tcr(), and Slic3r::WipeTower::construct_tcr().

Here is the caller graph for this function:

◆ feedrate()

WipeTowerWriter & Slic3r::WipeTowerWriter::feedrate ( float f)
inline
826 {
827 if (f != m_current_feedrate) {
828 m_gcode += "G1" + set_format_F(f) + "\n";
830 }
831 return *this;
832 }

References WipeTowerWriter(), Slic3r::f(), m_current_feedrate, m_gcode, and set_format_F().

Referenced by generate_path(), spiral_flat_ironing(), Slic3r::WipeTower::tool_change(), Slic3r::WipeTower::tool_change_new(), and Slic3r::WipeTower::toolchange_Change().

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

◆ flush_planner_queue()

WipeTowerWriter & Slic3r::WipeTowerWriter::flush_planner_queue ( )
inline
1303 {
1305 return *this;
1306 }
const char * flush_planner_queue_command(GCodeFlavor flavor)
Definition WipeTower.cpp:719

References WipeTowerWriter(), Slic3r::flush_planner_queue_command(), m_gcode, and m_gcode_flavor.

Referenced by Slic3r::WipeTower::tool_change(), Slic3r::WipeTower::tool_change_new(), Slic3r::WipeTower::toolchange_Change(), and Slic3r::WipeTower::toolchange_Unload().

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

◆ format_line_M104()

WipeTowerWriter & Slic3r::WipeTowerWriter::format_line_M104 ( int target_temp,
int target_extruder,
bool wait_for_moves = true,
const std::string & comment = std::string() )
inline
1444 {
1445 std::string buffer;
1446 if (wait_for_moves)
1447 // Not flush_planner_queue_command(): this BBL precool path wants M400, which every
1448 // flavor it reaches understands, not the zero dwell the other flavors flush with.
1449 buffer += "M400\n";
1450 buffer += "M104";
1451 if (target_extruder != -1 && target_extruder < int(m_physical_extruder_map.size()))
1452 buffer += (" T" + std::to_string(m_physical_extruder_map[target_extruder]));
1453 buffer += " S" + std::to_string(target_temp) + " N0"; // N0 means the gcode is generated by slicer
1454 if (!comment.empty()) buffer += " ;" + comment;
1455 buffer += '\n';
1456 append(buffer);
1457 return *this;
1458 }
WipeTowerWriter & append(const std::string &text)
Definition WipeTower.cpp:1334
std::vector< int > m_physical_extruder_map
Definition WipeTower.cpp:1563

References WipeTowerWriter(), append(), and m_physical_extruder_map.

Referenced by Slic3r::WipeTower::finish_block_solid(), Slic3r::WipeTower::ramming(), and Slic3r::WipeTower::toolchange_wipe_new().

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

◆ format_line_M109()

WipeTowerWriter & Slic3r::WipeTowerWriter::format_line_M109 ( int target_temp,
int target_extruder,
const std::string & comment = std::string() )
inline
1461 {
1462 std::string buffer = "M109";
1463 if (target_extruder != -1 && target_extruder < int(m_physical_extruder_map.size()))
1464 buffer += (" T" + std::to_string(m_physical_extruder_map[target_extruder]));
1465 buffer += " S" + std::to_string(target_temp) + " N0"; // N0 means the gcode is generated by slicer
1466 if (!comment.empty()) buffer += " ;" + comment;
1467 buffer += '\n';
1468 append(buffer);
1469 return *this;
1470 };

References WipeTowerWriter(), append(), and m_physical_extruder_map.

Referenced by Slic3r::WipeTower::finish_block_solid().

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

◆ gcode()

const std::string & Slic3r::WipeTowerWriter::gcode ( ) const
inline
834{ return m_gcode; }

References m_gcode.

Referenced by Slic3r::WipeTower::construct_block_tcr(), Slic3r::WipeTower::construct_tcr(), Slic3r::WipeTower::ramming(), and set_acceleration_impl().

Here is the caller graph for this function:

◆ generate_path()

void Slic3r::WipeTowerWriter::generate_path ( Polylines & pls,
float feedrate,
float retract_length,
float retract_speed,
bool used_fillet )
inline
1365 {
1366 auto get_closet_idx = [this](std::vector<Segment> &corners) -> int {
1367 Vec2f anchor{this->m_current_pos.x(), this->m_current_pos.y()};
1368 int closestIndex = -1;
1369 float minDistance = std::numeric_limits<float>::max();
1370 for (int i = 0; i < corners.size(); ++i) {
1371 float distance = (corners[i].start - anchor).squaredNorm();
1372 if (distance < minDistance) {
1373 minDistance = distance;
1374 closestIndex = i;
1375 }
1376 }
1377 return closestIndex;
1378 };
1380 for (auto &pl : pls) pl.simplify_by_fitting_arc(SCALED_WIPE_TOWER_RESOLUTION);
1381 } else {
1382 for (auto &pl : pls) {
1383 pl.simplify(SCALED_WIPE_TOWER_RESOLUTION);
1384 pl.reset_to_linear_move();
1385 }
1386 }
1387
1388 std::vector<Segment> segments;
1389 for (const auto &pl : pls) {
1390 if (pl.points.size()<2) continue;
1391 for (int i = 0; i < pl.fitting_result.size(); i++) {
1392 if (pl.fitting_result[i].path_type == EMovePathType::Linear_move) {
1393 for (int j = pl.fitting_result[i].start_point_index; j < pl.fitting_result[i].end_point_index; j++)
1394 segments.push_back({unscaled<float>(pl.points[j]), unscaled<float>(pl.points[j + 1])});
1395 } else {
1396 int beg = pl.fitting_result[i].start_point_index;
1397 int end = pl.fitting_result[i].end_point_index;
1398 segments.push_back({unscaled<float>(pl.points[beg]), unscaled<float>(pl.points[end])});
1399 segments.back().is_arc = true;
1400 segments.back().arcsegment = pl.fitting_result[i].arc_data;
1401 }
1402 }
1403 }
1404 if (segments.empty())
1405 return;
1406
1407 int index_of_closest = get_closet_idx(segments);
1408 int i = index_of_closest;
1409 travel(segments[i].start); // travel to the closest points
1410 segments[i].is_arc? extrude_arc(segments[i].arcsegment,feedrate) : extrude(segments[i].end, feedrate);
1411 do {
1412 i = (i + 1) % segments.size();
1413 if (i == index_of_closest) break;
1414 float dx = segments[i].start.x() - m_current_pos.x();
1415 float dy = segments[i].start.y() - m_current_pos.y();
1416 float len = std::sqrt(dx * dx + dy * dy);
1417 if (len > EPSILON) {
1418 retract(retract_length, retract_speed);
1419 travel(segments[i].start, 600.);
1420 retract(-retract_length, retract_speed);
1421 }
1422 segments[i].is_arc ? extrude_arc(segments[i].arcsegment, feedrate) : extrude(segments[i].end, feedrate);
1423 } while (1);
1424 }
#define SCALED_WIPE_TOWER_RESOLUTION
Definition WipeTower.cpp:49
WipeTowerWriter & retract(float e, float f=0.f)
Definition WipeTower.cpp:1188
WipeTowerWriter & extrude_arc(ArcSegment &arc, float f=0.f, LimitFlow limit_flow=LimitFlow::LimitPrintFlow)
Definition WipeTower.cpp:1009
WipeTowerWriter & travel(float x, float y, float f=0.f)
Definition WipeTower.cpp:996
WipeTowerWriter & feedrate(float f)
Definition WipeTower.cpp:825
T * end(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:841
float distance(SpiralVase::SpiralPoint a, SpiralVase::SpiralPoint b)
Definition SpiralVase.cpp:19
@ Linear_move
Definition ArcFitter.hpp:15

References EPSILON, extrude(), extrude_arc(), feedrate(), Slic3r::Linear_move, m_current_pos, m_enable_arc_fitting, retract(), SCALED_WIPE_TOWER_RESOLUTION, travel(), and Slic3r::unscaled().

Referenced by Slic3r::WipeTower::generate_support_wall_new().

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

◆ get_and_reset_used_filament_length()

float Slic3r::WipeTowerWriter::get_and_reset_used_filament_length ( )
inline
842{ float temp = m_used_filament_length; m_used_filament_length = 0.f; return temp; }

References m_used_filament_length.

Referenced by Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_block_solid(), Slic3r::WipeTower::finish_layer_new(), Slic3r::WipeTower::only_generate_out_wall(), Slic3r::WipeTower::tool_change(), Slic3r::WipeTower::tool_change_new(), and Slic3r::WipeTower::toolchange_Change().

Here is the caller graph for this function:

◆ line()

WipeTowerWriter & Slic3r::WipeTowerWriter::line ( const WipeTower * wipe_tower,
Vec2f p0,
Vec2f p1,
const float f = 0.f )
inline
1081 {
1082 bool need_change_flow = wipe_tower->need_thick_bridge_flow(p0.y());
1083 if (need_change_flow) {
1084 set_extrusion_flow(wipe_tower->extrusion_flow(0.2));
1086 }
1087 if (abs(x() - p0.x()) > abs(x() - p1.x())) std::swap(p0, p1);
1088 travel(p0.x(), y());
1089 travel(x(), p0.y());
1090 extrude(p1, f);
1091 if (need_change_flow) {
1092 set_extrusion_flow(wipe_tower->get_extrusion_flow());
1094 }
1095 return (*this);
1096 }
WipeTowerWriter & set_extrusion_flow(float flow)
Definition WipeTower.cpp:794

References WipeTowerWriter(), append(), extrude(), Slic3r::WipeTower::extrusion_flow(), Slic3r::f(), Slic3r::float_to_string_decimal_point(), Slic3r::WipeTower::get_extrusion_flow(), Slic3r::GCodeProcessor::Height, m_layer_height, Slic3r::WipeTower::need_thick_bridge_flow(), Slic3r::GCodeProcessor::reserved_tag(), set_extrusion_flow(), travel(), x(), and y().

Referenced by rectangle_fill_box().

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

◆ load()

WipeTowerWriter & Slic3r::WipeTowerWriter::load ( float e,
float f = 0.f )
inline
1176 {
1177 if (e == 0.f && (f == 0.f || f == m_current_feedrate))
1178 return *this;
1179 m_gcode += "G1";
1180 if (e != 0.f)
1181 m_gcode += set_format_E(e);
1182 if (f != 0.f && f != m_current_feedrate)
1184 m_gcode += "\n";
1185 return *this;
1186 }

References WipeTowerWriter(), Slic3r::f(), m_current_feedrate, m_gcode, set_format_E(), and set_format_F().

Referenced by retract(), and Slic3r::WipeTower::toolchange_Load().

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

◆ load_move_x_advanced()

WipeTowerWriter & Slic3r::WipeTowerWriter::load_move_x_advanced ( float farthest_x,
float loading_dist,
float loading_speed,
float max_x_speed = 50.f )
inline
1193 {
1194 float time = std::abs(loading_dist / loading_speed); // time that the move must take
1195 float x_distance = std::abs(farthest_x - x()); // max x-distance that we can travel
1196 float x_speed = x_distance / time; // x-speed to do it in that time
1197
1198 if (x_speed > max_x_speed) {
1199 // Necessary x_speed is too high - we must shorten the distance to achieve max_x_speed and still respect the time.
1200 x_distance = max_x_speed * time;
1201 x_speed = max_x_speed;
1202 }
1203
1204 float end_point = x() + (farthest_x > x() ? 1.f : -1.f) * x_distance;
1205 return extrude_explicit(end_point, y(), loading_dist, x_speed * 60.f, false, LimitFlow::None);
1206 }

References WipeTowerWriter(), extrude_explicit(), Slic3r::None, x(), and y().

Referenced by Slic3r::WipeTower::toolchange_Load(), and Slic3r::WipeTower::toolchange_Unload().

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

◆ operator=()

WipeTowerWriter & Slic3r::WipeTowerWriter::operator= ( const WipeTowerWriter & rhs)
private

References WipeTowerWriter().

Here is the call graph for this function:

◆ polygon()

WipeTowerWriter & Slic3r::WipeTowerWriter::polygon ( const Polygon & wall_polygon,
const float f = 0.f )
inline
1123 {
1124 Polyline pl = to_polyline(wall_polygon);
1125 pl.simplify(WT_SIMPLIFY_TOLERANCE_SCALED);
1127 pl.simplify_by_fitting_arc(SCALED_WIPE_TOWER_RESOLUTION);
1128 } else {
1129 pl.simplify(SCALED_WIPE_TOWER_RESOLUTION);
1130 pl.reset_to_linear_move();
1131 }
1132
1133 auto get_closet_idx = [this](std::vector<Segment> &corners) -> int {
1134 Vec2f anchor{this->m_current_pos.x(), this->m_current_pos.y()};
1135 int closestIndex = -1;
1136 float minDistance = std::numeric_limits<float>::max();
1137 for (int i = 0; i < corners.size(); ++i) {
1138 float distance = (corners[i].start - anchor).squaredNorm();
1139 if (distance < minDistance) {
1140 minDistance = distance;
1141 closestIndex = i;
1142 }
1143 }
1144 return closestIndex;
1145 };
1146 std::vector<Segment> segments;
1147 for (int i = 0; i < pl.fitting_result.size(); i++) {
1148 if (pl.fitting_result[i].path_type == EMovePathType::Linear_move) {
1149 for (int j = pl.fitting_result[i].start_point_index; j < pl.fitting_result[i].end_point_index; j++)
1150 segments.push_back({unscaled<float>(pl.points[j]), unscaled<float>(pl.points[j + 1])});
1151 } else {
1152 int beg = pl.fitting_result[i].start_point_index;
1153 int end = pl.fitting_result[i].end_point_index;
1154 segments.push_back({unscaled<float>(pl.points[beg]), unscaled<float>(pl.points[end])});
1155 segments.back().is_arc = true;
1156 segments.back().arcsegment = pl.fitting_result[i].arc_data;
1157 }
1158 }
1159
1160 if (segments.empty())
1161 return (*this);
1162
1163 int index_of_closest = get_closet_idx(segments);
1164 int i = index_of_closest;
1165 travel(segments[i].start); // travel to the closest points
1166 segments[i].is_arc ? extrude_arc(segments[i].arcsegment, f) : extrude(segments[i].end, f);
1167 do {
1168 i = (i + 1) % segments.size();
1169 if (i == index_of_closest) break;
1170 segments[i].is_arc ? extrude_arc(segments[i].arcsegment, f) : extrude(segments[i].end, f);
1171 } while (1);
1172 return (*this);
1173 }
static constexpr double WT_SIMPLIFY_TOLERANCE_SCALED
Definition WipeTower2.cpp:52
static Polyline to_polyline(const std::vector< TravelPoint > &travel)
Definition AvoidCrossingPerimeters.cpp:370

References WipeTowerWriter(), extrude(), extrude_arc(), Slic3r::f(), Slic3r::Polyline::fitting_result, Slic3r::Linear_move, m_current_pos, m_enable_arc_fitting, Slic3r::MultiPoint::points, Slic3r::Polyline::reset_to_linear_move(), SCALED_WIPE_TOWER_RESOLUTION, Slic3r::Polyline::simplify(), Slic3r::Polyline::simplify_by_fitting_arc(), Slic3r::to_polyline(), travel(), Slic3r::unscaled(), and Slic3r::WT_SIMPLIFY_TOLERANCE_SCALED.

Referenced by add_wipe_path(), and Slic3r::WipeTower::finish_layer_new().

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

◆ pos()

const Vec2f & Slic3r::WipeTowerWriter::pos ( ) const
inline

◆ pos_rotated()

const Vec2f Slic3r::WipeTowerWriter::pos_rotated ( ) const
inline
840{ return this->rotate(m_current_pos); }

References m_current_pos, and rotate().

Referenced by Slic3r::WipeTower::construct_block_tcr(), Slic3r::WipeTower::construct_tcr(), extrude_arc_explicit(), extrude_explicit(), Slic3r::WipeTower::ramming(), and Slic3r::WipeTower::toolchange_Change().

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

◆ ram()

WipeTowerWriter & Slic3r::WipeTowerWriter::ram ( float x1,
float x2,
float dy,
float e0,
float e,
float f )
inline
1225 {
1226 extrude_explicit(x1, m_current_pos.y() + dy, e0, f, true, LimitFlow::None);
1227 extrude_explicit(x2, m_current_pos.y(), e, 0.f, true, LimitFlow::None);
1228 return *this;
1229 }

References WipeTowerWriter(), extrude_explicit(), Slic3r::f(), m_current_pos, and Slic3r::None.

Referenced by Slic3r::WipeTower::toolchange_Unload().

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

◆ rectangle() [1/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::rectangle ( const Vec2f & ld,
float width,
float height,
const float f = 0.f )
inline
1018 {
1019 Vec2f corners[4];
1020 corners[0] = ld;
1021 corners[1] = ld + Vec2f(width,0.f);
1022 corners[2] = ld + Vec2f(width,height);
1023 corners[3] = ld + Vec2f(0.f,height);
1024 int index_of_closest = 0;
1025 if (x()-ld.x() > ld.x()+width-x()) // closer to the right
1026 index_of_closest = 1;
1027 if (y()-ld.y() > ld.y()+height-y()) // closer to the top
1028 index_of_closest = (index_of_closest==0 ? 3 : 2);
1029
1030 travel(corners[index_of_closest].x(), y()); // travel to the closest corner
1031 travel(x(),corners[index_of_closest].y());
1032
1033 int i = index_of_closest;
1034 do {
1035 ++i;
1036 if (i==4) i=0;
1037 extrude(corners[i], f);
1038 } while (i != index_of_closest);
1039 return (*this);
1040 }

References WipeTowerWriter(), extrude(), Slic3r::f(), travel(), x(), and y().

Referenced by rectangle(), and Slic3r::WipeTower::tool_change().

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

◆ rectangle() [2/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::rectangle ( const WipeTower::box_coordinates & box,
const float f = 0.f )
inline
1116 {
1117 rectangle(Vec2f(box.ld.x(), box.ld.y()),
1118 box.ru.x() - box.lu.x(),
1119 box.ru.y() - box.rd.y(), f);
1120 return (*this);
1121 }
WipeTowerWriter & rectangle(const Vec2f &ld, float width, float height, const float f=0.f)
Definition WipeTower.cpp:1017

References WipeTowerWriter(), Slic3r::f(), Slic3r::WipeTower::box_coordinates::ld, Slic3r::WipeTower::box_coordinates::lu, Slic3r::WipeTower::box_coordinates::rd, rectangle(), and Slic3r::WipeTower::box_coordinates::ru.

Here is the call graph for this function:

◆ rectangle_fill_box() [1/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::rectangle_fill_box ( const WipeTower * wipe_tower,
const Vec2f & ld,
float width,
float height,
const float f = 0.f )
inline
1043 {
1044 bool need_change_flow = wipe_tower->need_thick_bridge_flow(ld.y());
1045
1046 Vec2f corners[4];
1047 corners[0] = ld;
1048 corners[1] = ld + Vec2f(width, 0.f);
1049 corners[2] = ld + Vec2f(width, height);
1050 corners[3] = ld + Vec2f(0.f, height);
1051 int index_of_closest = 0;
1052 if (x() - ld.x() > ld.x() + width - x()) // closer to the right
1053 index_of_closest = 1;
1054 if (y() - ld.y() > ld.y() + height - y()) // closer to the top
1055 index_of_closest = (index_of_closest == 0 ? 3 : 2);
1056
1057 travel(corners[index_of_closest].x(), y()); // travel to the closest corner
1058 travel(x(), corners[index_of_closest].y());
1059
1060 int i = index_of_closest;
1061 bool flow_changed = false;
1062 do {
1063 ++i;
1064 if (i == 4) i = 0;
1065 if (need_change_flow) {
1066 if (i == 1) {
1067 // using bridge flow in bridge area, and add notes for gcode-check when flow changed
1068 set_extrusion_flow(wipe_tower->extrusion_flow(0.2));
1070 flow_changed = true;
1071 } else if (i == 2 && flow_changed) {
1072 set_extrusion_flow(wipe_tower->get_extrusion_flow());
1074 }
1075 }
1076 extrude(corners[i], f);
1077 } while (i != index_of_closest);
1078 return (*this);
1079 }

References WipeTowerWriter(), append(), extrude(), Slic3r::WipeTower::extrusion_flow(), Slic3r::f(), Slic3r::float_to_string_decimal_point(), Slic3r::WipeTower::get_extrusion_flow(), Slic3r::GCodeProcessor::Height, m_layer_height, Slic3r::WipeTower::need_thick_bridge_flow(), Slic3r::GCodeProcessor::reserved_tag(), set_extrusion_flow(), travel(), x(), and y().

Referenced by Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_layer_new(), and rectangle_fill_box().

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

◆ rectangle_fill_box() [2/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::rectangle_fill_box ( const WipeTower * wipe_tower,
const WipeTower::box_coordinates & fill_box,
std::vector< Vec2f > & finish_rect_wipe_path,
const float f = 0.f )
inline
1099 {
1100 float width = fill_box.rd.x() - fill_box.ld.x();
1101 float height = fill_box.ru.y() - fill_box.rd.y();
1102 if (height > wipe_tower->m_perimeter_width - wipe_tower->WT_EPSILON) {
1103 rectangle_fill_box(wipe_tower, fill_box.ld, width, height, f);
1104 Vec2f target = (pos() == fill_box.ld ? fill_box.rd : (pos() == fill_box.rd ? fill_box.ru : (pos() == fill_box.ru ? fill_box.lu : fill_box.ld)));
1105 finish_rect_wipe_path.emplace_back(pos());
1106 finish_rect_wipe_path.emplace_back(target);
1107 } else if (height > wipe_tower->WT_EPSILON) {
1108 line(wipe_tower, fill_box.ld, fill_box.rd);
1109 Vec2f target = (pos() == fill_box.ld ? fill_box.rd : fill_box.ld);
1110 finish_rect_wipe_path.emplace_back(pos());
1111 finish_rect_wipe_path.emplace_back(target);
1112 }
1113 return (*this);
1114 }
WipeTowerWriter & line(const WipeTower *wipe_tower, Vec2f p0, Vec2f p1, const float f=0.f)
Definition WipeTower.cpp:1080
const Vec2f & pos() const
Definition WipeTower.cpp:838
WipeTowerWriter & rectangle_fill_box(const WipeTower *wipe_tower, const Vec2f &ld, float width, float height, const float f=0.f)
Definition WipeTower.cpp:1042
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:1185

References WipeTowerWriter(), Slic3r::f(), Slic3r::WipeTower::box_coordinates::ld, line(), Slic3r::WipeTower::box_coordinates::lu, Slic3r::WipeTower::m_perimeter_width, pos(), Slic3r::WipeTower::box_coordinates::rd, rectangle_fill_box(), Slic3r::WipeTower::box_coordinates::ru, and Slic3r::WipeTower::WT_EPSILON.

Here is the call graph for this function:

◆ reset_extruder()

WipeTowerWriter & Slic3r::WipeTowerWriter::reset_extruder ( )
inline
1310 {
1311 m_gcode += "G92 E0\n";
1312 return *this;
1313 }

References WipeTowerWriter(), and m_gcode.

Referenced by Slic3r::WipeTower::tool_change(), and Slic3r::WipeTower::tool_change_new().

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

◆ resume_preview()

WipeTowerWriter & Slic3r::WipeTowerWriter::resume_preview ( )
inline
822{ m_preview_suppressed = false; return *this; }

References WipeTowerWriter(), and m_preview_suppressed.

Referenced by Slic3r::WipeTower::toolchange_Load(), and Slic3r::WipeTower::toolchange_Unload().

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

◆ retract()

WipeTowerWriter & Slic3r::WipeTowerWriter::retract ( float e,
float f = 0.f )
inline
1189 { return load(-e, f); }
WipeTowerWriter & load(float e, float f=0.f)
Definition WipeTower.cpp:1175

References WipeTowerWriter(), Slic3r::f(), and load().

Referenced by Slic3r::WipeTower::finish_block_solid(), generate_path(), Slic3r::WipeTower::generate_support_wall(), Slic3r::WipeTower::toolchange_Unload(), and Slic3r::WipeTower::toolchange_wipe_new().

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

◆ rotate()

Vec2f Slic3r::WipeTowerWriter::rotate ( Vec2f pt) const
inlineprivate
1624 {
1625 pt.x() -= m_wipe_tower_width / 2.f;
1626 pt.y() += m_y_shift - m_wipe_tower_depth / 2.f;
1627 double angle = m_internal_angle * float(M_PI/180.);
1628 double c = cos(angle);
1629 double s = sin(angle);
1630 return Vec2f(float(pt.x() * c - pt.y() * s) + m_wipe_tower_width / 2.f, float(pt.x() * s + pt.y() * c) + m_wipe_tower_depth / 2.f);
1631 }
float m_y_shift
Definition WipeTower.cpp:1579
float m_wipe_tower_width
Definition WipeTower.cpp:1580
float m_internal_angle
Definition WipeTower.cpp:1578
float m_wipe_tower_depth
Definition WipeTower.cpp:1581
double angle(const Eigen::MatrixBase< Derived > &v1, const Eigen::MatrixBase< Derived2 > &v2)
Definition Point.hpp:138

References Slic3r::angle(), m_internal_angle, M_PI, m_wipe_tower_depth, m_wipe_tower_width, and m_y_shift.

Referenced by add_wipe_point(), extrude_arc_explicit(), extrude_explicit(), pos_rotated(), and set_initial_position().

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

◆ set_accel_to_decel_enable()

void Slic3r::WipeTowerWriter::set_accel_to_decel_enable ( bool enable)
inline
1478{ m_accel_to_decel_enable = enable; }
bool m_accel_to_decel_enable
Definition WipeTower.cpp:1559

References m_accel_to_decel_enable.

Referenced by Slic3r::WipeTower::set_for_wipe_tower_writer().

Here is the caller graph for this function:

◆ set_accel_to_decel_factor()

void Slic3r::WipeTowerWriter::set_accel_to_decel_factor ( float factor)
inline
1479{ m_accel_to_decel_factor = factor; }
float m_accel_to_decel_factor
Definition WipeTower.cpp:1560

References m_accel_to_decel_factor.

Referenced by Slic3r::WipeTower::set_for_wipe_tower_writer().

Here is the caller graph for this function:

◆ set_acceleration_impl()

std::string Slic3r::WipeTowerWriter::set_acceleration_impl ( unsigned int acceleration)
inlineprivate
1514 {
1515 // Clamp the acceleration to the allowed maximum.
1516 if (m_max_acceleration > 0 && acceleration > m_max_acceleration)
1517 acceleration = m_max_acceleration;
1518
1519 if (acceleration == 0 || acceleration == m_last_acceleration)
1520 return std::string();
1521
1522 m_last_acceleration = acceleration;
1523
1524 std::ostringstream gcode;
1525 if (m_gcode_flavor == gcfRepetier) {
1526 // M201: Set max printing acceleration
1527 gcode << "M201 X" << acceleration << " Y" << acceleration;
1528 gcode << "\n";
1529 // M202: Set max travel acceleration
1530 gcode << "M202 X" << acceleration << " Y" << acceleration;
1531 } else if (m_gcode_flavor == gcfRepRapFirmware) {
1532 // M204: Set default acceleration
1533 gcode << "M204 P" << acceleration;
1534 } else if (m_gcode_flavor == gcfMarlinFirmware) {
1535 // This is new MarlinFirmware with separated print/retraction/travel acceleration.
1536 // Use M204 P, we don't want to override travel acc by M204 S (which is deprecated anyway).
1537 gcode << "M204 P" << acceleration;
1538 }
1540 // One line, so Klipper derives the limit from this acceleration rather than the previous one.
1541 std::string limits = "SET_VELOCITY_LIMIT ACCEL=" + std::to_string(acceleration);
1543 gcode << limits;
1544 }
1545 else {
1546 // M204: Set default acceleration
1547 gcode << "M204 S" << acceleration;
1548 }
1549 gcode << "\n";
1550 return gcode.str();
1551 }
static void append_klipper_accel_to_decel(std::string &gcode, unsigned int acceleration, double accel_to_decel_factor)
Definition GCodeWriter.cpp:475
const std::string & gcode() const
Definition WipeTower.cpp:834
unsigned int m_last_acceleration
Definition WipeTower.cpp:1558
unsigned int m_max_acceleration
Definition WipeTower.cpp:1557
@ gcfMarlinFirmware
Definition PrintConfig.hpp:56
@ gcfRepetier
Definition PrintConfig.hpp:55
const struct anonymous_namespace{GLGizmoSVG.cpp}::Limits limits

References Slic3r::GCodeWriter::append_klipper_accel_to_decel(), Slic3r::gcfKlipper, Slic3r::gcfMarlinFirmware, Slic3r::gcfRepetier, Slic3r::gcfRepRapFirmware, gcode(), m_accel_to_decel_enable, m_accel_to_decel_factor, m_gcode_flavor, m_last_acceleration, and m_max_acceleration.

Referenced by set_normal_acceleration(), and set_travel_acceleration().

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

◆ set_extruder_temp()

WipeTowerWriter & Slic3r::WipeTowerWriter::set_extruder_temp ( int temperature,
bool wait = false )
inline
1249 {
1250 m_gcode += "M" + std::to_string(wait ? 109 : 104) + " S" + std::to_string(temperature) + "\n";
1251 return *this;
1252 }
WipeTowerWriter & wait(float time)
Definition WipeTower.cpp:1255

References WipeTowerWriter(), m_gcode, and wait().

Referenced by Slic3r::WipeTower::toolchange_Unload().

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

◆ set_extruder_trimpot()

WipeTowerWriter & Slic3r::WipeTowerWriter::set_extruder_trimpot ( int current)
inline
1290 {
1291 // BBS: don't control trimpot
1292#if 0
1294 m_gcode += "M906 E";
1295 else
1296 m_gcode += "M907 E";
1297 m_gcode += std::to_string(current) + "\n";
1298#endif
1299 return *this;
1300 }
@ gcfRepRapSprinter
Definition PrintConfig.hpp:57

References WipeTowerWriter(), Slic3r::gcfRepRapFirmware, Slic3r::gcfRepRapSprinter, m_gcode, and m_gcode_flavor.

Referenced by Slic3r::WipeTower::toolchange_Load().

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

◆ set_extrusion_flow()

WipeTowerWriter & Slic3r::WipeTowerWriter::set_extrusion_flow ( float flow)
inline
795 { m_extrusion_flow = flow; return *this; }

References WipeTowerWriter(), and m_extrusion_flow.

Referenced by Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_block_solid(), Slic3r::WipeTower::finish_layer_new(), line(), Slic3r::WipeTower::only_generate_out_wall(), Slic3r::WipeTower::ramming(), rectangle_fill_box(), Slic3r::WipeTower::tool_change(), Slic3r::WipeTower::tool_change_new(), Slic3r::WipeTower::toolchange_Wipe(), and Slic3r::WipeTower::toolchange_wipe_new().

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

◆ set_fan()

WipeTowerWriter & Slic3r::WipeTowerWriter::set_fan ( unsigned speed)
inline
1323 {
1324 if (speed == m_last_fan_speed)
1325 return *this;
1326 if (speed == 0)
1327 m_gcode += "M107\n";
1328 else
1329 m_gcode += "M106 S" + std::to_string(unsigned(255.0 * speed / 100.0)) + "\n";
1330 m_last_fan_speed = speed;
1331 return *this;
1332 }
unsigned m_last_fan_speed
Definition WipeTower.cpp:1582

References WipeTowerWriter(), m_gcode, and m_last_fan_speed.

Here is the call graph for this function:

◆ set_first_layer()

void Slic3r::WipeTowerWriter::set_first_layer ( bool is_first_layer)
inline
1472{ m_is_first_layer = is_first_layer; }
bool m_is_first_layer
Definition WipeTower.cpp:1556

References m_is_first_layer.

Referenced by Slic3r::WipeTower::set_for_wipe_tower_writer().

Here is the caller graph for this function:

◆ set_first_layer_normal_acceleration()

void Slic3r::WipeTowerWriter::set_first_layer_normal_acceleration ( const std::vector< unsigned int > & accelerations)
inline
1474{ m_first_layer_normal_accelerations = accelerations; };
std::vector< unsigned int > m_first_layer_normal_accelerations
Definition WipeTower.cpp:1553

References m_first_layer_normal_accelerations.

Referenced by Slic3r::WipeTower::set_for_wipe_tower_writer().

Here is the caller graph for this function:

◆ set_first_layer_travel_acceleration()

void Slic3r::WipeTowerWriter::set_first_layer_travel_acceleration ( const std::vector< unsigned int > & accelerations)
inline
1476{ m_first_layer_travel_accelerations = accelerations; };
std::vector< unsigned int > m_first_layer_travel_accelerations
Definition WipeTower.cpp:1555

References m_first_layer_travel_accelerations.

Referenced by Slic3r::WipeTower::set_for_wipe_tower_writer().

Here is the caller graph for this function:

◆ set_format_E()

std::string Slic3r::WipeTowerWriter::set_format_E ( float e)
inlineprivate
1607 {
1608 return " E" + Slic3r::float_to_string_decimal_point(e, 4);
1609 }

References Slic3r::float_to_string_decimal_point().

Referenced by extrude_arc_explicit(), extrude_explicit(), and load().

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

◆ set_format_F()

std::string Slic3r::WipeTowerWriter::set_format_F ( float f)
inlineprivate
1611 {
1612 char buf[64];
1613 sprintf(buf, " F%d", int(floor(f + 0.5f)));
1615 return buf;
1616 }

References Slic3r::f(), and m_current_feedrate.

Referenced by extrude_arc_explicit(), extrude_explicit(), feedrate(), load(), and z_hop().

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

◆ set_format_I()

std::string Slic3r::WipeTowerWriter::set_format_I ( float i)
inlineprivate
1617{ return " I" + Slic3r::float_to_string_decimal_point(i, 3); }

References Slic3r::float_to_string_decimal_point().

Referenced by extrude_arc_explicit().

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

◆ set_format_J()

std::string Slic3r::WipeTowerWriter::set_format_J ( float j)
inlineprivate
1618{ return " J" + Slic3r::float_to_string_decimal_point(j, 3); }

References Slic3r::float_to_string_decimal_point().

Referenced by extrude_arc_explicit().

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

◆ set_format_X()

std::string Slic3r::WipeTowerWriter::set_format_X ( float x)
inlineprivate
1593 {
1594 m_current_pos.x() = x;
1595 return " X" + Slic3r::float_to_string_decimal_point(x, 3);
1596 }

References Slic3r::float_to_string_decimal_point(), m_current_pos, and x().

Referenced by extrude_arc_explicit(), and extrude_explicit().

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

◆ set_format_Y()

std::string Slic3r::WipeTowerWriter::set_format_Y ( float y)
inlineprivate
1598 {
1599 m_current_pos.y() = y;
1600 return " Y" + Slic3r::float_to_string_decimal_point(y, 3);
1601 }

References Slic3r::float_to_string_decimal_point(), m_current_pos, and y().

Referenced by extrude_arc_explicit(), and extrude_explicit().

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

◆ set_format_Z()

std::string Slic3r::WipeTowerWriter::set_format_Z ( float z)
inlineprivate
1603 {
1604 return " Z" + Slic3r::float_to_string_decimal_point(z, 3);
1605 }

References Slic3r::float_to_string_decimal_point().

Referenced by z_hop().

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

◆ set_initial_position()

WipeTowerWriter & Slic3r::WipeTowerWriter::set_initial_position ( const Vec2f & pos,
float width = 0.f,
float depth = 0.f,
float internal_angle = 0.f )
inline
780 {
782 m_wipe_tower_depth = depth;
783 m_internal_angle = internal_angle;
784 m_start_pos = this->rotate(pos);
786 return *this;
787 }
Vec2f m_start_pos
Definition WipeTower.cpp:1566

References WipeTowerWriter(), m_current_pos, m_internal_angle, m_start_pos, m_wipe_tower_depth, m_wipe_tower_width, pos(), and rotate().

Referenced by Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_block_solid(), Slic3r::WipeTower::finish_layer_new(), Slic3r::WipeTower::only_generate_out_wall(), Slic3r::WipeTower::ramming(), Slic3r::WipeTower::tool_change(), and Slic3r::WipeTower::tool_change_new().

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

◆ set_initial_tool()

WipeTowerWriter & Slic3r::WipeTowerWriter::set_initial_tool ( size_t tool)
inline
789{ m_current_tool = tool; return *this; }

References WipeTowerWriter(), and m_current_tool.

Referenced by Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_block_solid(), Slic3r::WipeTower::finish_layer_new(), Slic3r::WipeTower::only_generate_out_wall(), Slic3r::WipeTower::ramming(), Slic3r::WipeTower::tool_change(), and Slic3r::WipeTower::tool_change_new().

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

◆ set_layer_id()

void Slic3r::WipeTowerWriter::set_layer_id ( int layer_id)
inline
1480{ m_layer_id = layer_id; }
int m_layer_id
Definition WipeTower.cpp:1562

References m_layer_id.

Referenced by Slic3r::WipeTower::set_for_wipe_tower_writer().

Here is the caller graph for this function:

◆ set_max_acceleration()

void Slic3r::WipeTowerWriter::set_max_acceleration ( unsigned int acceleration)
inline
1477{ m_max_acceleration = acceleration; };

References m_max_acceleration.

Referenced by Slic3r::WipeTower::set_for_wipe_tower_writer().

Here is the caller graph for this function:

◆ set_multi_nozzle_group_result()

void Slic3r::WipeTowerWriter::set_multi_nozzle_group_result ( const MultiNozzleUtils::LayeredNozzleGroupResult * multi_nozzle_group_result)
inline
1481{ m_multi_nozzle_group_result = multi_nozzle_group_result; }
const MultiNozzleUtils::LayeredNozzleGroupResult * m_multi_nozzle_group_result
Definition WipeTower.cpp:1561

References m_multi_nozzle_group_result.

Referenced by Slic3r::WipeTower::set_for_wipe_tower_writer().

Here is the caller graph for this function:

◆ set_normal_acceleration() [1/2]

std::string Slic3r::WipeTowerWriter::set_normal_acceleration ( )
inlineprivate
1489 {
1490 std::vector<unsigned int> accelerations = m_is_first_layer ? m_first_layer_normal_accelerations : m_normal_accelerations;
1491 if (accelerations.empty() || !m_multi_nozzle_group_result)
1492 return std::string();
1493 int extruder_id = m_multi_nozzle_group_result->get_extruder_id(m_current_tool, m_layer_id);
1494 // Orca: get_extruder_id returns -1 when the filament is not covered by the map
1495 // (reachable with a stale manual filament map); skip instead of indexing out of bounds.
1496 if (extruder_id < 0 || extruder_id >= (int) accelerations.size())
1497 return std::string();
1498 unsigned int acc = accelerations[extruder_id];
1499 return set_acceleration_impl(acc);
1500 }
std::vector< unsigned int > m_normal_accelerations
Definition WipeTower.cpp:1552
std::string set_acceleration_impl(unsigned int acceleration)
Definition WipeTower.cpp:1514

References m_current_tool, m_first_layer_normal_accelerations, m_is_first_layer, m_layer_id, m_multi_nozzle_group_result, m_normal_accelerations, and set_acceleration_impl().

Referenced by extrude_arc_explicit(), and extrude_explicit().

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

◆ set_normal_acceleration() [2/2]

void Slic3r::WipeTowerWriter::set_normal_acceleration ( const std::vector< unsigned int > & accelerations)
inline
1473{ m_normal_accelerations = accelerations; };

References m_normal_accelerations.

Referenced by Slic3r::WipeTower::set_for_wipe_tower_writer().

Here is the caller graph for this function:

◆ set_physical_extruder_map()

void Slic3r::WipeTowerWriter::set_physical_extruder_map ( const std::vector< int > & physical_extruder_map)
inline
zaa_minimize_perimeter_height physical_extruder_map((ConfigOptionIntsNullable, nozzle_flush_dataset))((ConfigOptionFloatsNullable

References m_physical_extruder_map, and Slic3r::physical_extruder_map().

Referenced by Slic3r::WipeTower::set_for_wipe_tower_writer().

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

◆ set_tool()

WipeTowerWriter & Slic3r::WipeTowerWriter::set_tool ( size_t tool)
inline
1242 {
1243 m_current_tool = tool;
1244 return *this;
1245 }

References WipeTowerWriter(), and m_current_tool.

Referenced by Slic3r::WipeTower::toolchange_Change().

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

◆ set_travel_acceleration() [1/2]

std::string Slic3r::WipeTowerWriter::set_travel_acceleration ( )
inlineprivate
1502 {
1503 std::vector<unsigned int> accelerations = m_is_first_layer ? m_first_layer_travel_accelerations : m_travel_accelerations;
1504 if (accelerations.empty() || !m_multi_nozzle_group_result)
1505 return std::string();
1506 int extruder_id = m_multi_nozzle_group_result->get_extruder_id(m_current_tool, m_layer_id);
1507 // Orca: get_extruder_id returns -1 when the filament is not covered by the map
1508 // (reachable with a stale manual filament map); skip instead of indexing out of bounds.
1509 if (extruder_id < 0 || extruder_id >= (int) accelerations.size())
1510 return std::string();
1511 unsigned int acc = accelerations[extruder_id];
1512 return set_acceleration_impl(acc);
1513 }
std::vector< unsigned int > m_travel_accelerations
Definition WipeTower.cpp:1554

References m_current_tool, m_first_layer_travel_accelerations, m_is_first_layer, m_layer_id, m_multi_nozzle_group_result, m_travel_accelerations, and set_acceleration_impl().

Referenced by extrude_arc_explicit(), and extrude_explicit().

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

◆ set_travel_acceleration() [2/2]

void Slic3r::WipeTowerWriter::set_travel_acceleration ( const std::vector< unsigned int > & accelerations)
inline
1475{ m_travel_accelerations = accelerations; };

References m_travel_accelerations.

Referenced by Slic3r::WipeTower::set_for_wipe_tower_writer().

Here is the caller graph for this function:

◆ set_y_shift()

WipeTowerWriter & Slic3r::WipeTowerWriter::set_y_shift ( float shift)
inline
797 {
798 m_current_pos.y() -= shift-m_y_shift;
799 m_y_shift = shift;
800 return (*this);
801 }

References WipeTowerWriter(), m_current_pos, and m_y_shift.

Referenced by Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_block_solid(), Slic3r::WipeTower::finish_layer_new(), Slic3r::WipeTower::only_generate_out_wall(), Slic3r::WipeTower::ramming(), Slic3r::WipeTower::tool_change(), and Slic3r::WipeTower::tool_change_new().

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

◆ set_z()

WipeTowerWriter & Slic3r::WipeTowerWriter::set_z ( float z)
inline
792 { m_current_z = z; return *this; }

References WipeTowerWriter(), and m_current_z.

Referenced by Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_block_solid(), Slic3r::WipeTower::finish_layer_new(), Slic3r::WipeTower::only_generate_out_wall(), Slic3r::WipeTower::ramming(), Slic3r::WipeTower::tool_change(), and Slic3r::WipeTower::tool_change_new().

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

◆ speed_override()

WipeTowerWriter & Slic3r::WipeTowerWriter::speed_override ( int speed)
inline
1265 {
1266 m_gcode += "M220 S" + std::to_string(speed) + "\n";
1267 return *this;
1268 }

References WipeTowerWriter(), and m_gcode.

Referenced by Slic3r::WipeTower::tool_change(), and Slic3r::WipeTower::tool_change_new().

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

◆ speed_override_backup()

WipeTowerWriter & Slic3r::WipeTowerWriter::speed_override_backup ( )
inline
1272 {
1273 // BBS: BBL machine don't support speed backup
1275 m_gcode += "M220 B\n";
1276 return *this;
1277 }
@ gcfMarlinLegacy
Definition PrintConfig.hpp:52

References WipeTowerWriter(), Slic3r::gcfMarlinFirmware, Slic3r::gcfMarlinLegacy, m_gcode, and m_gcode_flavor.

Referenced by Slic3r::WipeTower::tool_change(), and Slic3r::WipeTower::tool_change_new().

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

◆ speed_override_restore()

WipeTowerWriter & Slic3r::WipeTowerWriter::speed_override_restore ( )
inline
1281 {
1282 // BBS: BBL machine don't support speed restore
1284 m_gcode += "M220 R\n";
1285 return *this;
1286 }

References WipeTowerWriter(), Slic3r::gcfMarlinFirmware, Slic3r::gcfMarlinLegacy, m_gcode, and m_gcode_flavor.

Referenced by Slic3r::WipeTower::tool_change(), and Slic3r::WipeTower::tool_change_new().

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

◆ spiral_flat_ironing()

void Slic3r::WipeTowerWriter::spiral_flat_ironing ( const Vec2f & center,
float area,
float step_length,
float feedrate )
inline
1426 {
1427 float edge_length = std::sqrt(area);
1428 Vec2f box_max = center + Vec2f{step_length, step_length};
1429 Vec2f box_min = center - Vec2f{step_length, step_length};
1430 int n = std::ceil(edge_length / step_length / 2.f);
1431 if (n <= 0) return;
1432 while (n--) {
1433 travel(box_max.x(), m_current_pos.y(), feedrate);
1434 travel(m_current_pos.x(), box_max.y(), feedrate);
1435 travel(box_min.x(), m_current_pos.y(), feedrate);
1436 travel(m_current_pos.x(), box_min.y(), feedrate);
1437
1438 box_max += Vec2f{step_length, step_length};
1439 box_min -= Vec2f{step_length, step_length};
1440 }
1441 }
static double edge_length(const VD::edge_type &edge)
Definition MultiMaterialSegmentation.cpp:1115
void center(ExPolygonsWithIds &e)
Definition Emboss.cpp:1382
double area(const ExPolygon &poly)
Definition ExPolygon.hpp:511

References Slic3r::area(), Slic3r::center(), Slic3r::edge_length(), feedrate(), m_current_pos, and travel().

Referenced by Slic3r::WipeTower::toolchange_wipe_new().

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

◆ start_pos_rotated()

const Vec2f Slic3r::WipeTowerWriter::start_pos_rotated ( ) const
inline
839{ return m_start_pos; }

References m_start_pos.

Referenced by Slic3r::WipeTower::construct_block_tcr(), Slic3r::WipeTower::construct_tcr(), and Slic3r::WipeTower::ramming().

Here is the caller graph for this function:

◆ suppress_preview()

WipeTowerWriter & Slic3r::WipeTowerWriter::suppress_preview ( )
inline
821{ m_preview_suppressed = true; return *this; }

References WipeTowerWriter(), and m_preview_suppressed.

Referenced by Slic3r::WipeTower::toolchange_Load(), and Slic3r::WipeTower::toolchange_Unload().

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

◆ travel() [1/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::travel ( const Vec2f & dest,
float f = 0.f )
inline
1000 { return extrude_explicit(dest.x(), dest.y(), 0.f, f); }

References WipeTowerWriter(), extrude_explicit(), and Slic3r::f().

Here is the call graph for this function:

◆ travel() [2/2]

WipeTowerWriter & Slic3r::WipeTowerWriter::travel ( float x,
float y,
float f = 0.f )
inline
997 { return extrude_explicit(x, y, 0.f, f); }

References WipeTowerWriter(), extrude_explicit(), Slic3r::f(), x(), and y().

Referenced by Slic3r::WipeTower::finish_block(), Slic3r::WipeTower::finish_layer_new(), generate_path(), Slic3r::WipeTower::generate_support_wall(), line(), polygon(), Slic3r::WipeTower::ramming(), rectangle(), rectangle_fill_box(), spiral_flat_ironing(), Slic3r::WipeTower::tool_change(), Slic3r::WipeTower::tool_change_new(), Slic3r::WipeTower::toolchange_Load(), Slic3r::WipeTower::toolchange_Unload(), Slic3r::WipeTower::toolchange_Wipe(), and Slic3r::WipeTower::toolchange_wipe_new().

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

◆ wait()

WipeTowerWriter & Slic3r::WipeTowerWriter::wait ( float time)
inline
1256 {
1257 if (time==0.f)
1258 return *this;
1260 return *this;
1261 }
std::string wait_command(GCodeFlavor flavor, float seconds)
Definition WipeTower.cpp:724

References WipeTowerWriter(), m_gcode, m_gcode_flavor, and Slic3r::wait_command().

Referenced by set_extruder_temp(), and Slic3r::WipeTower::toolchange_Unload().

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

◆ wipe_path()

const std::vector< Vec2f > & Slic3r::WipeTowerWriter::wipe_path ( ) const
inline
1337 {
1338 return m_wipe_path;
1339 }

References m_wipe_path.

Referenced by add_wipe_path(), Slic3r::WipeTower::construct_block_tcr(), and Slic3r::WipeTower::construct_tcr().

Here is the caller graph for this function:

◆ x()

◆ y()

◆ z_hop()

WipeTowerWriter & Slic3r::WipeTowerWriter::z_hop ( float hop,
float f = 0.f )
inline
1210 {
1211 m_gcode += std::string("G1") + set_format_Z(m_current_z + hop);
1212 if (f != 0 && f != m_current_feedrate)
1214 m_gcode += "\n";
1215 return *this;
1216 }
std::string set_format_Z(float z)
Definition WipeTower.cpp:1603

References WipeTowerWriter(), Slic3r::f(), m_current_feedrate, m_current_z, m_gcode, set_format_F(), and set_format_Z().

Referenced by z_hop_reset().

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

◆ z_hop_reset()

WipeTowerWriter & Slic3r::WipeTowerWriter::z_hop_reset ( float f = 0.f)
inline
1220 { return z_hop(0, f); }
WipeTowerWriter & z_hop(float hop, float f=0.f)
Definition WipeTower.cpp:1209

References WipeTowerWriter(), Slic3r::f(), and z_hop().

Here is the call graph for this function:

Member Data Documentation

◆ current_temp

int Slic3r::WipeTowerWriter::current_temp = -1
private

◆ m_accel_to_decel_enable

bool Slic3r::WipeTowerWriter::m_accel_to_decel_enable
private

◆ m_accel_to_decel_factor

float Slic3r::WipeTowerWriter::m_accel_to_decel_factor
private

◆ m_current_feedrate

float Slic3r::WipeTowerWriter::m_current_feedrate
private

◆ m_current_pos

◆ m_current_tool

◆ m_current_z

float Slic3r::WipeTowerWriter::m_current_z
private

Referenced by WipeTowerWriter(), set_z(), and z_hop().

◆ m_elapsed_time

float Slic3r::WipeTowerWriter::m_elapsed_time
private

◆ m_enable_arc_fitting

bool Slic3r::WipeTowerWriter::m_enable_arc_fitting = true
private

◆ m_extrusion_flow

float Slic3r::WipeTowerWriter::m_extrusion_flow
private

◆ m_extrusions

std::vector<WipeTower::Extrusion> Slic3r::WipeTowerWriter::m_extrusions
private

◆ m_filpar

const std::vector<WipeTower::FilamentParameters>& Slic3r::WipeTowerWriter::m_filpar
private

◆ m_first_layer_normal_accelerations

std::vector<unsigned int> Slic3r::WipeTowerWriter::m_first_layer_normal_accelerations
private

◆ m_first_layer_travel_accelerations

std::vector<unsigned int> Slic3r::WipeTowerWriter::m_first_layer_travel_accelerations
private

◆ m_gcode

◆ m_gcode_flavor

◆ m_internal_angle

float Slic3r::WipeTowerWriter::m_internal_angle = 0.f
private

Referenced by rotate(), and set_initial_position().

◆ m_is_first_layer

bool Slic3r::WipeTowerWriter::m_is_first_layer {false}
private

◆ m_last_acceleration

unsigned int Slic3r::WipeTowerWriter::m_last_acceleration {0}
private
1558{0};

Referenced by set_acceleration_impl().

◆ m_last_fan_speed

unsigned Slic3r::WipeTowerWriter::m_last_fan_speed = 0
private

Referenced by set_fan().

◆ m_layer_height

float Slic3r::WipeTowerWriter::m_layer_height
private

◆ m_layer_id

int Slic3r::WipeTowerWriter::m_layer_id = -1
private

◆ m_max_acceleration

unsigned int Slic3r::WipeTowerWriter::m_max_acceleration {0}
private
1557{0};

Referenced by set_acceleration_impl(), and set_max_acceleration().

◆ m_multi_nozzle_group_result

const MultiNozzleUtils::LayeredNozzleGroupResult* Slic3r::WipeTowerWriter::m_multi_nozzle_group_result {nullptr}
private

◆ m_normal_accelerations

std::vector<unsigned int> Slic3r::WipeTowerWriter::m_normal_accelerations
private

◆ m_physical_extruder_map

std::vector<int> Slic3r::WipeTowerWriter::m_physical_extruder_map
private

◆ m_preview_suppressed

bool Slic3r::WipeTowerWriter::m_preview_suppressed
private

◆ m_start_pos

Vec2f Slic3r::WipeTowerWriter::m_start_pos
private

◆ m_travel_accelerations

std::vector<unsigned int> Slic3r::WipeTowerWriter::m_travel_accelerations
private

◆ m_used_filament_length

float Slic3r::WipeTowerWriter::m_used_filament_length = 0.f
private

◆ m_wipe_path

std::vector<Vec2f> Slic3r::WipeTowerWriter::m_wipe_path
private

Referenced by add_wipe_point(), and wipe_path().

◆ m_wipe_tower_depth

float Slic3r::WipeTowerWriter::m_wipe_tower_depth = 0.f
private

Referenced by rotate(), and set_initial_position().

◆ m_wipe_tower_width

float Slic3r::WipeTowerWriter::m_wipe_tower_width = 0.f
private

Referenced by rotate(), and set_initial_position().

◆ m_y_shift

float Slic3r::WipeTowerWriter::m_y_shift = 0.f
private

Referenced by rotate(), and set_y_shift().


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