[drawing] Tools stop working and error is thrown.
Issue #120
resolved
Trying to draw a rectangle or circle, on click:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py", line 315, in keyPressEvent
FigureCanvasBase.key_press_event(self, key)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 1816, in key_press_event
self.callbacks.process(s, event)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook.py", line 540, in process
proxy(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook.py", line 415, in __call__
return mtd(*args, **kwargs)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 937, in on_canvas_key
self.active_tool.make()
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 414, in make
self.geometry = DrawToolShape(Polygon(self.points))
File "/usr/local/lib/python2.7/dist-packages/shapely/geometry/polygon.py", line 229, in __init__
self._geom, self._ndim = geos_polygon_from_py(shell, holes)
File "/usr/local/lib/python2.7/dist-packages/shapely/geometry/polygon.py", line 495, in geos_polygon_from_py
geos_shell, ndim = geos_linearring_from_py(shell)
File "/usr/local/lib/python2.7/dist-packages/shapely/geometry/polygon.py", line 440, in geos_linearring_from_py
"A LinearRing must have at least 3 coordinate tuples")
ValueError: A LinearRing must have at least 3 coordinate tuples
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py", line 315, in keyPressEvent
FigureCanvasBase.key_press_event(self, key)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 1816, in key_press_event
self.callbacks.process(s, event)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook.py", line 540, in process
proxy(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook.py", line 415, in __call__
return mtd(*args, **kwargs)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 937, in on_canvas_key
self.active_tool.make()
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 414, in make
self.geometry = DrawToolShape(Polygon(self.points))
File "/usr/local/lib/python2.7/dist-packages/shapely/geometry/polygon.py", line 229, in __init__
self._geom, self._ndim = geos_polygon_from_py(shell, holes)
File "/usr/local/lib/python2.7/dist-packages/shapely/geometry/polygon.py", line 495, in geos_polygon_from_py
geos_shell, ndim = geos_linearring_from_py(shell)
File "/usr/local/lib/python2.7/dist-packages/shapely/geometry/polygon.py", line 440, in geos_linearring_from_py
"A LinearRing must have at least 3 coordinate tuples")
ValueError: A LinearRing must have at least 3 coordinate tuples
[WARNING][MainThread] Did not plot:<type 'NoneType'>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py", line 263, in mousePressEvent
FigureCanvasBase.button_press_event(self, x, y, button)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 1870, in button_press_event
self.callbacks.process(s, mouseevent)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook.py", line 540, in process
proxy(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook.py", line 415, in __call__
return mtd(*args, **kwargs)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 832, in on_canvas_click
self.on_shape_complete()
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 1096, in on_shape_complete
self.add_shape(self.active_tool.geometry)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 727, in add_shape
self.storage.insert(shape)
File "/home/jpcaram/flatcam/camlib.py", line 3542, in insert
super(FlatCAMRTreeStorage, self).insert(idx, obj)
File "/home/jpcaram/flatcam/camlib.py", line 3509, in insert
for pt in self.get_points(obj):
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 50, in get_pts
pts += DrawToolShape.get_pts(o.geo)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 54, in get_pts
pts += DrawToolShape.get_pts(o.exterior)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 60, in get_pts
pts += list(o.coords)
AttributeError: 'NoneType' object has no attribute 'coords'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py", line 263, in mousePressEvent
FigureCanvasBase.button_press_event(self, x, y, button)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 1870, in button_press_event
self.callbacks.process(s, mouseevent)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook.py", line 540, in process
proxy(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook.py", line 415, in __call__
return mtd(*args, **kwargs)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 832, in on_canvas_click
self.on_shape_complete()
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 1096, in on_shape_complete
self.add_shape(self.active_tool.geometry)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 727, in add_shape
self.storage.insert(shape)
File "/home/jpcaram/flatcam/camlib.py", line 3542, in insert
super(FlatCAMRTreeStorage, self).insert(idx, obj)
File "/home/jpcaram/flatcam/camlib.py", line 3509, in insert
for pt in self.get_points(obj):
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 50, in get_pts
pts += DrawToolShape.get_pts(o.geo)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 54, in get_pts
pts += DrawToolShape.get_pts(o.exterior)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 60, in get_pts
pts += list(o.coords)
AttributeError: 'NoneType' object has no attribute 'coords'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py", line 263, in mousePressEvent
FigureCanvasBase.button_press_event(self, x, y, button)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 1870, in button_press_event
self.callbacks.process(s, mouseevent)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook.py", line 540, in process
proxy(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook.py", line 415, in __call__
return mtd(*args, **kwargs)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 832, in on_canvas_click
self.on_shape_complete()
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 1096, in on_shape_complete
self.add_shape(self.active_tool.geometry)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 727, in add_shape
self.storage.insert(shape)
File "/home/jpcaram/flatcam/camlib.py", line 3542, in insert
super(FlatCAMRTreeStorage, self).insert(idx, obj)
File "/home/jpcaram/flatcam/camlib.py", line 3509, in insert
for pt in self.get_points(obj):
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 50, in get_pts
pts += DrawToolShape.get_pts(o.geo)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 54, in get_pts
pts += DrawToolShape.get_pts(o.exterior)
File "/home/jpcaram/flatcam/FlatCAMDraw.py", line 60, in get_pts
pts += list(o.coords)
AttributeError: 'NoneType' object has no attribute 'coords'
Comments (3)
-
reporter -
reporter The "edit geometry" button calls
self.draw.edit_fcgeometry(self.collection.get_active())
which in turn callsself.connect_canvas_event_handlers()
. So they get connected twice. -
reporter - changed status to resolved
Fixes
#120.→ <<cset 5e45699c35a5>>
- Log in to comment
Happens after clicking on edit when there is geometry already in the editor. Reproduced the problem without the tracebacks shown earlier.