Cannot open Gerber on Linux

Issue #83 resolved
Juan Pablo Caram repo owner created an issue

Test file: Example1_copper_bottom.gbr

Terminal output:

[DEBUG][MainThread] on_fileopengerber()
[DEBUG][Dummy-2] Running task: {'params': ['/home/jpcaram/flatcam_test_files/Example1_copper_bottom.gbr'], 'fcn': <bound method App.open_gerber of <FlatCAMApp.App object at 0x2f060e0>>}
[DEBUG][Dummy-2] open_gerber()
[DEBUG][Dummy-1] Running task: {'params': ['/home/jpcaram/flatcam_test_files/Example1_copper_bottom.gbr'], 'fcn': <bound method App.open_gerber of <FlatCAMApp.App object at 0x2f060e0>>}
[DEBUG][Dummy-2] new_object()
[DEBUG][Dummy-2] new_object --> OC.get_names()
[DEBUG][Dummy-2] Calling object constructor...
[WARNING] Line ignored (3): %LNCOPPER_BOTTOM*%
[INFO] Found aperture definition. Line 6: %ADD10C, 1.600*%
[INFO] Found aperture definition. Line 7: %ADD11C, 2.000*%
[INFO] Found aperture definition. Line 8: %ADD12C, 1.800*%
[INFO] Found aperture definition. Line 9: %ADD13C, 0.400*%
[INFO] Found aperture definition. Line 10: %ADD14C, 0.100*%
[ERROR] PARSING FAILED. Line 11: %LPD*%
Traceback (most recent call last):
  File "/home/jpcaram/flatcam/FlatCAMWorker.py", line 32, in do_worker_task
    task['fcn'](*task['params'])
  File "/home/jpcaram/flatcam/FlatCAMApp.py", line 1527, in open_gerber
    self.new_object("gerber", name, obj_init)
  File "/home/jpcaram/flatcam/FlatCAMApp.py", line 733, in new_object
    initialize(obj, self)
  File "/home/jpcaram/flatcam/FlatCAMApp.py", line 1515, in obj_init
    gerber_obj.parse_file(filename, follow=follow)
  File "/home/jpcaram/flatcam/camlib.py", line 1072, in parse_file
    self.parse_lines(gstr, follow=follow)
  File "/home/jpcaram/flatcam/camlib.py", line 1486, in parse_lines
    self.solid_geometry = self.solid_geometry.union(cascaded_union(poly_buffer))
  File "/usr/local/lib/python2.7/dist-packages/shapely/ops.py", line 130, in cascaded_union
    return geom_factory(lgeos.methods['cascaded_union'](collection))
  File "/usr/local/lib/python2.7/dist-packages/shapely/geometry/base.py", line 55, in geom_factory
    raise ValueError("No Shapely geometry can be created from null value")
ValueError: No Shapely geometry can be created from null value

Comments (7)

  1. Juan Pablo Caram reporter

    Linux Environment:

    • OS: Ubuntu 12.04
    • Python: 2.7.3
    • GEOS: 3.2.2-3ubuntu1
    • Shapely 1.5.1
    >>> cascaded_union([])
    ---------------------------------------------------------------------------
    ValueError                                Traceback (most recent call last)
    /home/jpcaram/flatcam/<ipython-input-2-0c768f786c71> in <module>()
    ----> 1 cascaded_union([])
    
    /usr/local/lib/python2.7/dist-packages/shapely/ops.pyc in cascaded_union(self, geoms)
        128             subs[i] = g._geom
        129         collection = lgeos.GEOSGeom_createCollection(6, subs, L)
    --> 130         return geom_factory(lgeos.methods['cascaded_union'](collection))
        131 
        132     def unary_union(self, geoms):
    
    /usr/local/lib/python2.7/dist-packages/shapely/geometry/base.pyc in geom_factory(g, parent)
         53     # Abstract geometry factory for use with topological methods below
    
         54     if not g:
    ---> 55         raise ValueError("No Shapely geometry can be created from null value")
         56     ob = BaseGeometry()
         57     geom_type = geometry_type_name(g)
    
    ValueError: No Shapely geometry can be created from null value
    
    >>> unary_union([])
    ---------------------------------------------------------------------------
    KeyError                                  Traceback (most recent call last)
    /home/jpcaram/flatcam/<ipython-input-5-9089513baa4e> in <module>()
    ----> 1 unary_union([])
    
    /usr/local/lib/python2.7/dist-packages/shapely/ops.pyc in unary_union(self, geoms)
        146             subs[i] = g._geom
        147         collection = lgeos.GEOSGeom_createCollection(6, subs, L)
    --> 148         return geom_factory(lgeos.methods['unary_union'](collection))
        149 
        150 operator = CollectionOperator()
    
    KeyError: 'unary_union'
    
  2. Juan Pablo Caram reporter

    Windows environment:

    • OS: Windows 7
    • Python: 2.7.6
    • Shapely 1.3.0 (Installer including GEOS)
    >>> cascaded_union([])
    <shapely.geometry.collection.GeometryCollection at 0x7708830>
    
    >>> unary_union([])
    <shapely.geometry.collection.GeometryCollection at 0x7708ab0>
    
  3. Log in to comment