Commit 595edf60 authored by Guillaume Seguin's avatar Guillaume Seguin

More cleanup on gcode measurement

parent ed385645
...@@ -168,28 +168,22 @@ class Layer(object): ...@@ -168,28 +168,22 @@ class Layer(object):
y = current_y + (y or 0) y = current_y + (y or 0)
z = current_z + (z or 0) z = current_z + (z or 0)
if line.e:
if x and line.e: if x:
if x < xmin: xmin = min(xmin, x)
xmin = x xmax = max(xmax, x)
if x > xmax: if y:
xmax = x ymin = min(ymin, y)
if y and line.e: ymax = max(ymax, y)
if y < ymin:
ymin = y
if y > ymax:
ymax = y
if z: if z:
if z < zmin: zmin = min(zmin, z)
zmin = z zmax = max(zmax, z)
if z > zmax:
zmax = z
current_x = x or current_x current_x = x or current_x
current_y = y or current_y current_y = y or current_y
current_z = z or current_z current_z = z or current_z
return ( (xmin,xmax),(ymin,ymax),(zmin,zmax) ) return (xmin, xmax), (ymin, ymax), (zmin, zmax)
class GCode(object): class GCode(object):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment