From 5a912c6885d67af3e85095a6afcff25d08113a0f Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 26 Jan 2022 11:47:07 +0200 Subject: [PATCH] - fixed the Cutout plugin for the rectangular cutout: the name of the resulting object is now correct if there is no extension in the source file --- CHANGELOG.md | 1 + appPlugins/ToolCutOut.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb0d8adc..64fad71f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ CHANGELOG for FlatCAM beta 26.01.2022 - fixed the Cutout plugin not working with Geometry objects that are made out of a LineString or LinearRing geometric elements +- fixed the Cutout plugin for the rectangular cutout: the name of the resulting object is now correct if there is no extension in the source file 25.01.2022 diff --git a/appPlugins/ToolCutOut.py b/appPlugins/ToolCutOut.py index b61062ea..c91f9993 100644 --- a/appPlugins/ToolCutOut.py +++ b/appPlugins/ToolCutOut.py @@ -1079,7 +1079,7 @@ class CutOut(AppTool): has_mouse_bites_val = True if self.ui.gaptype_combo.get_value() == 2 else False # "mouse bytes" formatted_name = cutout_obj.options["name"].rpartition('.')[0] - outname = "%s_cutout" % formatted_name + outname = "%s_cutout" % formatted_name if formatted_name != '' else "%s_cutout" % cutout_obj.options["name"] self.app.collection.promise(outname) outname_exc = cutout_obj.options["name"] + "_mouse_bites" @@ -1109,6 +1109,12 @@ class CutOut(AppTool): # fuse the lines object_geo = unary_union(object_geo) + # if isinstance(object_geo, (MultiPolygon, MultiLineString)): + # x0, y0, x1, y1 = object_geo.bounds + # geo = box(x0, y0, x1, y1) + # if isinstance(object_geo, (LinearRing, LineString)): + # geo = Polygon(object_geo) + xmin, ymin, xmax, ymax = object_geo.bounds geo = box(xmin, ymin, xmax, ymax)