- in Cutout plugin added the ability to create Manual Geometries with negative tool diameters

This commit is contained in:
Marius Stanciu
2022-01-26 12:51:08 +02:00
committed by Marius
parent 5d3fce12d5
commit 7bc941f3dd
2 changed files with 7 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta
- fixed the Cutout plugin not working with Geometry objects that are made out of a LineString or LinearRing geometric elements - 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 - 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
- modified the bounding box utility feature in the Gerber Object UI to work with buffer value of 0.0 and rounded corners - modified the bounding box utility feature in the Gerber Object UI to work with buffer value of 0.0 and rounded corners
- in Cutout plugin added the ability to create Manual Geometries with negative tool diameters
25.01.2022 25.01.2022

View File

@@ -1681,11 +1681,6 @@ class CutOut(AppTool):
return return
dia = float(self.ui.dia.get_value()) dia = float(self.ui.dia.get_value())
if 0 in {dia}:
self.app.inform.emit('[ERROR_NOTCL] %s' %
_("Tool Diameter is zero value. Change it to a positive real number."))
return
try: try:
kind = self.ui.obj_kind_combo.get_value() kind = self.ui.obj_kind_combo.get_value()
except ValueError: except ValueError:
@@ -1706,7 +1701,11 @@ class CutOut(AppTool):
(isinstance(geo_union, list) and len(geo_union) == 1) or \ (isinstance(geo_union, list) and len(geo_union) == 1) or \
(isinstance(geo_union, MultiPolygon) and len(geo_union.geoms) == 1): (isinstance(geo_union, MultiPolygon) and len(geo_union.geoms) == 1):
buff_geo = geo_union.buffer(margin + abs(dia / 2)).exterior if dia >= 0:
buff_geo = geo_union.buffer(margin + abs(dia / 2)).exterior
else:
buff_geo = geo_union.buffer(margin + abs(dia / 2)).interiors
buff_geo = unary_union(buff_geo)
if shape_type is False: if shape_type is False:
geo_obj.solid_geometry = buff_geo geo_obj.solid_geometry = buff_geo
else: else:
@@ -2345,7 +2344,7 @@ class CutoutUI:
# Tool Diameter # Tool Diameter
self.dia = FCDoubleSpinner(callback=self.confirmation_message) self.dia = FCDoubleSpinner(callback=self.confirmation_message)
self.dia.set_precision(self.decimals) self.dia.set_precision(self.decimals)
self.dia.set_range(0.0000, 10000.0000) self.dia.set_range(-10000.0000, 10000.0000)
self.dia_label = FCLabel('%s:' % _("Tool Dia")) self.dia_label = FCLabel('%s:' % _("Tool Dia"))
self.dia_label.setToolTip( self.dia_label.setToolTip(