Commit 91668c2f authored by sumpfralle's avatar sumpfralle

work around small float inaccuracies for maxz of the bounding box at the...

work around small float inaccuracies for maxz of the bounding box at the height of the model (for DropCutter)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@841 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent d3f77849
...@@ -192,7 +192,10 @@ def get_free_paths_ode(physics, p1, p2, depth=8): ...@@ -192,7 +192,10 @@ def get_free_paths_ode(physics, p1, p2, depth=8):
return points return points
def get_max_height_ode(physics, x, y, minz, maxz): def get_max_height_ode(physics, x, y, minz, maxz):
low, high = minz, maxz # Take a small float inaccuracy for the upper limit into account.
# Otherwise an upper bound at maxz of the model will not return
# a valid surface. That's why we add 'epsilon'.
low, high = minz, maxz + epsilon
trip_start = 20 trip_start = 20
safe_z = None safe_z = None
# check if the full step-down would be ok # check if the full step-down would be ok
...@@ -239,7 +242,7 @@ def get_max_height_triangles(model, cutter, x, y, minz, maxz): ...@@ -239,7 +242,7 @@ def get_max_height_triangles(model, cutter, x, y, minz, maxz):
# this avoids zero-cuts for models that exceed the bounding box height # this avoids zero-cuts for models that exceed the bounding box height
if (height_max is None) or (height_max < minz + epsilon): if (height_max is None) or (height_max < minz + epsilon):
height_max = minz height_max = minz
if height_max > maxz: if height_max > maxz + epsilon:
return None return None
else: else:
return Point(x, y, height_max) return Point(x, y, height_max)
......
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