sfc/slicer.py: when flipping, also flip Z positions used for selecting levels

This led to toolpaths full of strange yet almost imperceptible errors
along the Z axis, just on the edge of what could be explained by
machining tolerances.
This commit is contained in:
Werner Almesberger 2015-01-20 03:19:22 -03:00
parent ed0129df1e
commit 4cc43e1661
1 changed files with 4 additions and 1 deletions

View File

@ -150,7 +150,10 @@ max_nz = 0
inclined = 0
for facet in mesh.Facets:
if abs(facet.Normal.z) >= 1 - epsilon:
z_raw[facet.Points[0][2]] = 1
z = facet.Points[0][2]
if flip:
z = bb.ZMax - z + bb.ZMin
z_raw[z] = 1
else:
nz = abs(facet.Normal.z)
if nz > epsilon: