From 7f0a1695ef8bf234d875e461a8467050c0575c1c Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Fri, 17 May 2019 20:11:01 +0300 Subject: [PATCH] - fixed an issue in the remade Cutout Tool where when applied on a single Gerber object, the Freeform Cutout produced no cutout Geometry object --- README.md | 1 + flatcamTools/ToolCutOut.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fad0dbe8..17a63774 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing. - remade the Tool Cutout to work on panels - remade the Tool Cutour such that on multiple applications on the same object it will yield the same result +- fixed an issue in the remade Cutout Tool where when applied on a single Gerber object, the Freeform Cutout produced no cutout Geometry object 16.05.2019 diff --git a/flatcamTools/ToolCutOut.py b/flatcamTools/ToolCutOut.py index 571c349d..19f5df24 100644 --- a/flatcamTools/ToolCutOut.py +++ b/flatcamTools/ToolCutOut.py @@ -562,8 +562,15 @@ class CutOut(FlatCAMTool): def geo_init(geo_obj, app_obj): solid_geo = [] + object_geo = cutout_obj.solid_geometry + + try: + _ = iter(object_geo) + except TypeError: + object_geo = [object_geo] + + for poly in object_geo: - for poly in cutout_obj.solid_geometry: xmin, ymin, xmax, ymax = poly.bounds geo = box(xmin, ymin, xmax, ymax)