svg crowbar fixes

Thu, 07 Jul 2016 11:58:38 +0200

author
mbayer
date
Thu, 07 Jul 2016 11:58:38 +0200
changeset 27
c82c30811edd
parent 26
5c98c7e24b02
child 28
23efe2c53872

svg crowbar fixes

printrun-src/printrun/laser.py file | annotate | diff | comparison | revisions
--- a/printrun-src/printrun/laser.py	Sat Jun 04 15:18:06 2016 +0200
+++ b/printrun-src/printrun/laser.py	Thu Jul 07 11:58:38 2016 +0200
@@ -312,8 +312,9 @@
             self.log("Unable to get width and height for the svg!")
             return False
 
-        width = float(width.replace("px", "").replace("pt", ""))
-        height = float(height.replace("px", "").replace("pt", ""))
+        # TODO: use cm or mm as absolute dimensions!
+        width = float(width.replace("px", "").replace("pt", "").replace("mm", ""))
+        height = float(height.replace("px", "").replace("pt", "").replace("mm", ""))
         smoothness = self.settings.lc_svg_smoothness
         if smoothness < 0.1: smoothness = 0.1
 
@@ -377,8 +378,9 @@
                                 E = E + (e_distance)
                                 fo.write("G1 X%0.2f Y%0.2f E%.4f F%.4f\n" % (
                                     xs, ys, E * E_FACTOR, engrave_speed))
-                        else:
-                            self.log("Position outside print dimension: %d, %d" % (xs, ys)) 
+                        #else:
+                            # self.log("Position outside print dimension: %d, %d" % (xs, ys)) 
+
                     if shape_obj.xml_node.get('fill'):
                         # Close the polygon
                         e_distance = math.hypot(object_xs - xo, object_ys - yo)

mercurial