Commit 06c8ac1b authored by sumpfralle's avatar sumpfralle

added warning for ContourFollow strategy combined with non-cylindrical cutter shape

recued log level for GTK message windows from ERROR to WARN (i.e.: more obvious, but also more annoying warnings)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@977 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 1630be10
...@@ -1052,7 +1052,7 @@ class ProjectGui: ...@@ -1052,7 +1052,7 @@ class ProjectGui:
self.no_dialog = no_dialog self.no_dialog = no_dialog
if not self.no_dialog: if not self.no_dialog:
# register a logging handler for displaying error messages # register a logging handler for displaying error messages
pycam.Utils.log.add_gtk_gui(self.window, logging.ERROR) pycam.Utils.log.add_gtk_gui(self.window, logging.WARN)
# register a callback for the log window # register a callback for the log window
pycam.Utils.log.add_hook(self.add_log_message) pycam.Utils.log.add_hook(self.add_log_message)
self.window.show() self.window.show()
......
...@@ -25,6 +25,7 @@ from pycam.PathGenerators import DropCutter, PushCutter, EngraveCutter, \ ...@@ -25,6 +25,7 @@ from pycam.PathGenerators import DropCutter, PushCutter, EngraveCutter, \
from pycam.Geometry.utils import number from pycam.Geometry.utils import number
from pycam.PathProcessors import PathAccumulator, SimpleCutter, ZigZagCutter, \ from pycam.PathProcessors import PathAccumulator, SimpleCutter, ZigZagCutter, \
PolygonCutter, ContourCutter PolygonCutter, ContourCutter
from pycam.Cutters.CylindricalCutter import CylindricalCutter
import pycam.Cutters import pycam.Cutters
import pycam.Toolpath.SupportGrid import pycam.Toolpath.SupportGrid
import pycam.Toolpath.MotionGrid import pycam.Toolpath.MotionGrid
...@@ -239,10 +240,10 @@ def generate_toolpath(model, tool_settings=None, ...@@ -239,10 +240,10 @@ def generate_toolpath(model, tool_settings=None,
if result is None: if result is None:
return None return None
elif result: elif result:
warning = "The contour model contains colliding line groups. " \ warning = "The contour model contains colliding line groups. " + \
+ "This is not allowed in combination with an " \ "This can cause problems with an engraving offset.\n" + \
+ "engraving offset.\nA collision was detected at " \ "A collision was detected at (%.2f, %.2f, %.2f)." % \
+ "(%.2f, %.2f, %.2f)." % (result.x, result.y, result.z) (result.x, result.y, result.z)
log.warning(warning) log.warning(warning)
else: else:
# no collisions and no user interruption # no collisions and no user interruption
...@@ -425,6 +426,10 @@ def _get_pathgenerator_instance(trimesh_models, contour_model, cutter, ...@@ -425,6 +426,10 @@ def _get_pathgenerator_instance(trimesh_models, contour_model, cutter,
else: else:
return ("Invalid postprocessor (%s) for 'ContourFollow' - it " \ return ("Invalid postprocessor (%s) for 'ContourFollow' - it " \
+ "should be: SimpleCutter") % str(pathprocessor) + "should be: SimpleCutter") % str(pathprocessor)
if not isinstance(cutter, CylindricalCutter):
log.warn("The ContourFollow strategy only works reliably with " + \
"the cylindrical cutter shape. Maybe you should use " + \
"the alternative ContourPolygon strategy instead.")
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