Menu

Unexpected exception

Help
2011-07-27
2013-03-08
  • Jim Thurgood

    Jim Thurgood - 2011-07-27

    I generated a drawing with DoubleCAD XT and saved as a DXF (Various versions) but PyCam crashes loading these files.   I saved the same drawing as SVG and PyCam will then load it without error, however I get this message when generating the toolpath:
    An unexpected exception occoured: please send the text below to the developers of PyCAM. Thanks a lot!
    Traceback (most recent call last):
      File "pyinstaller\build\pyi.win32\pycam\outPYZ5.pyz/pycam.Gui.Project", line 4041, in generate_toolpath
      File "pyinstaller\build\pyi.win32\pycam\outPYZ5.pyz/pycam.Toolpath.Generator", line 62, in generate_toolpath_from_settings
      File "pyinstaller\build\pyi.win32\pycam\outPYZ5.pyz/pycam.Toolpath.Generator", line 226, in generate_toolpath
      File "pyinstaller\build\pyi.win32\pycam\outPYZ5.pyz/pycam.Geometry.Model", line 683, in get_offset_model
      File "pyinstaller\build\pyi.win32\pycam\outPYZ5.pyz/pycam.Geometry.Polygon", line 965, in get_offset_polygons
      File "pyinstaller\build\pyi.win32\pycam\outPYZ5.pyz/pycam.Geometry.Polygon", line 911, in simplify_polygon_intersections
    IndexError: list index out of range

     
  • Lars

    Lars - 2011-07-27

    Hi Jim,

    thanks for reporting this issue!

    Please send me one of these DXF files, that caused PyCAM to crash - I am very insterested in improving the robustness of the file format importers. Just use my sourceforge mail address.

    Regarding the exception:
    please try to apply the following patch:

    --- src/pycam/Geometry/Polygon.py   (Revision 1101)
    +++ src/pycam/Geometry/Polygon.py   (Arbeitskopie)
    @@ -904,8 +904,10 @@
                         groups = []
                         last_start = 0
                         for group_start in group_starts:
    -                        groups.append(new_group[last_start:group_start])
    -                        last_start = group_start
    +                        if last_start != group_start:
    +                            # avoid empty groups
    +                            groups.append(new_group[last_start:group_start])
    +                            last_start = group_start
                         # Add the remaining lines to the first group or as a new
                         # group.
                         if groups[0][0].p1 == new_group[-1].p2:
    

    I think, this should fix the issue, but I could not test it here.
    Please send me the offending SVG file and describe your task settings, if the above patch does not help!

    cheers,
    Lars

     

Log in to post a comment.