- updated Copper Thieving Tool to work with the updated program
This commit is contained in:
@@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
23.10.2020
|
||||||
|
|
||||||
|
- updated Copper Thieving Tool to work with the updated program
|
||||||
|
|
||||||
22.10.2020
|
22.10.2020
|
||||||
|
|
||||||
- added a message to show if voronoi_diagram method can be used (require Shapely >= 1.8)
|
- added a message to show if voronoi_diagram method can be used (require Shapely >= 1.8)
|
||||||
|
|||||||
@@ -519,9 +519,9 @@ class ToolCopperThieving(AppTool):
|
|||||||
|
|
||||||
ref_selected = self.ui.reference_radio.get_value()
|
ref_selected = self.ui.reference_radio.get_value()
|
||||||
if c_val is None:
|
if c_val is None:
|
||||||
c_val = float(self.app.defaults["tools_copperfill_clearance"])
|
c_val = float(self.app.defaults["tools_copper_thieving_clearance"])
|
||||||
if margin is None:
|
if margin is None:
|
||||||
margin = float(self.app.defaults["tools_copperfill_margin"])
|
margin = float(self.app.defaults["tools_copper_thieving_margin"])
|
||||||
|
|
||||||
fill_type = self.ui.fill_type_radio.get_value()
|
fill_type = self.ui.fill_type_radio.get_value()
|
||||||
dot_dia = self.ui.dot_dia_entry.get_value()
|
dot_dia = self.ui.dot_dia_entry.get_value()
|
||||||
@@ -543,10 +543,8 @@ class ToolCopperThieving(AppTool):
|
|||||||
app_obj.app.inform.emit(_("Copper Thieving Tool. Preparing isolation polygons."))
|
app_obj.app.inform.emit(_("Copper Thieving Tool. Preparing isolation polygons."))
|
||||||
|
|
||||||
# variables to display the percentage of work done
|
# variables to display the percentage of work done
|
||||||
geo_len = 0
|
|
||||||
try:
|
try:
|
||||||
for pol in app_obj.grb_object.solid_geometry:
|
geo_len = len(app_obj.grb_object.solid_geometry)
|
||||||
geo_len += 1
|
|
||||||
except TypeError:
|
except TypeError:
|
||||||
geo_len = 1
|
geo_len = 1
|
||||||
|
|
||||||
@@ -613,10 +611,12 @@ class ToolCopperThieving(AppTool):
|
|||||||
bounding_box = env_obj.buffer(distance=margin, join_style=base.JOIN_STYLE.mitre)
|
bounding_box = env_obj.buffer(distance=margin, join_style=base.JOIN_STYLE.mitre)
|
||||||
else:
|
else:
|
||||||
if isinstance(geo_n, Polygon):
|
if isinstance(geo_n, Polygon):
|
||||||
bounding_box = geo_n.buffer(distance=margin, join_style=base.JOIN_STYLE.mitre).exterior
|
bounding_box = geo_n.buffer(distance=margin, join_style=base.JOIN_STYLE.mitre)
|
||||||
elif isinstance(geo_n, list):
|
elif isinstance(geo_n, list):
|
||||||
geo_n = unary_union(geo_n)
|
geo_n = MultiPolygon(geo_n)
|
||||||
bounding_box = geo_n.buffer(distance=margin, join_style=base.JOIN_STYLE.mitre).exterior
|
x0, y0, x1, y1 = geo_n.bounds
|
||||||
|
geo = box(x0, y0, x1, y1)
|
||||||
|
bounding_box = geo.buffer(distance=margin, join_style=base.JOIN_STYLE.mitre)
|
||||||
elif isinstance(geo_n, MultiPolygon):
|
elif isinstance(geo_n, MultiPolygon):
|
||||||
x0, y0, x1, y1 = geo_n.bounds
|
x0, y0, x1, y1 = geo_n.bounds
|
||||||
geo = box(x0, y0, x1, y1)
|
geo = box(x0, y0, x1, y1)
|
||||||
@@ -689,10 +689,16 @@ class ToolCopperThieving(AppTool):
|
|||||||
# bounding_box = box(x0, y0, x1, y1)
|
# bounding_box = box(x0, y0, x1, y1)
|
||||||
app_obj.app.proc_container.update_view_text(' %s' % _("Create geometry"))
|
app_obj.app.proc_container.update_view_text(' %s' % _("Create geometry"))
|
||||||
|
|
||||||
bounding_box = thieving_obj.solid_geometry.envelope.buffer(
|
try:
|
||||||
distance=margin,
|
bounding_box = thieving_obj.solid_geometry.envelope.buffer(
|
||||||
join_style=base.JOIN_STYLE.mitre
|
distance=margin,
|
||||||
)
|
join_style=base.JOIN_STYLE.mitre
|
||||||
|
)
|
||||||
|
except AttributeError:
|
||||||
|
bounding_box = MultiPolygon(thieving_obj.solid_geometry).envelope.buffer(
|
||||||
|
distance=margin,
|
||||||
|
join_style=base.JOIN_STYLE.mitre
|
||||||
|
)
|
||||||
x0, y0, x1, y1 = bounding_box.bounds
|
x0, y0, x1, y1 = bounding_box.bounds
|
||||||
|
|
||||||
if fill_type == 'dot' or fill_type == 'square':
|
if fill_type == 'dot' or fill_type == 'square':
|
||||||
|
|||||||
Reference in New Issue
Block a user