From b309a14929107f0120ddf1b9a631554bde41d479 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sat, 30 Oct 2021 14:10:48 +0300 Subject: [PATCH] - small changes in the VisPyVisuals that should improve a bit the performance --- CHANGELOG.md | 5 +++++ appGUI/VisPyVisuals.py | 19 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85430b45..f90dd1c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta ================================================= +30.10.2021 + +- small changes in the VisPyVisuals that should improve a bit the performance + + 28.10.2021 - cleaned the geometry generated by flattening by removing the empty geometry; fixed issue #539 on jpcgt's bitbucket account diff --git a/appGUI/VisPyVisuals.py b/appGUI/VisPyVisuals.py index 23d4ebee..5ca0496e 100644 --- a/appGUI/VisPyVisuals.py +++ b/appGUI/VisPyVisuals.py @@ -292,8 +292,21 @@ class ShapeCollectionVisual(CompoundVisual): self.key_lock.release() # Prepare data for translation - self.data[key] = {'geometry': shape, 'color': color, 'alpha': alpha, 'face_color': face_color, - 'visible': visible, 'layer': layer, 'tolerance': tolerance} + self.data[key] = { + 'geometry': shape, + 'color': color, + 'alpha': alpha, + 'face_color': face_color, + 'visible': visible, + 'layer': layer, + 'tolerance': tolerance, + # the following keys are updated in the _update_shape_buffers() method + 'mesh_vertices': [], # Vertices for mesh + 'mesh_tris': [], # Faces for mesh + 'mesh_colors': [], # Face colors + 'line_pts': [], # Vertices for line + 'line_colors': [] # Line colors + } if linewidth: self._line_width = linewidth @@ -497,7 +510,7 @@ class ShapeCollectionVisual(CompoundVisual): self.update_lock.acquire(True) # Merge shapes buffers - for data in list(self.data.values()): + for data in self.data.values(): if data['visible'] and 'line_pts' in data: try: line_pts[data['layer']] += data['line_pts']