- fixed issue when exporting DXF and not settings the units

- added the posibility to export the Geometry in different DXF formats (previously it was hard coded to the AutoCAD 2010): R12, R2000, R2004, R2007, R2010, R2013, R2018
- fixed the camlib.Geometry.bounds() method such that it is calculated correctly for Geometry objects created in the Geometry Editor
This commit is contained in:
Marius Stanciu
2021-03-11 04:50:41 +02:00
committed by Marius
parent d464c1e18a
commit 2f57e97a21
7 changed files with 82 additions and 6 deletions

View File

@@ -748,10 +748,6 @@ class Geometry(object):
self.app.log.debug("camlib.Geometry.bounds()")
if self.solid_geometry is None:
self.app.log.debug("solid_geometry is None")
return 0, 0, 0, 0
def bounds_rec(obj):
if type(obj) is list:
gminx = np.Inf
@@ -805,8 +801,16 @@ class Geometry(object):
maxx_list.append(maxx)
maxy_list.append(maxy)
if not minx_list and not miny_list and not maxx_list and not maxy_list:
self.app.log.debug("solid_geometry is None")
return 0, 0, 0, 0
return min(minx_list), min(miny_list), max(maxx_list), max(maxy_list)
else:
if self.solid_geometry is None:
self.app.log.debug("solid_geometry is None")
return 0, 0, 0, 0
if flatten:
self.flatten(reset=True)
self.solid_geometry = self.flat_geometry