- fixed a performance issue in panelize Tcl command: when panelizing a Geometry object the total solid_geometry was calculated for each tool, but it was enough to be calculated once

This commit is contained in:
Marius Stanciu
2022-01-31 21:59:19 +02:00
committed by Marius
parent 9df8e215bf
commit 0276f6cfbb
3 changed files with 15 additions and 14 deletions

View File

@@ -20,7 +20,7 @@ class TclCommandBounds(TclCommand):
"""
# List of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon)
# List of all command aliases, to be able to use old names for backward compatibility (add_poly, add_polygon)
aliases = ['get_bounds', 'bounds']
description = '%s %s' % ("--", "Return in the console a list of bounds values for a list of objects.")

View File

@@ -331,19 +331,19 @@ class TclCommandPanelize(TclCommand):
if not trans_geo.is_empty:
obj_fin.tools[tool]['solid_geometry'].append(trans_geo)
# #############################################################################
# ########## Panelize the solid_geometry - always done #####################
# #############################################################################
try:
sol_geo = obj.solid_geometry
work_geo = sol_geo.geoms if \
isinstance(sol_geo, (MultiPolygon, MultiLineString)) else sol_geo
for geo_el in work_geo:
trans_geo = translate_recursion(geo_el)
obj_fin.solid_geometry.append(trans_geo)
except TypeError:
trans_geo = translate_recursion(obj.solid_geometry)
# #############################################################################
# ########## Panelize the solid_geometry - always done #####################
# #############################################################################
try:
sol_geo = obj.solid_geometry
work_geo = sol_geo.geoms if \
isinstance(sol_geo, (MultiPolygon, MultiLineString)) else sol_geo
for geo_el in work_geo:
trans_geo = translate_recursion(geo_el)
obj_fin.solid_geometry.append(trans_geo)
except TypeError:
trans_geo = translate_recursion(obj.solid_geometry)
obj_fin.solid_geometry.append(trans_geo)
else:
obj_fin.solid_geometry.append(
translate_recursion(obj.solid_geometry)