- done a regression on Tool Tab default text. It somehow delete Tools in certain scenarios so I got rid of it

- fixed bug in multigeometry geometry not having the bounds in self.options and crashing the GCode generation
- fixed bug that crashed whole application in case that the GCode editor is activated on a Tool gcode that is defective.
This commit is contained in:
Marius Stanciu
2019-02-06 00:16:14 +02:00
committed by Marius S
parent 2ea2ed0cb0
commit 299a6585a7
7 changed files with 79 additions and 35 deletions

View File

@@ -839,6 +839,17 @@ class ToolPaint(FlatCAMTool, Gerber):
return None
geo_obj.solid_geometry = []
try:
a, b, c, d = poly.bounds()
geo_obj.options['xmin'] = a
geo_obj.options['ymin'] = b
geo_obj.options['xmax'] = c
geo_obj.options['ymax'] = d
except Exception as e:
log.debug("ToolPaint.paint_poly.gen_paintarea() bounds error --> %s" % str(e))
return
try:
poly_buf = poly.buffer(-paint_margin)
if isinstance(poly_buf, MultiPolygon):
@@ -988,6 +999,16 @@ class ToolPaint(FlatCAMTool, Gerber):
sorted_tools.append(float(self.tools_table.item(row, 1).text()))
sorted_tools.sort(reverse=True)
try:
a, b, c, d = obj.bounds()
geo_obj.options['xmin'] = a
geo_obj.options['ymin'] = b
geo_obj.options['xmax'] = c
geo_obj.options['ymax'] = d
except Exception as e:
log.debug("ToolPaint.paint_poly.gen_paintarea() bounds error --> %s" % str(e))
return
total_geometry = []
current_uid = int(1)
geo_obj.solid_geometry = []
@@ -1085,6 +1106,16 @@ class ToolPaint(FlatCAMTool, Gerber):
current_uid = int(1)
geo_obj.solid_geometry = []
try:
a, b, c, d = obj.bounds()
geo_obj.options['xmin'] = a
geo_obj.options['ymin'] = b
geo_obj.options['xmax'] = c
geo_obj.options['ymax'] = d
except Exception as e:
log.debug("ToolPaint.paint_poly.gen_paintarea() bounds error --> %s" % str(e))
return
for tool_dia in sorted_tools:
for geo in recurse(obj.solid_geometry):
try: