TypeError: unhashable type: 'LinearRing'

Issue #163 resolved
Yuri Plaksyuk created an issue
  1. Imported Gerber copper layer - OK
  2. Generated Geometry - OK
  3. Selected Geometry Object - OK
  4. Create CNC Job - FAILED
[ERROR][Dummy-1] Abnormal termination of process!

[ERROR][Dummy-1] <type 'exceptions.TypeError'>

[ERROR][Dummy-1] unhashable type: 'LinearRing'

[ERROR][Dummy-1] <traceback object at 0x116a5d488>
Traceback (most recent call last):

  File "/Users/master/Downloads/FlatCAM-8.3/FlatCAMWorker.py", line 32, in do_worker_task
    task['fcn'](*task['params'])

  File "/Users/master/Downloads/FlatCAM-8.3/FlatCAMObj.py", line 1069, in job_thread
    app_obj.new_object("cncjob", outname, job_init)

  File "/Users/master/Downloads/FlatCAM-8.3/FlatCAMApp.py", line 780, in new_object
    initialize(obj, self)

  File "/Users/master/Downloads/FlatCAM-8.3/FlatCAMObj.py", line 1059, in job_init
    job_obj.generate_from_geometry_2(self, tolerance=0.0005)

  File "/Users/master/Downloads/FlatCAM-8.3/camlib.py", line 2629, in generate_from_geometry_2
    storage.insert(shape)

  File "/Users/master/Downloads/FlatCAM-8.3/camlib.py", line 3541, in insert
    self.indexes[obj] = idx
TypeError: unhashable type: 'LinearRing'

Platform:

OS X Yosemite version 10.10.5

python 2.7.10_2

shapely-1.5.13

Followed installation instructions on your site.

Comments (14)

  1. Juan Pablo Caram repo owner

    Can you please attach the gerber file that causes the problem and indicate the exact values entered when creating the geometry object and when generating the CNC Job?

    Also please indicate which version of FlatCAM you were using. Was is a release or the development source?

  2. Juan Pablo Caram repo owner

    Please provide details on how you create the geometry (exact values and procedure) and the same for the CNC Job.

  3. Juan Pablo Caram repo owner

    These are my results (for which the problem does not occur):

    Platform Linux 3.16.0-50-generic
    Distro ('Ubuntu', '14.04', 'trusty')
    Python 2.7.6
    rtree 0.8.2
    shapely 1.5.12
    GEOS library (3, 4, 2)
    Qt 4.8.6
    Numpy 1.9.2
    MatPlotLib 1.4.3
    MPL Numpy 1.6
    
  4. Yuri Plaksyuk reporter

    These are my results:

    Platform Darwin 14.5.0
    Distro ('', '', '')
    Python 2.7.10
    rtree 0.8.2
    shapely 1.5.13
    GEOS library (3, 4, 2)
    Qt 4.8.7
    Numpy 1.10.1
    MatPlotLib 1.4.3
    MPL Numpy 1.6
    
  5. Juan Pablo Caram repo owner

    A feature in Shapely that FlatCAM uses has been removed. This will break several features in FlatCAM if upgrading Shapely beyond 1.5.12.

    Specifically, geometries in shapely had a __hash__ method, which permitted them to be indexes in a dictionary, ie. mydict[a_shappely_geo]. Now that method has been removed.

    The workaround is to downgrade your Shapely version until this problem is fixed.

  6. Juan Pablo Caram repo owner

    @yplaksyuk could you please try downgrading Shapely to 1.5.12? I think you just need to do pip uninstall Shapely, then pip install -Iv Shapely==1.5.12.

  7. Log in to comment