From 65ab17e3083047b2b57d3daf3b5a5a00d6320206 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 25 Aug 2019 21:33:46 +0300 Subject: [PATCH] - fixed Tcl Command AddPolygon, AddPolyline --- README.md | 1 + tclCommands/TclCommandAddPolygon.py | 3 ++- tclCommands/TclCommandAddPolyline.py | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4d5b0587..9ff67d64 100644 --- a/README.md +++ b/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 diff --git a/tclCommands/TclCommandAddPolygon.py b/tclCommands/TclCommandAddPolygon.py index 3947f3f0..5ea73034 100644 --- a/tclCommands/TclCommandAddPolygon.py +++ b/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() diff --git a/tclCommands/TclCommandAddPolyline.py b/tclCommands/TclCommandAddPolyline.py index 18e58096..be897181 100644 --- a/tclCommands/TclCommandAddPolyline.py +++ b/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()