Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cooling not working if !gcode_comments #3326

Merged
merged 1 commit into from
May 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions xs/src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Wipe::wipe(GCode &gcodegen, bool toolchange)
/* Reduce retraction length a bit to avoid effective retraction speed to be greater than the configured one
due to rounding (TODO: test and/or better math for this) */
double dE = length * (segment_length / wipe_dist) * 0.95;
gcode += gcodegen.writer.set_speed(wipe_speed*60, gcodegen.enable_cooling_markers ? ";_WIPE" : "");
gcode += gcodegen.writer.set_speed(wipe_speed*60, "", gcodegen.enable_cooling_markers ? ";_WIPE" : "");
gcode += gcodegen.writer.extrude_to_xy(
gcodegen.point_to_gcode(line->b),
-dE,
Expand Down Expand Up @@ -562,7 +562,7 @@ GCode::_extrude(ExtrusionPath path, std::string description, double speed)
// extrude arc or line
if (path.is_bridge() && this->enable_cooling_markers)
gcode += ";_BRIDGE_FAN_START\n";
gcode += this->writer.set_speed(F, this->enable_cooling_markers ? ";_EXTRUDE_SET_SPEED" : "");
gcode += this->writer.set_speed(F, "", this->enable_cooling_markers ? ";_EXTRUDE_SET_SPEED" : "");
double path_length = 0;
{
std::string comment = this->config.gcode_comments ? description : "";
Expand Down
4 changes: 3 additions & 1 deletion xs/src/libslic3r/GCodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,13 @@ GCodeWriter::toolchange(unsigned int extruder_id)
}

std::string
GCodeWriter::set_speed(double F, const std::string &comment) const
GCodeWriter::set_speed(double F, const std::string &comment,
const std::string &cooling_marker) const
{
std::ostringstream gcode;
gcode << "G1 F" << F;
COMMENT(comment);
gcode << cooling_marker;
gcode << "\n";
return gcode.str();
}
Expand Down
2 changes: 1 addition & 1 deletion xs/src/libslic3r/GCodeWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class GCodeWriter {
bool need_toolchange(unsigned int extruder_id) const;
std::string set_extruder(unsigned int extruder_id);
std::string toolchange(unsigned int extruder_id);
std::string set_speed(double F, const std::string &comment = std::string()) const;
std::string set_speed(double F, const std::string &comment = std::string(), const std::string &cooling_marker = std::string()) const;
std::string travel_to_xy(const Pointf &point, const std::string &comment = std::string());
std::string travel_to_xyz(const Pointf3 &point, const std::string &comment = std::string());
std::string travel_to_z(double z, const std::string &comment = std::string());
Expand Down