- fixed a bug in Panelize Plugin where the Geometry objects could not be panelized
- fixed some more Shapely 2.0 deprecation warnings in the Panelize Plugin
This commit is contained in:
@@ -11,6 +11,8 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
- updated the language strings
|
- updated the language strings
|
||||||
- updated the Italian (Massimiliano Golfetto) and Turkish (Mehmet Kaya) translations
|
- updated the Italian (Massimiliano Golfetto) and Turkish (Mehmet Kaya) translations
|
||||||
|
- fixed a bug in Panelize Plugin where the Geometry objects could not be panelized
|
||||||
|
- fixed some more Shapely 2.0 deprecation warnings in the Panelize Plugin
|
||||||
|
|
||||||
20.11.2021
|
20.11.2021
|
||||||
|
|
||||||
|
|||||||
@@ -528,7 +528,7 @@ class ShapeCollectionVisual(CompoundVisual):
|
|||||||
self.update_lock.acquire(True)
|
self.update_lock.acquire(True)
|
||||||
|
|
||||||
# Merge shapes buffers
|
# Merge shapes buffers
|
||||||
for data in self.data.values():
|
for data in list(self.data.values()):
|
||||||
if data['visible'] and 'line_pts' in data:
|
if data['visible'] and 'line_pts' in data:
|
||||||
try:
|
try:
|
||||||
line_pts[data['layer']] += data['line_pts']
|
line_pts[data['layer']] += data['line_pts']
|
||||||
|
|||||||
@@ -545,14 +545,16 @@ class Panelize(AppTool):
|
|||||||
for tool in panel_source_obj.tools:
|
for tool in panel_source_obj.tools:
|
||||||
try:
|
try:
|
||||||
source_geo = panel_source_obj.tools[tool]['solid_geometry']
|
source_geo = panel_source_obj.tools[tool]['solid_geometry']
|
||||||
work_geo = source_geo.geoms if isinstance(source_geo, MultiPolygon) else source_geo
|
work_geo = source_geo.geoms if \
|
||||||
|
isinstance(source_geo, (MultiPolygon, MultiLineString)) else source_geo
|
||||||
geo_len += len(work_geo)
|
geo_len += len(work_geo)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
geo_len += 1
|
geo_len += 1
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
source_geo = panel_source_obj.solid_geometry
|
source_geo = panel_source_obj.solid_geometry
|
||||||
work_geo = source_geo.geoms if isinstance(source_geo, MultiPolygon) else source_geo
|
work_geo = source_geo.geoms if \
|
||||||
|
isinstance(source_geo, (MultiPolygon, MultiLineString)) else source_geo
|
||||||
geo_len = len(work_geo)
|
geo_len = len(work_geo)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
geo_len = 1
|
geo_len = 1
|
||||||
@@ -584,11 +586,13 @@ class Panelize(AppTool):
|
|||||||
|
|
||||||
# calculate the number of polygons
|
# calculate the number of polygons
|
||||||
try:
|
try:
|
||||||
source_geo = panel_source_obj.tools[tool]['geometry']
|
source_geo = panel_source_obj.tools[tool]['solid_geometry']
|
||||||
work_geo = source_geo.geoms if isinstance(source_geo,
|
work_geo = source_geo.geoms if \
|
||||||
MultiPolygon) else source_geo
|
isinstance(source_geo, (MultiPolygon, MultiLineString)) else source_geo
|
||||||
geo_len = len(work_geo)
|
geo_len = len(work_geo)
|
||||||
except TypeError:
|
except TypeError as err:
|
||||||
|
self.app.log.error(
|
||||||
|
"Panelize.on_panelize.panelize_worker() -> %s" % str(err))
|
||||||
geo_len = 1
|
geo_len = 1
|
||||||
|
|
||||||
# panelization
|
# panelization
|
||||||
@@ -596,7 +600,9 @@ class Panelize(AppTool):
|
|||||||
|
|
||||||
trans_geo = translate_recursion(panel_source_obj.tools[tool]['solid_geometry'])
|
trans_geo = translate_recursion(panel_source_obj.tools[tool]['solid_geometry'])
|
||||||
try:
|
try:
|
||||||
for trans_it in trans_geo:
|
work_geo = trans_geo.geoms if \
|
||||||
|
isinstance(trans_geo, (MultiPolygon, MultiLineString)) else trans_geo
|
||||||
|
for trans_it in work_geo:
|
||||||
if not trans_it.is_empty:
|
if not trans_it.is_empty:
|
||||||
new_obj.tools[tool]['solid_geometry'].append(trans_it)
|
new_obj.tools[tool]['solid_geometry'].append(trans_it)
|
||||||
|
|
||||||
@@ -629,7 +635,8 @@ class Panelize(AppTool):
|
|||||||
# calculate the number of polygons
|
# calculate the number of polygons
|
||||||
try:
|
try:
|
||||||
source_geo = panel_source_obj.solid_geometry
|
source_geo = panel_source_obj.solid_geometry
|
||||||
work_geo = source_geo.geoms if isinstance(source_geo, MultiPolygon) else source_geo
|
work_geo = source_geo.geoms if \
|
||||||
|
isinstance(source_geo, (MultiPolygon, MultiLineString)) else source_geo
|
||||||
geo_len = len(work_geo)
|
geo_len = len(work_geo)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
geo_len = 1
|
geo_len = 1
|
||||||
@@ -637,7 +644,10 @@ class Panelize(AppTool):
|
|||||||
# panelization
|
# panelization
|
||||||
pol_nr = 0
|
pol_nr = 0
|
||||||
try:
|
try:
|
||||||
for geo_el in panel_source_obj.solid_geometry:
|
sol_geo = panel_source_obj.solid_geometry
|
||||||
|
work_geo = sol_geo.geoms if \
|
||||||
|
isinstance(sol_geo, (MultiPolygon, MultiLineString)) else sol_geo
|
||||||
|
for geo_el in work_geo:
|
||||||
if app_obj.abort_flag:
|
if app_obj.abort_flag:
|
||||||
# graceful abort requested by the user
|
# graceful abort requested by the user
|
||||||
raise grace
|
raise grace
|
||||||
|
|||||||
Reference in New Issue
Block a user