Fix limitations in AddSlabFromWalls operator.

- The operator is now unaffected by the order in which walls are joined.
- It has been updated to support split walls.
This commit is contained in:
Bruno Perdigão
2024-12-23 17:58:08 -03:00
parent d44942fbae
commit 75483edb22
2 changed files with 43 additions and 41 deletions
+4 -7
View File
@@ -103,7 +103,7 @@ class DumbSlabGenerator:
return self.create_slab()
def derive_from_walls(self):
walls, is_closed_loop = tool.Model.get_connected_walls(bpy.context.selected_objects)
walls = tool.Model.get_connected_walls(bpy.context.selected_objects)
polyline_points = []
poly = tool.Model.get_polygons_from_wall_axis(walls)
polyline_points = [tuple([v for v in c]) for c in poly.exterior.coords]
@@ -768,12 +768,9 @@ class AddSlabFromWall(bpy.types.Operator, tool.Ifc.Operator):
def _execute(self, context):
if not self.relating_type:
return {"FINISHED"}
walls, is_closed_loop = tool.Model.get_connected_walls(bpy.context.selected_objects)
if not is_closed_loop:
self.report(
{"WARNING"},
"Please select a closed loop of walls, or deselect the walls to add a slab using the polyline tool.",
)
walls = tool.Model.get_connected_walls(bpy.context.selected_objects)
if not walls:
self.report({"WARNING"}, "Please select a closed loop of walls, or deselect the walls to add a slab using the polyline tool.")
return {"FINISHED"}
DumbSlabGenerator(self.relating_type).generate("WALLS")