- in Tool Cutout fixed issues when using a negative value for the Margin parameter when the cutout object is a Gerber object

This commit is contained in:
Marius Stanciu
2020-11-19 22:53:25 +02:00
committed by Marius
parent 3d869279dc
commit fb5fdff1cd
2 changed files with 9 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ CHANGELOG for FlatCAM beta
- cleaned up the Geometry Properties UI
- in Geometry Properties UI restored the plot functionality
- in Tool Cutout fixed issues when using a negative value for the Margin parameter when the cutout object is a Gerber object
17.11.2020

View File

@@ -798,9 +798,10 @@ class CutOut(AppTool):
object_geo = box(x0, y0, x1, y1)
if margin >= 0:
geo_buf = object_geo.buffer(margin + abs(dia / 2))
geo = geo_buf.exterior
else:
geo_buf = object_geo.buffer(margin - abs(dia / 2))
geo = geo_buf.exterior
geo_buf = object_geo.buffer(- margin + abs(dia / 2))
geo = unary_union(geo_buf.interiors)
else:
if isinstance(object_geo, MultiPolygon):
x0, y0, x1, y1 = object_geo.bounds
@@ -808,6 +809,11 @@ class CutOut(AppTool):
geo_buf = object_geo.buffer(0)
geo = geo_buf.exterior
print(geo)
if geo.is_empty:
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Failed."))
return 'fail'
solid_geo, rest_geo = cutout_handler(geom=geo, gapsize=gapsize)
if gap_type == 'bt' and thin_entry != 0:
gaps_solid_geo = rest_geo