Commit 9cf25fa2 authored by sumpfralle's avatar sumpfralle

changed behaviour of PolygonCutter and ContourCutter:

 * "finish" now appends new toolpath segments to previous ones (before: previous ones were thrown away)
 * now all PathProcessors keep previous toolpaths after calling "finish"


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@467 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent ccaad2f1
......@@ -59,7 +59,6 @@ class EngraveCutter:
z_steps = [minz]
num_of_layers = len(z_steps)
paths = []
current_layer = 0
num_of_lines = len(self.contour_model.get_lines())
progress_counter = ProgressCounter(len(z_steps) * num_of_lines,
......@@ -81,21 +80,20 @@ class EngraveCutter:
if progress_counter.increment():
# cancel requested
quit_requested = True
# finish the current path
self.pa_push.finish()
break
self.pa_push.finish()
# the path accumulator will be reset for each slice - we need to store the result
if self.pa_push.paths:
paths += self.pa_push.paths
# break the outer loop if requested
if quit_requested:
break
current_layer += 1
if quit_requested:
return paths
return self.pa_push.paths
if draw_callback:
draw_callback(text="Engrave: processing layer %d/%d" \
......@@ -118,11 +116,8 @@ class EngraveCutter:
if quit_requested:
break
self.pa_drop.finish()
# the path accumulator will be reset for each slice - we need to store the result
if self.pa_drop.paths:
paths += self.pa_drop.paths
return paths
return self.pa_push.paths + self.pa_drop.paths
def GenerateToolPathLinePush(self, pa, line, z, draw_callback=None):
p1 = Point(line.p1.x, line.p1.y, z)
......
......@@ -53,8 +53,6 @@ class PushCutter:
progress_counter = ProgressCounter(num_of_layers * lines_per_layer,
draw_callback)
paths = []
current_layer = 0
z_steps = [(maxz - i * z_step) for i in range(num_of_layers)]
......@@ -77,13 +75,9 @@ class PushCutter:
self.pa.end_direction()
self.pa.finish()
# the path accumulator will be reset for each slice - we need to store the result
if self.pa.paths:
paths += self.pa.paths
current_layer += 1
return paths
return self.pa.paths
def GenerateToolPathSlice(self, minx, maxx, miny, maxy, z, dx, dy,
draw_callback=None, progress_counter=None):
......
......@@ -55,16 +55,14 @@ class ContourCutter:
def finish(self):
self.pe.finish()
if self.pe.merge_path_list:
self.paths = self.pe.merge_path_list
for p in self.paths:
p.append(p.points[0])
else:
if self.pe.hor_path_list:
self.paths = self.pe.hor_path_list
paths = self.pe.merge_path_list
elif self.pe.hor_path_list:
paths = self.pe.hor_path_list
else:
self.paths = self.pe.ver_path_list
if self.paths:
for p in self.paths:
paths = self.pe.ver_path_list
if paths:
for p in paths:
p.append(p.points[0])
self.paths.extend(paths)
self.pe = None
......@@ -65,5 +65,5 @@ class PolygonCutter:
p.append(points[-i-1])
p.append(points[i])
paths.append(p)
self.paths = paths
self.paths.extend(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