Commit c9ae4ffc authored by sumpfralle's avatar sumpfralle

fixed scoping issue


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@500 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent d9396fef
......@@ -97,15 +97,15 @@ class ToolPath:
if start_position is None:
start_position = Point(0, 0, 0)
feedrate = settings.get_tool_settings()["feedrate"]
current_position = start_position
result_time = 0
result = {}
result["time"] = 0
result["position"] = start_position
def move(new_pos):
global current_position, result_time
result_time += new_pos.sub(current_position).norm() / feedrate
current_position = new_pos
result["time"] += new_pos.sub(result["position"]).norm() / feedrate
result["position"] = new_pos
# move to safey height at the starting position
safety_height = settings.get_process_settings()["safety_height"]
move(Point(start_position.x, start_position.y, safety_height))
move(result, Point(start_position.x, start_position.y, safety_height))
for path in self.get_path():
# go to safety height (horizontally from the previous x/y location)
if len(path.points) > 0:
......@@ -116,7 +116,7 @@ class ToolPath:
# go to safety height (vertically up from the current x/y location)
if len(path.points) > 0:
move(Point(path.points[-1].x, path.points[-1].y, safety_height))
return result_time
return result["time"]
class Bounds:
......
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