Show messages and errors in TCL shell. Better exception handling and reporting when opening files.
This commit is contained in:
19
camlib.py
19
camlib.py
@@ -158,6 +158,16 @@ class Geometry(object):
|
||||
log.error("Failed to run union on polylines.")
|
||||
raise
|
||||
|
||||
def is_empty(self):
|
||||
|
||||
if isinstance(self.solid_geometry, BaseGeometry):
|
||||
return self.solid_geometry.is_empty
|
||||
|
||||
if isinstance(self.solid_geometry, list):
|
||||
return len(self.solid_geometry) == 0
|
||||
|
||||
raise Exception("self.solid_geometry is neither BaseGeometry or list.")
|
||||
|
||||
def subtract_polygon(self, points):
|
||||
"""
|
||||
Subtract polygon from the given object. This only operates on the paths in the original geometry, i.e. it converts polygons into paths.
|
||||
@@ -390,15 +400,6 @@ class Geometry(object):
|
||||
"""
|
||||
return self.solid_geometry.buffer(offset)
|
||||
|
||||
def is_empty(self):
|
||||
if self.solid_geometry is None:
|
||||
return True
|
||||
|
||||
if type(self.solid_geometry) is list and len(self.solid_geometry) == 0:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def import_svg(self, filename, flip=True):
|
||||
"""
|
||||
Imports shapes from an SVG file into the object's geometry.
|
||||
|
||||
Reference in New Issue
Block a user