diff options
author | Remco Burema <r.burema@ultimaker.com> | 2021-08-09 14:15:44 +0300 |
---|---|---|
committer | Remco Burema <r.burema@ultimaker.com> | 2021-08-09 14:15:44 +0300 |
commit | e119c4694416f562305d93d42f0306e5a70ab31c (patch) | |
tree | c7df5a7fe5729bb083c0ead9ba4ec2dcfd736e67 /cura/LayerPolygon.py | |
parent | 818438a8d6d14a8295d721c0a525f9775170b0cc (diff) |
Fetch count from simple property instead of recalculation.
Polygons don't change when in layer-view. There's already an analogous elementCount property anyway, so a vertexCount property can't do much harm. Just keep in mind that when the polygons are altered, it should be either done via build, or the lineMeshXXXCount methods should be used instead.
Diffstat (limited to 'cura/LayerPolygon.py')
-rw-r--r-- | cura/LayerPolygon.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cura/LayerPolygon.py b/cura/LayerPolygon.py index cf4bb47a86..610366d5fc 100644 --- a/cura/LayerPolygon.py +++ b/cura/LayerPolygon.py @@ -188,6 +188,10 @@ class LayerPolygon: return self._data @property + def vertexCount(self): + return self._vertex_end - self._vertex_begin + + @property def elementCount(self): return (self._index_end - self._index_begin) * 2 # The range of vertices multiplied by 2 since each vertex is used twice |