Commit 046058d3 authored by sumpfralle's avatar sumpfralle

switched back to tuple as parameter for parallelized functions (necessary for...

switched back to tuple as parameter for parallelized functions (necessary for "imap" function in multiprocessing)
fixed small issues of the "cutter.moveto/cutter.drop" transition


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@750 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent ebcd92c9
......@@ -56,22 +56,22 @@ class BaseCutter(object):
def get_minx(self, start=None):
if start is None:
start = self.location
return self.location.x - self.distance_radius
return start.x - self.distance_radius
def get_maxx(self, start=None):
if start is None:
start = self.location
return self.location.x + self.distance_radius
return start.x + self.distance_radius
def get_miny(self, start=None):
if start is None:
start = self.location
return self.location.y - self.distance_radius
return start.y - self.distance_radius
def get_maxy(self, start=None):
if start is None:
start = self.location
return self.location.y + self.distance_radius
return start.y + self.distance_radius
def update_uuid(self):
self.uuid = uuid.uuid4()
......@@ -131,7 +131,7 @@ class BaseCutter(object):
* triangle.radius + triangle.radiussq) + epsilon:
return None
(cl, d, cp) = self.intersect(BaseCutter.vertical, triangle)
(cl, d, cp) = self.intersect(BaseCutter.vertical, triangle, start=start)
return cl
def intersect_circle_triangle(self, direction, triangle, start=None):
......
......@@ -181,7 +181,7 @@ class ToroidalCutter(BaseCutter):
continue
p = edge.point_with_length_multiply(m)
(cl, ccp, cp, l) = self.intersect_torus_point(direction, p,
start=None)
start=start)
if not cl:
continue
if l < min_l:
......
......@@ -45,7 +45,7 @@ log = pycam.Utils.log.get_logger()
# We need to use a global function here - otherwise it does not work with
# the multiprocessing Pool.
def _process_one_triangle(model, cutter, up_vector, triangle, z):
def _process_one_triangle((model, cutter, up_vector, triangle, z)):
result = []
# ignore triangles below the z level
if triangle.maxz < z:
......
......@@ -33,8 +33,8 @@ log = pycam.Utils.log.get_logger()
# We need to use a global function here - otherwise it does not work with
# the multiprocessing Pool.
def _process_one_grid_line(positions, minz, maxz, dim_attrs, model, cutter,
physics, safety_height):
def _process_one_grid_line((positions, minz, maxz, dim_attrs, model, cutter,
physics, safety_height)):
# for now only used for triangular collision detection
last_position = None
points = []
......
......@@ -31,7 +31,7 @@ import math
# We need to use a global function here - otherwise it does not work with
# the multiprocessing Pool.
def _process_one_line(p1, p2, depth, model, cutter, physics):
def _process_one_line((p1, p2, depth, model, cutter, physics)):
if physics:
points = get_free_paths_ode(physics, p1, p2, depth=depth)
else:
......
......@@ -253,7 +253,7 @@ def _handle_tasks(tasks, results, stats, cache, closing):
real_args.append(arg)
stats.add_transfer_time(name, time.time() - start_time)
start_time = time.time()
results.put((job_id, task_id, func(*real_args)))
results.put((job_id, task_id, func(real_args)))
stats.add_process_time(name, time.time() - start_time)
except Queue.Empty:
time.sleep(1.0)
......
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