Fix covering operators to unpack tuple return from get_space_polygon_from_context_visible_objects

Three covering core functions (add_instance_flooring_covering_from_cursor,
add_instance_ceiling_covering_from_cursor, regen_selected_covering_object)
used the old single-value assignment from
get_space_polygon_from_context_visible_objects, which now returns a
(polygon, bounding_walls) tuple. The isinstance(str) guard never fired,
causing the tuple to flow into set_covering_representation_from_polygon
and raise a shapely error.

Fix by unpacking space_polygon, _ at all three call sites.

Generated with the assistance of an AI coding tool.
This commit is contained in:
CyrilWaechter
2026-08-02 00:12:08 +02:00
parent 3e6460eceb
commit 53084ca94c
+3 -3
View File
@@ -46,7 +46,7 @@ def add_instance_flooring_covering_from_cursor(
else: else:
x, y, z, h, mat = spatial.get_x_y_z_h_mat_from_cursor() x, y, z, h, mat = spatial.get_x_y_z_h_mat_from_cursor()
space_polygon = spatial.get_space_polygon_from_context_visible_objects(x, y) space_polygon, _ = spatial.get_space_polygon_from_context_visible_objects(x, y)
if isinstance(space_polygon, str): if isinstance(space_polygon, str):
return return
@@ -81,7 +81,7 @@ def add_instance_ceiling_covering_from_cursor(
x, y, z, h, mat = spatial.get_x_y_z_h_mat_from_cursor() x, y, z, h, mat = spatial.get_x_y_z_h_mat_from_cursor()
ceiling_height = covering.get_z_from_ceiling_height() ceiling_height = covering.get_z_from_ceiling_height()
space_polygon = spatial.get_space_polygon_from_context_visible_objects(x, y) space_polygon, _ = spatial.get_space_polygon_from_context_visible_objects(x, y)
if isinstance(space_polygon, str): if isinstance(space_polygon, str):
return return
@@ -106,7 +106,7 @@ def regen_selected_covering_object(root: type[tool.Root], spatial: type[tool.Spa
else: else:
assert False, "Object has to be active and selected." assert False, "Object has to be active and selected."
space_polygon = spatial.get_space_polygon_from_context_visible_objects(x, y) space_polygon, _ = spatial.get_space_polygon_from_context_visible_objects(x, y)
if isinstance(space_polygon, str): if isinstance(space_polygon, str):
return return