Small optimalization in gcode preview, saves a square root per line
This commit is contained in:
1 parent
fe91a1b123
commit
7d13b17dd9
1 file changed
+1
-1
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user