- 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:
@@ -11,6 +11,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
- cleaned up the Geometry Properties UI
|
- cleaned up the Geometry Properties UI
|
||||||
- in Geometry Properties UI restored the plot functionality
|
- 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
|
17.11.2020
|
||||||
|
|
||||||
|
|||||||
@@ -798,9 +798,10 @@ class CutOut(AppTool):
|
|||||||
object_geo = box(x0, y0, x1, y1)
|
object_geo = box(x0, y0, x1, y1)
|
||||||
if margin >= 0:
|
if margin >= 0:
|
||||||
geo_buf = object_geo.buffer(margin + abs(dia / 2))
|
geo_buf = object_geo.buffer(margin + abs(dia / 2))
|
||||||
|
geo = geo_buf.exterior
|
||||||
else:
|
else:
|
||||||
geo_buf = object_geo.buffer(margin - abs(dia / 2))
|
geo_buf = object_geo.buffer(- margin + abs(dia / 2))
|
||||||
geo = geo_buf.exterior
|
geo = unary_union(geo_buf.interiors)
|
||||||
else:
|
else:
|
||||||
if isinstance(object_geo, MultiPolygon):
|
if isinstance(object_geo, MultiPolygon):
|
||||||
x0, y0, x1, y1 = object_geo.bounds
|
x0, y0, x1, y1 = object_geo.bounds
|
||||||
@@ -808,6 +809,11 @@ class CutOut(AppTool):
|
|||||||
geo_buf = object_geo.buffer(0)
|
geo_buf = object_geo.buffer(0)
|
||||||
geo = geo_buf.exterior
|
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)
|
solid_geo, rest_geo = cutout_handler(geom=geo, gapsize=gapsize)
|
||||||
if gap_type == 'bt' and thin_entry != 0:
|
if gap_type == 'bt' and thin_entry != 0:
|
||||||
gaps_solid_geo = rest_geo
|
gaps_solid_geo = rest_geo
|
||||||
|
|||||||
Reference in New Issue
Block a user