瀏覽代碼

- fixed Tcl Command AddPolygon, AddPolyline

Marius Stanciu 6 年之前
父節點
當前提交
65ab17e308
共有 3 個文件被更改,包括 5 次插入2 次删除
  1. 1 0
      README.md
  2. 2 1
      tclCommands/TclCommandAddPolygon.py
  3. 2 1
      tclCommands/TclCommandAddPolyline.py

+ 1 - 0
README.md

@@ -17,6 +17,7 @@ CAD program, and create G-Code for Isolation routing.
 - added new capability in NCC Tool when the reference object is of Gerber type and fixed some newly introduced errors
 - fixed issue #298. The changes in postprocessors done in Preferences dis not update the object UI layout as it was supposed to. The selection of Marlin postproc. did not unhidden the Feedrate Rapids entry.
 - fixed minor issues
+- fixed Tcl Command AddPolygon, AddPolyline
 
 24.08.2019
 

+ 2 - 1
tclCommands/TclCommandAddPolygon.py

@@ -55,7 +55,8 @@ class TclCommandAddPolygon(TclCommandSignaled):
         if len(unnamed_args) % 2 != 0:
             self.raise_tcl_error("Incomplete coordinates.")
 
-        points = [[float(unnamed_args[2*i]), float(unnamed_args[2*i+1])] for i in range(len(unnamed_args)/2)]
+        nr_points = int(len(unnamed_args) / 2)
+        points = [[float(unnamed_args[2*i]), float(unnamed_args[2*i+1])] for i in range(nr_points)]
 
         obj.add_polygon(points)
         obj.plot()

+ 2 - 1
tclCommands/TclCommandAddPolyline.py

@@ -55,7 +55,8 @@ class TclCommandAddPolyline(TclCommandSignaled):
         if len(unnamed_args) % 2 != 0:
             self.raise_tcl_error("Incomplete coordinates.")
 
-        points = [[float(unnamed_args[2*i]), float(unnamed_args[2*i+1])] for i in range(len(unnamed_args)/2)]
+        nr_points = int(len(unnamed_args) / 2)
+        points = [[float(unnamed_args[2*i]), float(unnamed_args[2*i+1])] for i in range(nr_points)]
 
         obj.add_polyline(points)
         obj.plot()