Check "matplotlib" performance.

This commit is contained in:
Denvi
2015-12-07 22:40:30 +05:00
parent 791e2e5ace
commit 28e84b49de
4 changed files with 14 additions and 12 deletions

View File

@@ -25,7 +25,6 @@ from FlatCAMDraw import FlatCAMDraw
from FlatCAMProcess import *
from MeasurementTool import Measurement
from DblSidedTool import DblSidedTool
import re
########################################

View File

@@ -8,6 +8,7 @@ from FlatCAMCommon import LoudDict
from FlatCAMDraw import FlatCAMDraw
from shapely.geometry.base import CAP_STYLE, JOIN_STYLE
TOLERANCE = 0.01
########################################
## FlatCAMObj ##
@@ -1062,7 +1063,7 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
if not FlatCAMObj.plot(self):
return
self.plot2(self.axes, tooldia=self.options["tooldia"])
self.plot2(self.axes, tooldia=self.options["tooldia"], tool_tolerance=TOLERANCE)
self.app.plotcanvas.auto_adjust_axes()
@@ -1391,7 +1392,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
except TypeError: # Element is not iterable...
if type(element) == Polygon:
x, y = element.exterior.coords.xy
x, y = element.simplify(TOLERANCE).exterior.coords.xy
self.axes.plot(x, y, 'r-')
for ints in element.interiors:
x, y = ints.coords.xy
@@ -1399,7 +1400,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
return
if type(element) == LineString or type(element) == LinearRing:
x, y = element.coords.xy
x, y = element.simplify(TOLERANCE).coords.xy
self.axes.plot(x, y, 'r-')
return

View File

@@ -343,7 +343,8 @@ class PlotCanvas:
self.pan_axes.append(a)
# Set pan view flag
if len(self.pan_axes) > 0: self.panning = True;
if len(self.pan_axes) > 0:
self.panning = True;
def on_mouse_release(self, event):

View File

@@ -3099,15 +3099,16 @@ class CNCjob(Geometry):
else:
for geo in self.gcode_parsed:
path_num += 1
axes.annotate(str(path_num), xy=geo['geom'].coords[0],
xycoords='data')
# axes.annotate(str(path_num), xy=geo['geom'].coords[0],
# xycoords='data')
poly = geo['geom'].buffer(tooldia / 2.0).simplify(tool_tolerance)
patch = PolygonPatch(poly, facecolor=color[geo['kind'][0]][0],
edgecolor=color[geo['kind'][0]][1],
alpha=alpha[geo['kind'][0]], zorder=2)
axes.add_patch(patch)
if "C" in geo['kind']:
patch = PolygonPatch(poly, facecolor=color[geo['kind'][0]][0],
edgecolor=color[geo['kind'][0]][1],
alpha=alpha[geo['kind'][0]], zorder=2)
axes.add_patch(patch)
def create_geometry(self):
# TODO: This takes forever. Too much data?
self.solid_geometry = cascaded_union([geo['geom'] for geo in self.gcode_parsed])