Small optimalization in gcode preview, saves a square root per line

master
Daid 2012-03-31 21:48:23 +02:00
parent fe91a1b123
commit 7d13b17dd9
1 changed files with 1 additions and 1 deletions

View File

@ -471,7 +471,7 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
# Calculate line width from ePerDistance (needs layer thickness and filament diameter)
dist = (v0 - v1).vsize()
if dist > 0 and layerThickness > 0:
extrusionMMperDist = (v1.e - v0.e) / (v0 - v1).vsize()
extrusionMMperDist = (v1.e - v0.e) / dist
lineWidth = extrusionMMperDist * filamentArea / layerThickness / 2
normal = (v0 - v1).cross(util3d.Vector3(0,0,1))