Commit 8b0686e1 authored by sumpfralle's avatar sumpfralle

fixed engraving of a single plane with minz==maxz


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@965 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 57129bb8
...@@ -78,8 +78,19 @@ class EngraveCutter: ...@@ -78,8 +78,19 @@ class EngraveCutter:
line_groups = self.contour_model.get_polygons() line_groups = self.contour_model.get_polygons()
# push slices for all layers above ground # push slices for all layers above ground
if maxz == minz:
# only one layer - use PushCutter instead of DropCutter
# put "last_z" clearly above the model plane
last_z = maxz + 1
push_steps = z_steps
drop_steps = []
else:
# multiple layers
last_z = maxz last_z = maxz
for z in z_steps[:-1]: push_steps = z_steps[:-1]
drop_steps = [z_steps[-1]]
for z in push_steps:
# update the progress bar and check, if we should cancel the process # update the progress bar and check, if we should cancel the process
if draw_callback and draw_callback(text="Engrave: processing" \ if draw_callback and draw_callback(text="Engrave: processing" \
+ " layer %d/%d" % (current_layer, num_of_layers)): + " layer %d/%d" % (current_layer, num_of_layers)):
...@@ -135,12 +146,13 @@ class EngraveCutter: ...@@ -135,12 +146,13 @@ class EngraveCutter:
return 0 return 0
line_groups.sort(cmp=polygon_priority) line_groups.sort(cmp=polygon_priority)
for z in drop_steps:
# process the final layer with a drop cutter # process the final layer with a drop cutter
for line_group in self.contour_model.get_polygons(): for line_group in self.contour_model.get_polygons():
self.pa_drop.new_direction(0) self.pa_drop.new_direction(0)
self.pa_drop.new_scanline() self.pa_drop.new_scanline()
for line in line_group.get_lines(): for line in line_group.get_lines():
self.GenerateToolPathLineDrop(self.pa_drop, line, minz, maxz, self.GenerateToolPathLineDrop(self.pa_drop, line, z, maxz,
horiz_step, last_z, draw_callback=draw_callback) horiz_step, last_z, draw_callback=draw_callback)
if progress_counter.increment(): if progress_counter.increment():
# quit requested # quit requested
...@@ -151,6 +163,7 @@ class EngraveCutter: ...@@ -151,6 +163,7 @@ class EngraveCutter:
# break the outer loop if requested # break the outer loop if requested
if quit_requested: if quit_requested:
break break
last_z = z
self.pa_drop.finish() self.pa_drop.finish()
return self.pa_push.paths + self.pa_drop.paths return self.pa_push.paths + self.pa_drop.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