Commit 073da262 authored by sumpfralle's avatar sumpfralle

fixed toolpath simulation (two variables were mixed up)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@889 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 2879bfc1
...@@ -102,7 +102,7 @@ class Toolpath(object): ...@@ -102,7 +102,7 @@ class Toolpath(object):
self.color = color self.color = color
def get_moves(self, safety_height, max_movement=None): def get_moves(self, safety_height, max_movement=None):
class move_container(object): class MoveContainer(object):
def __init__(self, max_movement): def __init__(self, max_movement):
self.max_movement = max_movement self.max_movement = max_movement
self.moved_distance = 0 self.moved_distance = 0
...@@ -122,7 +122,7 @@ class Toolpath(object): ...@@ -122,7 +122,7 @@ class Toolpath(object):
distance = new_position.sub(self.last_pos).norm distance = new_position.sub(self.last_pos).norm
if self.moved_distance + distance > self.max_movement: if self.moved_distance + distance > self.max_movement:
partial = (self.max_movement - self.moved_distance) / distance partial = (self.max_movement - self.moved_distance) / distance
partial_dest = p_last.add(new_position.sub( partial_dest = self.last_pos.add(new_position.sub(
self.last_pos).mul(partial)) self.last_pos).mul(partial))
self.moves.append((partial_dest, rapid)) self.moves.append((partial_dest, rapid))
self.last_pos = partial_dest self.last_pos = partial_dest
...@@ -139,7 +139,7 @@ class Toolpath(object): ...@@ -139,7 +139,7 @@ class Toolpath(object):
p_last = None p_last = None
max_safe_distance = 2 * self.toolpath_settings.get_tool().radius \ max_safe_distance = 2 * self.toolpath_settings.get_tool().radius \
+ epsilon + epsilon
result = move_container(max_movement) result = MoveContainer(max_movement)
for path in self.get_paths(): for path in self.get_paths():
if not path: if not path:
# ignore empty paths # ignore empty paths
......
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