From 258bd529d24006e4a5846633229be0b7bb879fde Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 30 Dec 2019 23:33:22 +0200 Subject: [PATCH] - some fixes in the NCC Tcl command (using the bool() method on some params) --- README.md | 1 + tclCommands/TclCommandCopperClear.py | 13 +++++++------ tclCommands/TclCommandIsolate.py | 4 +++- tclCommands/TclCommandPaint.py | 3 ++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6dfffef9..01c68b91 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ CAD program, and create G-Code for Isolation routing. - fixed Tcl commands that use the overlap parameter to switch from fraction to percentage - in Transform Tool mae sure that the buffer sub-tool parameters are better explained in tooltips - attempt to make TclCommand quit_flatcam work under Linux +- some fixes in the NCC Tcl command (using the bool() method on some params) 29.12.2019 diff --git a/tclCommands/TclCommandCopperClear.py b/tclCommands/TclCommandCopperClear.py index ed2e88d4..d7f8e612 100644 --- a/tclCommands/TclCommandCopperClear.py +++ b/tclCommands/TclCommandCopperClear.py @@ -55,7 +55,8 @@ class TclCommandCopperClear(TclCommand): ('name', 'Name of the source Geometry object. String.'), ('tooldia', 'Diameter of the tool to be used. Can be a comma separated list of diameters. No space is ' 'allowed between tool diameters. E.g: correct: 0.5,1 / incorrect: 0.5, 1'), - ('overlap', 'Percentage of the tool diameter to overlap cuts. Float number, [0%, 99.9999%]'), + ('overlap', 'Percentage of tool diameter to overlap current pass over previous pass. Float [0, 99.9999]\n' + 'E.g: for a 25% from tool diameter overlap use -overlap 25'), ('margin', 'Bounding box margin. Float number.'), ('order', 'Can have the values: "no", "fwd" and "rev". String.' 'It is useful when there are multiple tools in tooldia parameter.' @@ -68,13 +69,13 @@ class TclCommandCopperClear(TclCommand): ('rest', 'Use rest-machining. True or False'), ('has_offset', 'The offset will used only if this is set True or present in args. True or False.'), ('offset', 'The copper clearing will finish to a distance from copper features. Float number.'), - ('all', 'Will copper clear the whole object. 1 = enabled, anything else = disabled'), + ('all', 'Will copper clear the whole object. 1 or True = enabled, anything else = disabled'), ('ref', 'Will clear of extra copper all polygons within a specified object with the name in "box" ' - 'parameter. 1 = enabled, anything else = disabled'), + 'parameter. 1 or True = enabled, anything else = disabled'), ('box', 'Name of the object to be used as reference. Required when selecting "ref" = 1. String.'), ('outname', 'Name of the resulting Geometry object. String.'), ]), - 'examples': [] + 'examples': ["ncc obj_name -tooldia 0.3,1 -overlap 10 -margin 1.0 -method 'lines' -all True"] } def execute(self, args, unnamed_args): @@ -217,7 +218,7 @@ class TclCommandCopperClear(TclCommand): outname = name + "_ncc_rm" # Non-Copper clear all polygons in the non-copper clear object - if 'all' in args and args['all'] == 1: + if 'all' in args and bool(args['all']): self.app.ncclear_tool.clear_copper(ncc_obj=obj, select_method='itself', ncctooldia=tooldia, @@ -237,7 +238,7 @@ class TclCommandCopperClear(TclCommand): return # Non-Copper clear all polygons found within the box object from the the non_copper cleared object - elif 'ref' in args and args['ref'] == 1: + elif 'ref' in args and bool(args['ref']): if 'box' not in args: self.raise_tcl_error('%s' % _("Expected -box .")) else: diff --git a/tclCommands/TclCommandIsolate.py b/tclCommands/TclCommandIsolate.py index 6816b3e4..f2864303 100644 --- a/tclCommands/TclCommandIsolate.py +++ b/tclCommands/TclCommandIsolate.py @@ -3,6 +3,7 @@ from FlatCAMObj import FlatCAMGerber import collections + class TclCommandIsolate(TclCommandSignaled): """ Tcl shell command to Creates isolation routing geometry for the given Gerber. @@ -45,7 +46,8 @@ class TclCommandIsolate(TclCommandSignaled): ('name', 'Name of the source object.'), ('dia', 'Tool diameter.'), ('passes', 'Passes of tool width.'), - ('overlap', 'Percentage of tool diameter to overlap passes. [0%, 99.9999%'), + ('overlap', 'Percentage of tool diameter to overlap current pass over previous pass. Float [0, 99.9999]\n' + 'E.g: for a 25% from tool diameter overlap use -overlap 25'), ('combine', 'Combine all passes into one geometry.'), ('outname', 'Name of the resulting Geometry object.'), ('follow', 'Create a Geometry that follows the Gerber path.'), diff --git a/tclCommands/TclCommandPaint.py b/tclCommands/TclCommandPaint.py index 6305696d..2594904a 100644 --- a/tclCommands/TclCommandPaint.py +++ b/tclCommands/TclCommandPaint.py @@ -56,7 +56,8 @@ class TclCommandPaint(TclCommand): ('name', 'Name of the source Geometry object. String.'), ('tooldia', 'Diameter of the tool to be used. Can be a comma separated list of diameters. No space is ' 'allowed between tool diameters. E.g: correct: 0.5,1 / incorrect: 0.5, 1'), - ('overlap', 'Percentage of the tool diameter to overlap cuts. Float number, [0%, 99.9999%]'), + ('overlap', 'Percentage of tool diameter to overlap current pass over previous pass. Float [0, 99.9999]\n' + 'E.g: for a 25% from tool diameter overlap use -overlap 25'), ('margin', 'Bounding box margin. Float number.'), ('order', 'Can have the values: "no", "fwd" and "rev". String.' 'It is useful when there are multiple tools in tooldia parameter.'