- fixed the multi-color feature in the Gerber object UI
- fixed the marking of apertures in Gerber object UI and in Extract plugin
This commit is contained in:
@@ -9,7 +9,9 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
1.02.2022
|
1.02.2022
|
||||||
|
|
||||||
- fixed the `cncjob` Tcl command: forgot to pop the arguments that are not recognized by the non-multigo handler
|
- fixed the `cncjob` Tcl command: forgot to pop the arguments that are not recognized by the non-multigeo handler
|
||||||
|
- fixed the multi-color feature in the Gerber object UI
|
||||||
|
- fixed the marking of apertures in Gerber object UI and in Extract plugin
|
||||||
|
|
||||||
31.02.2022
|
31.02.2022
|
||||||
|
|
||||||
|
|||||||
@@ -963,6 +963,9 @@ class GerberObject(FlatCAMObj, Gerber):
|
|||||||
return new_color
|
return new_color
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
plot_geometry = geometry.geoms if isinstance(geometry, (MultiPolygon, MultiLineString)) else geometry
|
||||||
|
try:
|
||||||
|
for g in plot_geometry:
|
||||||
if self.options["solid"]:
|
if self.options["solid"]:
|
||||||
used_color = color
|
used_color = color
|
||||||
used_face_color = random_color() if self.options['multicolored'] else face_color
|
used_face_color = random_color() if self.options['multicolored'] else face_color
|
||||||
@@ -970,15 +973,19 @@ class GerberObject(FlatCAMObj, Gerber):
|
|||||||
used_color = random_color() if self.options['multicolored'] else 'black'
|
used_color = random_color() if self.options['multicolored'] else 'black'
|
||||||
used_face_color = None
|
used_face_color = None
|
||||||
|
|
||||||
plot_geometry = geometry.geoms if isinstance(geometry, (MultiPolygon, MultiLineString)) else geometry
|
|
||||||
try:
|
|
||||||
for g in plot_geometry:
|
|
||||||
if isinstance(g, (Polygon, LineString)):
|
if isinstance(g, (Polygon, LineString)):
|
||||||
self.add_shape(shape=g, color=used_color, face_color=used_face_color, visible=visible)
|
self.add_shape(shape=g, color=used_color, face_color=used_face_color, visible=visible)
|
||||||
elif isinstance(g, LinearRing):
|
elif isinstance(g, LinearRing):
|
||||||
g = LineString(g)
|
g = LineString(g)
|
||||||
self.add_shape(shape=g, color=used_color, face_color=used_face_color, visible=visible)
|
self.add_shape(shape=g, color=used_color, face_color=used_face_color, visible=visible)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
if self.options["solid"]:
|
||||||
|
used_color = color
|
||||||
|
used_face_color = random_color() if self.options['multicolored'] else face_color
|
||||||
|
else:
|
||||||
|
used_color = random_color() if self.options['multicolored'] else 'black'
|
||||||
|
used_face_color = None
|
||||||
|
|
||||||
if isinstance(plot_geometry, (Polygon, LineString)):
|
if isinstance(plot_geometry, (Polygon, LineString)):
|
||||||
self.add_shape(shape=plot_geometry, color=used_color, face_color=used_face_color, visible=visible)
|
self.add_shape(shape=plot_geometry, color=used_color, face_color=used_face_color, visible=visible)
|
||||||
elif isinstance(plot_geometry, LinearRing):
|
elif isinstance(plot_geometry, LinearRing):
|
||||||
@@ -1045,9 +1052,7 @@ class GerberObject(FlatCAMObj, Gerber):
|
|||||||
shape_key = app_obj.add_mark_shape(shape=geo, color=color, face_color=color,
|
shape_key = app_obj.add_mark_shape(shape=geo, color=color, face_color=color,
|
||||||
visible=visibility)
|
visible=visibility)
|
||||||
app_obj.mark_shapes_storage[aperture_to_plot_mark].append(shape_key)
|
app_obj.mark_shapes_storage[aperture_to_plot_mark].append(shape_key)
|
||||||
|
|
||||||
app_obj.mark_shapes.redraw()
|
app_obj.mark_shapes.redraw()
|
||||||
|
|
||||||
except (ObjectDeleted, AttributeError):
|
except (ObjectDeleted, AttributeError):
|
||||||
app_obj.clear_plot_apertures()
|
app_obj.clear_plot_apertures()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -1111,8 +1116,9 @@ class GerberObject(FlatCAMObj, Gerber):
|
|||||||
if self.ui.apertures_table.cellWidget(cw_row, 5).isChecked():
|
if self.ui.apertures_table.cellWidget(cw_row, 5).isChecked():
|
||||||
self.marked_rows.append(True)
|
self.marked_rows.append(True)
|
||||||
# self.plot_aperture(color='#2d4606bf', marked_aperture=aperture, visible=True)
|
# self.plot_aperture(color='#2d4606bf', marked_aperture=aperture, visible=True)
|
||||||
self.plot_aperture(color=self.app.defaults['global_sel_draw_color'] + 'AF',
|
color = self.app.defaults['global_sel_draw_color']
|
||||||
marked_aperture=aperture, visible=True, run_thread=True)
|
color = (color + 'AF') if len(color) == 7 else (color[:-2] + 'AF')
|
||||||
|
self.plot_aperture(color=color, marked_aperture=aperture, visible=True, run_thread=True)
|
||||||
else:
|
else:
|
||||||
self.marked_rows.append(False)
|
self.marked_rows.append(False)
|
||||||
self.clear_plot_apertures(aperture=aperture)
|
self.clear_plot_apertures(aperture=aperture)
|
||||||
@@ -1148,8 +1154,9 @@ class GerberObject(FlatCAMObj, Gerber):
|
|||||||
if mark_all:
|
if mark_all:
|
||||||
for aperture in self.tools:
|
for aperture in self.tools:
|
||||||
# self.plot_aperture(color='#2d4606bf', marked_aperture=aperture, visible=True)
|
# self.plot_aperture(color='#2d4606bf', marked_aperture=aperture, visible=True)
|
||||||
self.plot_aperture(color=self.app.defaults['global_sel_draw_color'] + 'AF',
|
color = self.app.defaults['global_sel_draw_color']
|
||||||
marked_aperture=aperture, visible=True)
|
color = (color + 'AF') if len(color) == 7 else (color[:-2] + 'AF')
|
||||||
|
self.plot_aperture(color=color, marked_aperture=aperture, visible=True)
|
||||||
# HACK: enable/disable the grid for a better look
|
# HACK: enable/disable the grid for a better look
|
||||||
self.app.ui.grid_snap_btn.trigger()
|
self.app.ui.grid_snap_btn.trigger()
|
||||||
self.app.ui.grid_snap_btn.trigger()
|
self.app.ui.grid_snap_btn.trigger()
|
||||||
|
|||||||
@@ -928,8 +928,9 @@ class ToolExtract(AppTool):
|
|||||||
|
|
||||||
if self.ui.apertures_table.cellWidget(cw_row, 3).isChecked():
|
if self.ui.apertures_table.cellWidget(cw_row, 3).isChecked():
|
||||||
# self.plot_aperture(color='#2d4606bf', marked_aperture=aperture, visible=True)
|
# self.plot_aperture(color='#2d4606bf', marked_aperture=aperture, visible=True)
|
||||||
grb_obj.plot_aperture(color=self.app.defaults['global_sel_draw_color'] + 'AA',
|
color = self.app.defaults['global_sel_draw_color']
|
||||||
marked_aperture=aperture, visible=True, run_thread=True)
|
color = (color + 'AA') if len(color) == 7 else (color[:-2] + 'AA')
|
||||||
|
grb_obj.plot_aperture(color=color, marked_aperture=aperture, visible=True, run_thread=True)
|
||||||
else:
|
else:
|
||||||
grb_obj.clear_plot_apertures(aperture=aperture)
|
grb_obj.clear_plot_apertures(aperture=aperture)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user