- in Gerber Object trying to solve the issue with too little details on plotting geometry with inch units

This commit is contained in:
Marius Stanciu
2021-09-27 15:22:27 +03:00
committed by Marius
parent 0cee20a6d9
commit 89426e8ac3
5 changed files with 44 additions and 23 deletions

View File

@@ -942,10 +942,19 @@ class GerberObject(FlatCAMObj, Gerber):
used_face_color = None
plot_geometry = geometry.geoms if isinstance(geometry, (MultiPolygon, MultiLineString)) else geometry
for g in plot_geometry:
if isinstance(g, (Polygon, LineString, LinearRing)):
self.add_shape(shape=g, color=used_color, face_color=used_face_color, visible=visible)
try:
for g in plot_geometry:
if isinstance(g, (Polygon, LineString)):
self.add_shape(shape=g, color=used_color, face_color=used_face_color, visible=visible)
elif isinstance(g, LinearRing):
g = LineString(g)
self.add_shape(shape=g, color=used_color, face_color=used_face_color, visible=visible)
except TypeError:
if isinstance(plot_geometry, (Polygon, LineString)):
self.add_shape(shape=plot_geometry, color=used_color, face_color=used_face_color, visible=visible)
elif isinstance(plot_geometry, LinearRing):
plot_geometry = LineString(plot_geometry)
self.add_shape(shape=plot_geometry, color=used_color, face_color=used_face_color, visible=visible)
self.shapes.redraw(
# update_colors=(self.fill_color, self.outline_color),
# indexes=self.app.plotcanvas.shape_collection.data.keys()

View File

@@ -417,17 +417,21 @@ class FlatCAMObj(QtCore.QObject):
return
def add_shape(self, **kwargs):
tol = kwargs['tolerance'] if 'tolerance' in kwargs else self.drawing_tolerance
if self.deleted:
raise ObjectDeleted()
else:
key = self.shapes.add(tolerance=self.drawing_tolerance, **kwargs)
key = self.shapes.add(tolerance=tol, **kwargs)
return key
def add_mark_shape(self, **kwargs):
tol = kwargs['tolerance'] if 'tolerance' in kwargs else self.drawing_tolerance
if self.deleted:
raise ObjectDeleted()
else:
key = self.mark_shapes.add(tolerance=self.drawing_tolerance, layer=0, **kwargs)
key = self.mark_shapes.add(tolerance=tol, layer=0, **kwargs)
return key
def update_filters(self, last_ext, filter_string):