diff --git a/backend/filereaders/svg_path_reader.py b/backend/filereaders/svg_path_reader.py index 3342d18c..c68d6ce6 100644 --- a/backend/filereaders/svg_path_reader.py +++ b/backend/filereaders/svg_path_reader.py @@ -310,6 +310,13 @@ def addCubicBezier(self, subpath, x1, y1, x2, y2, x3, y3, x4, y4, level): # protect from deep recursion cases # max 2**18 = 262144 segments return + elif level == 0: + if (x1 == x2 and y1 == y2 and x2 == x3 and y2 == y3) or \ + (x2 == x3 and y2 == y3 and x3 == x4 and y3 == y4): + # the tolerance would never reached, but it's a straight line + #subpath.append([x1, y1]) # probably not needed + subpath.append([x4, y4]) + return # Calculate all the mid-points of the line segments x12 = (x1 + x2) / 2.0 diff --git a/frontend/app.html b/frontend/app.html index 0a275e2e..eccf3be0 100644 --- a/frontend/app.html +++ b/frontend/app.html @@ -13,7 +13,6 @@ - diff --git a/frontend/js/app.js b/frontend/js/app.js index 72e35b60..48287810 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -419,7 +419,7 @@ $(document).ready(function(){ // $().uxmessage('notice', gcode.replace(/\n/g, '
')); send_gcode(gcode, "Stopping ...", false); var delayedresume = setTimeout(function() { - var gcode = '~\nG90\nM81\nG0X0Y0F'+app_settings.max_seek_speed+'\n' // ~ is resume char + var gcode = '~\nG90\nG0X0Y0F'+app_settings.max_seek_speed+'\nM81\n' // ~ is resume char // $().uxmessage('notice', gcode.replace(/\n/g, '
')); send_gcode(gcode, "Resetting ...", false); }, 1000); diff --git a/frontend/js/app_datahandler.js b/frontend/js/app_datahandler.js index a5145443..d6f40519 100644 --- a/frontend/js/app_datahandler.js +++ b/frontend/js/app_datahandler.js @@ -130,7 +130,7 @@ DataHandler = { } } // footer - glist.push("M81\nS0\nG0X0Y0F"+app_settings.max_seek_speed+"\n"); + glist.push("S0\nG0X0Y0F"+app_settings.max_seek_speed+"\nM81\n"); // alert(JSON.stringify(glist.join(''))) return glist.join(''); },