- made the delayed Gerber buffering to use multiprocessing but I see not much performance increase

This commit is contained in:
Marius Stanciu 2020-06-03 04:26:56 +03:00 committed by Marius
parent 89d2de48da
commit b23bd5f590
2 changed files with 14 additions and 4 deletions

View File

@ -388,16 +388,25 @@ class GerberObject(FlatCAMObj, Gerber):
except (TypeError, AttributeError):
pass
@staticmethod
def buffer_handler(geo):
new_geo = geo
if isinstance(new_geo, list):
new_geo = MultiPolygon(new_geo)
new_geo = new_geo.buffer(0.0000001)
new_geo = new_geo.buffer(-0.0000001)
return new_geo
def on_generate_buffer(self):
self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Buffering solid geometry"))
def buffer_task():
with self.app.proc_container.new('%s...' % _("Buffering")):
if isinstance(self.solid_geometry, list):
self.solid_geometry = MultiPolygon(self.solid_geometry)
output = self.app.pool.apply_async(self.buffer_handler, args=([self.solid_geometry]))
self.solid_geometry = output.get()
self.solid_geometry = self.solid_geometry.buffer(0.0000001)
self.solid_geometry = self.solid_geometry.buffer(-0.0000001)
self.app.inform.emit('[success] %s.' % _("Done"))
self.plot_single_object.emit()

View File

@ -13,6 +13,7 @@ CHANGELOG for FlatCAM beta
- Transform Tool - compacted the UI
- minor issue in Paint Tool
- added a new feature for Gerber parsing: if the NO buffering is chosen in the Gerber Advanced Preferences there is now a checkbox to activate delayed buffering which will do the buffering in background allowing the user to work in between. I hope that this can be useful in case of large Gerber files.
- made the delayed Gerber buffering to use multiprocessing but I see not much performance increase
2.06.2020