Commit f0f75288 authored by sumpfralle's avatar sumpfralle

fixed some wrong variable names

removed obsolete "reverse" option


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@774 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 4a5e4cda
...@@ -252,7 +252,7 @@ def generate_toolpath(model, tool_settings=None, ...@@ -252,7 +252,7 @@ def generate_toolpath(model, tool_settings=None,
if isinstance(physics, basestring): if isinstance(physics, basestring):
return physics return physics
generator = _get_pathgenerator_instance(trimesh_models, contour_model, generator = _get_pathgenerator_instance(trimesh_models, contour_model,
cutter, path_generator, path_postprocessor, milling_style, physics) cutter, path_generator, path_postprocessor, physics)
if isinstance(generator, basestring): if isinstance(generator, basestring):
return generator return generator
if (overlap < 0) or (overlap >= 1): if (overlap < 0) or (overlap >= 1):
...@@ -306,16 +306,15 @@ def generate_toolpath(model, tool_settings=None, ...@@ -306,16 +306,15 @@ def generate_toolpath(model, tool_settings=None,
return toolpath return toolpath
def _get_pathgenerator_instance(trimesh_models, contour_model, cutter, def _get_pathgenerator_instance(trimesh_models, contour_model, cutter,
pathgenerator, pathprocessor, reverse, physics): pathgenerator, pathprocessor, physics):
if pathgenerator != "EngraveCutter" and contour_model: if pathgenerator != "EngraveCutter" and contour_model:
return ("The only available toolpath strategy for 2D contour models " \ return ("The only available toolpath strategy for 2D contour models " \
+ "is 'Engraving'.") + "is 'Engraving'.")
if pathgenerator == "DropCutter": if pathgenerator == "DropCutter":
if pathprocessor == "ZigZagCutter": if pathprocessor == "ZigZagCutter":
processor = pycam.PathProcessors.PathAccumulator(zigzag=True, processor = pycam.PathProcessors.PathAccumulator(zigzag=True)
reverse=reverse)
elif pathprocessor == "PathAccumulator": elif pathprocessor == "PathAccumulator":
processor = pycam.PathProcessors.PathAccumulator(reverse=reverse) processor = pycam.PathProcessors.PathAccumulator()
else: else:
return ("Invalid postprocessor (%s) for 'DropCutter': only " \ return ("Invalid postprocessor (%s) for 'DropCutter': only " \
+ "'ZigZagCutter' or 'PathAccumulator' are allowed") \ + "'ZigZagCutter' or 'PathAccumulator' are allowed") \
...@@ -324,26 +323,26 @@ def _get_pathgenerator_instance(trimesh_models, contour_model, cutter, ...@@ -324,26 +323,26 @@ def _get_pathgenerator_instance(trimesh_models, contour_model, cutter,
physics=physics) physics=physics)
elif pathgenerator == "PushCutter": elif pathgenerator == "PushCutter":
if pathprocessor == "PathAccumulator": if pathprocessor == "PathAccumulator":
processor = pycam.PathProcessors.PathAccumulator(reverse=reverse) processor = pycam.PathProcessors.PathAccumulator()
elif pathprocessor == "SimpleCutter": elif pathprocessor == "SimpleCutter":
processor = pycam.PathProcessors.SimpleCutter(reverse=reverse) processor = pycam.PathProcessors.SimpleCutter()
elif pathprocessor == "ZigZagCutter": elif pathprocessor == "ZigZagCutter":
processor = pycam.PathProcessors.ZigZagCutter(reverse=reverse) processor = pycam.PathProcessors.ZigZagCutter()
elif pathprocessor == "PolygonCutter": elif pathprocessor == "PolygonCutter":
processor = pycam.PathProcessors.PolygonCutter(reverse=reverse) processor = pycam.PathProcessors.PolygonCutter()
elif pathprocessor == "ContourCutter": elif pathprocessor == "ContourCutter":
processor = pycam.PathProcessors.ContourCutter(reverse=reverse) processor = pycam.PathProcessors.ContourCutter()
else: else:
return ("Invalid postprocessor (%s) for 'PushCutter' - it should " \ return ("Invalid postprocessor (%s) for 'PushCutter' - it should " \
+ "be one of these: %s") % (processor, PATH_POSTPROCESSORS) + "be one of these: %s") % (pathprocessor, PATH_POSTPROCESSORS)
return PushCutter.PushCutter(cutter, trimesh_models, processor, return PushCutter.PushCutter(cutter, trimesh_models, processor,
physics=physics) physics=physics)
elif pathgenerator == "EngraveCutter": elif pathgenerator == "EngraveCutter":
if pathprocessor == "SimpleCutter": if pathprocessor == "SimpleCutter":
processor = pycam.PathProcessors.SimpleCutter(reverse=reverse) processor = pycam.PathProcessors.SimpleCutter()
else: else:
return ("Invalid postprocessor (%s) for 'EngraveCutter' - it " \ return ("Invalid postprocessor (%s) for 'EngraveCutter' - it " \
+ "should be: SimpleCutter") % str(processor) + "should be: SimpleCutter") % str(pathprocessor)
if not contour_model: if not contour_model:
return "The 'Engraving' toolpath strategy requires a 2D contour " \ return "The 'Engraving' toolpath strategy requires a 2D contour " \
+ "model (e.g. from a DXF or SVG file)." + "model (e.g. from a DXF or SVG file)."
...@@ -351,10 +350,10 @@ def _get_pathgenerator_instance(trimesh_models, contour_model, cutter, ...@@ -351,10 +350,10 @@ def _get_pathgenerator_instance(trimesh_models, contour_model, cutter,
contour_model, processor, physics=physics) contour_model, processor, physics=physics)
elif pathgenerator == "ContourFollow": elif pathgenerator == "ContourFollow":
if pathprocessor == "SimpleCutter": if pathprocessor == "SimpleCutter":
processor = pycam.PathProcessors.SimpleCutter(reverse=reverse) processor = pycam.PathProcessors.SimpleCutter()
else: else:
return ("Invalid postprocessor (%s) for 'ContourFollow' - it " \ return ("Invalid postprocessor (%s) for 'ContourFollow' - it " \
+ "should be: SimpleCutter") % str(processor) + "should be: SimpleCutter") % str(pathprocessor)
return ContourFollow.ContourFollow(cutter, trimesh_models, processor, return ContourFollow.ContourFollow(cutter, trimesh_models, processor,
physics=physics) physics=physics)
else: else:
......
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