- in NCC Tool fixed issue #486 where creating Area Selection shapes of type Square with Grid snap OFF will not use the first click position
- fixed a bug in Paint Tool when doing Painting Area Selection and nothing is no polygon is in the selections to be painted - fixed Isolation, Paint and NCC Tools to use the Tool Type parameter from Preferences on adding new tools and also setting the 'type' key in tools dict correctly
This commit is contained in:
@@ -1419,8 +1419,8 @@ class ToolIsolation(AppTool, Gerber):
|
||||
'tooldia': truncated_tooldia,
|
||||
'offset': 'Path',
|
||||
'offset_value': 0.0,
|
||||
'type': ' Iso',
|
||||
'tool_type': 'V',
|
||||
'type': 'Iso' if self.app.defaults["tools_iso_tool_type"] == 'V' else 'Rough',
|
||||
'tool_type': deepcopy(self.app.defaults["tools_iso_tool_type"]),
|
||||
'data': deepcopy(self.default_data),
|
||||
'solid_geometry': []
|
||||
}
|
||||
|
||||
@@ -1380,7 +1380,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
'tooldia': truncated_tooldia,
|
||||
'offset': 'Path',
|
||||
'offset_value': 0.0,
|
||||
'type': 'Iso',
|
||||
'type': 'Iso' if self.app.defaults["tools_ncc_tool_type"] == 'V' else 'Rough',
|
||||
'tool_type': deepcopy(self.app.defaults["tools_ncc_tool_type"]),
|
||||
'data': deepcopy(self.default_data),
|
||||
'solid_geometry': []
|
||||
@@ -1678,9 +1678,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
self.first_click = True
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click the end point of the area."))
|
||||
|
||||
self.cursor_pos = self.app.plotcanvas.translate_coords(event_pos)
|
||||
if self.app.grid_status():
|
||||
self.cursor_pos = self.app.geo_editor.snap(event_pos[0], event_pos[1])
|
||||
self.cursor_pos = (curr_pos[0], curr_pos[1])
|
||||
else:
|
||||
self.app.inform.emit(_("Zone added. Click to start adding next zone or right click to finish."))
|
||||
self.app.delete_selection_shape()
|
||||
|
||||
@@ -978,8 +978,8 @@ class ToolPaint(AppTool, Gerber):
|
||||
'tooldia': truncated_tooldia,
|
||||
'offset': 'Path',
|
||||
'offset_value': 0.0,
|
||||
'type': 'Iso',
|
||||
'tool_type': 'V',
|
||||
'type': 'Iso' if self.app.defaults["tools_paint_tool_type"] == 'V' else 'Rough',
|
||||
'tool_type': deepcopy(self.app.defaults["tools_paint_tool_type"]),
|
||||
'data': deepcopy(self.default_data),
|
||||
'solid_geometry': []
|
||||
}
|
||||
@@ -1919,7 +1919,8 @@ class ToolPaint(AppTool, Gerber):
|
||||
poly_buf.append(buffered_pol)
|
||||
|
||||
if not poly_buf:
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Margin parameter too big. Tool is not used"))
|
||||
self.app.inform.emit(
|
||||
'[ERROR_NOTCL] %s' % _("There is no geometry to process or the tool diameter is too big."))
|
||||
continue
|
||||
|
||||
# variables to display the percentage of work done
|
||||
@@ -2067,7 +2068,8 @@ class ToolPaint(AppTool, Gerber):
|
||||
poly_buf = unary_union(poly_buf)
|
||||
|
||||
if not poly_buf:
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Margin parameter too big. Tool is not used"))
|
||||
self.app.inform.emit(
|
||||
'[ERROR_NOTCL] %s' % _("There is no geometry to process or the tool diameter is too big."))
|
||||
return 'fail'
|
||||
|
||||
# variables to display the percentage of work done
|
||||
@@ -2512,7 +2514,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
# ## If iterable, expand recursively.
|
||||
try:
|
||||
for geo in geometry:
|
||||
if geo is not None:
|
||||
if geo and not geo.is_empty and geo.is_valid:
|
||||
recurse(geometry=geo, reset=False)
|
||||
|
||||
# ## Not iterable, do the actual indexing and add.
|
||||
@@ -2544,14 +2546,15 @@ class ToolPaint(AppTool, Gerber):
|
||||
self.app.inform.emit('%s %s' % (_("Paint Tool."), _("Painting area task started.")))
|
||||
|
||||
geo_to_paint = target_geo.intersection(sel_obj)
|
||||
painted_area = recurse(geo_to_paint)
|
||||
|
||||
# No polygon?
|
||||
if not painted_area:
|
||||
if not geo_to_paint or geo_to_paint.is_empty:
|
||||
self.app.log.warning('No polygon found.')
|
||||
self.app.inform.emit('[WARNING] %s' % _('No polygon found.'))
|
||||
return
|
||||
|
||||
painted_area = recurse(geo_to_paint, reset=True)
|
||||
|
||||
self.paint_geo(obj, painted_area, tooldia=tooldia, order=order, method=method, outname=outname,
|
||||
tools_storage=tools_storage, plot=plot, run_threaded=run_threaded)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user