diff options
author | bubnikv <bubnikv@gmail.com> | 2017-09-12 19:20:06 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2017-09-12 19:20:06 +0300 |
commit | 6b2b2798890e34eff7ff148c7c38b6b90988472b (patch) | |
tree | 3675ae5d83f498c3f40e867c49932d4d29e63a1a /xs/src/libslic3r/GCodeWriter.cpp | |
parent | 98408bbed013203f459b1843763fe64326bd1ac0 (diff) |
Fix of "exponentional values generated as G1 F-1.95058e+006 causing problems"
https://github.com/prusa3d/Slic3r/issues/463
Diffstat (limited to 'xs/src/libslic3r/GCodeWriter.cpp')
-rw-r--r-- | xs/src/libslic3r/GCodeWriter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xs/src/libslic3r/GCodeWriter.cpp b/xs/src/libslic3r/GCodeWriter.cpp index 40500d084..abf55114b 100644 --- a/xs/src/libslic3r/GCodeWriter.cpp +++ b/xs/src/libslic3r/GCodeWriter.cpp @@ -3,6 +3,7 @@ #include <iomanip> #include <iostream> #include <map> +#include <assert.h> #define FLAVOR_IS(val) this->config.gcode_flavor == val #define FLAVOR_IS_NOT(val) this->config.gcode_flavor != val @@ -259,6 +260,8 @@ std::string GCodeWriter::toolchange(unsigned int extruder_id) std::string GCodeWriter::set_speed(double F, const std::string &comment, const std::string &cooling_marker) const { + assert(F > 0.); + assert(F < 100000.); std::ostringstream gcode; gcode << "G1 F" << F; COMMENT(comment); |