mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-05 19:46:17 +08:00
Small optimalization in gcode preview, saves a square root per line
This commit is contained in:
parent
fe91a1b123
commit
7d13b17dd9
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user