From b003b9502201b835c9a261ba3b3f2f3671d5a0e7 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 27 Jan 2022 14:36:24 +0200 Subject: [PATCH] - made sure that for the Tcl command `cncjob` when using the `dpp` parameter (multi depth) the value is always positive, as expected - the `cutout` Tcl command creates a non-multigeo Geometry object --- CHANGELOG.md | 5 +++++ appObjects/FlatCAMGeometry.py | 6 +++--- camlib.py | 2 ++ tclCommands/TclCommandCncjob.py | 4 ++-- tclCommands/TclCommandCutout.py | 2 ++ 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8f1bed3..39bcf07e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta ================================================= +27.01.2022 + +- made sure that for the Tcl command `cncjob` when using the `dpp` parameter (multi depth) the value is always positive, as expected +- the `cutout` Tcl command creates a non-multigeo Geometry object + 26.01.2022 - fixed the Cutout plugin not working with Geometry objects that are made out of a LineString or LinearRing geometric elements diff --git a/appObjects/FlatCAMGeometry.py b/appObjects/FlatCAMGeometry.py index 75ee79b8..671b460f 100644 --- a/appObjects/FlatCAMGeometry.py +++ b/appObjects/FlatCAMGeometry.py @@ -991,8 +991,8 @@ class GeometryObject(FlatCAMObj, Geometry): :param spindlespeed: Spindle speed (RPM) :param dwell: :param dwelltime: - :param multidepth: - :param dpp: Depth for each pass when multidepth parameter is True + :param multidepth: Bool: If True use the `dpp` parameter + :param dpp: Depth for each pass when multidepth parameter is True. Positive value. :param toolchange: :param toolchangez: :param toolchangexy: A sequence ox X,Y coordinates: a 2-length tuple or a string. @@ -1011,7 +1011,7 @@ class GeometryObject(FlatCAMObj, Geometry): :return: None """ - self.app.log.debug("FlatCAMGeometry.generatecncjob()") + self.app.log.debug("FlatCAMGeometry.GeometryObject.generatecncjob()") tooldia = dia if dia else float(self.options["tools_mill_tooldia"]) outname = outname if outname is not None else self.options["name"] diff --git a/camlib.py b/camlib.py index 595f3ac5..8bb6c5e2 100644 --- a/camlib.py +++ b/camlib.py @@ -5900,6 +5900,8 @@ class CNCjob(Geometry): return 'fail' self.z_depthpercut = float(depthpercut) if depthpercut is not None and depthpercut != 0 else abs(self.z_cut) + # must be a positive value + self.z_depthpercut = abs(self.z_depthpercut) self.multidepth = multidepth self.z_toolchange = float(toolchangez) if toolchangez is not None else \ self.app.defaults["tools_mill_toolchangez"] diff --git a/tclCommands/TclCommandCncjob.py b/tclCommands/TclCommandCncjob.py index da1ec16a..48a2d1cb 100644 --- a/tclCommands/TclCommandCncjob.py +++ b/tclCommands/TclCommandCncjob.py @@ -63,7 +63,7 @@ class TclCommandCncjob(TclCommandSignaled): ('feedrate_z', 'Moving speed on Z plane when cutting.'), ('feedrate_rapid', 'Rapid moving at speed when cutting.'), ('extracut_length', 'The value for extra cnccut over the first point in path,in the job end; float'), - ('dpp', 'If present then use multidepth cnc cut. Height of one layer for multidepth.'), + ('dpp', 'If present then use multidepth cnc cut. Height of one layer for multidepth. Positive value.'), ('toolchangez', 'Z distance for toolchange (example: 30.0).\n' 'If used in the command then a toolchange event will be included in gcode'), ('toolchangexy', 'The X,Y coordinates at Toolchange event in format (x, y) (example: (30.0, 15.2) or ' @@ -79,7 +79,7 @@ class TclCommandCncjob(TclCommandSignaled): ('pp', 'Name of the Geometry preprocessor. No quotes, case sensitive'), ('muted', 'It will not put errors in the Shell. Can be True (1) or False (0)') ]), - 'examples': ['cncjob geo_name -dia 0.5 -z_cut -1.7 -z_move 2 -feedrate 120 -pp default'] + 'examples': ['cncjob geo_name -dia 0.5 -z_cut -1.8 -dpp 0.6 -z_move 2 -feedrate 120 -pp default'] } def execute(self, args, unnamed_args): diff --git a/tclCommands/TclCommandCutout.py b/tclCommands/TclCommandCutout.py index 2cb961a8..e891e274 100644 --- a/tclCommands/TclCommandCutout.py +++ b/tclCommands/TclCommandCutout.py @@ -106,6 +106,8 @@ class TclCommandCutout(TclCommand): return "Could not retrieve object: %s" % name def geo_init_me(geo_obj, app_obj): + geo_obj.multigeo = False + margin = margin_par + dia_par / 2 gap_size = dia_par + gapsize_par