Commit 1184dfcf authored by sumpfralle's avatar sumpfralle

DropCutter (ODE and triangle collision detection) now go up to safety height,...

DropCutter (ODE and triangle collision detection) now go up to safety height, if the model is higher than the bounding box
* before: cut through the model at maxz


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@818 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 6cf659bb
...@@ -2,6 +2,9 @@ Version 0.4.1 - UNRELEASED ...@@ -2,6 +2,9 @@ Version 0.4.1 - UNRELEASED
* added support for EPS/PS contour files * added support for EPS/PS contour files
* added adaptive positioning for DropCutter strategy (improves precision) * added adaptive positioning for DropCutter strategy (improves precision)
* allow conventional/climb milling style for ContourFollow and Engrave strategies * allow conventional/climb milling style for ContourFollow and Engrave strategies
* visualize movements up to safety height properly
* unify DropCutter behaviour for models that are higher than the defined bounding box
* always move up to safety height in this case
* optional visualization of toolpath direction * optional visualization of toolpath direction
Version 0.4.0.1 - 2010-10-24 Version 0.4.0.1 - 2010-10-24
......
...@@ -120,6 +120,11 @@ class DropCutter: ...@@ -120,6 +120,11 @@ class DropCutter:
quit_requested = True quit_requested = True
break break
for p in points: for p in points:
if p is None:
# exceeded maxz - the cutter has to skip this point
self.pa.end_scanline()
self.pa.new_scanline()
continue
self.pa.append(p) self.pa.append(p)
# "draw_callback" returns true, if the user requested to quit # "draw_callback" returns true, if the user requested to quit
# via the GUI. # via the GUI.
......
...@@ -196,9 +196,12 @@ class EngraveCutter: ...@@ -196,9 +196,12 @@ class EngraveCutter:
points = get_max_height_dynamic(self.combined_model, self.cutter, points = get_max_height_dynamic(self.combined_model, self.cutter,
step_coords, minz, maxz, self.physics) step_coords, minz, maxz, self.physics)
for p in points: for p in points:
if p is None:
# exceeded maxz - the cutter has to skip this point
self.pa.end_scanline()
self.pa.new_scanline()
continue
pa.append(p) pa.append(p)
# "draw_callback" returns true, if the user requested quitting via
# the GUI.
if draw_callback and points: if draw_callback and points:
draw_callback(tool_position=points[-1], toolpath=pa.paths) draw_callback(tool_position=points[-1], toolpath=pa.paths)
pa.end_scanline() pa.end_scanline()
......
...@@ -215,8 +215,8 @@ def get_max_height_ode(physics, x, y, minz, maxz): ...@@ -215,8 +215,8 @@ def get_max_height_ode(physics, x, y, minz, maxz):
safe_z = current_z safe_z = current_z
trips -= 1 trips -= 1
if safe_z is None: if safe_z is None:
# return maxz as the collision height # skip this point (by going up to safety height)
return Point(x, y, maxz) return None
else: else:
return Point(x, y, safe_z) return Point(x, y, safe_z)
...@@ -239,8 +239,10 @@ def get_max_height_triangles(model, cutter, x, y, minz, maxz): ...@@ -239,8 +239,10 @@ 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
# check if we need more points in between (for better accuracy) if height_max > maxz:
return Point(x, y, height_max) return None
else:
return Point(x, y, height_max)
def _check_deviance_of_adjacent_points(p1, p2, p3, min_distance): def _check_deviance_of_adjacent_points(p1, p2, p3, min_distance):
straight = p3.sub(p1) straight = p3.sub(p1)
...@@ -276,7 +278,8 @@ def get_max_height_dynamic(model, cutter, positions, minz, maxz, physics=None): ...@@ -276,7 +278,8 @@ def get_max_height_dynamic(model, cutter, positions, minz, maxz, physics=None):
p1 = result[index] p1 = result[index]
p2 = result[index + 1] p2 = result[index + 1]
p3 = result[index + 2] p3 = result[index + 2]
if not _check_deviance_of_adjacent_points(p1, p2, p3, min_distance) \ if (not p1 is None) and (not p2 is None) and (not p3 is None) \
and not _check_deviance_of_adjacent_points(p1, p2, p3, min_distance) \
and (depth_count < max_depth): and (depth_count < max_depth):
# distribute the new point two before the middle and one after # distribute the new point two before the middle and one after
if depth_count % 3 != 2: if depth_count % 3 != 2:
......
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