fix generate spaces from walls bug

This commit is contained in:
Massimo Fabbro
2023-09-27 18:51:37 +02:00
parent 4a507c0827
commit 06b5982b59
2 changed files with 6 additions and 5 deletions
+5 -3
View File
@@ -125,7 +125,9 @@ def select_decomposed_elements(spatial):
#HERE STARTS SPATIAL TOOL
def generate_spaces_from_walls(ifc, spatial, collector):
container, active_obj = spatial.get_container_and_active_obj()
active_obj = bpy.context.active_object
element = ifc.get_entity(active_obj)
container = spatial.get_container(element)
if not active_obj:
self.report({"ERROR"}, "No active object. Please select a wall")
@@ -147,12 +149,12 @@ def generate_spaces_from_walls(ifc, spatial, collector):
h = active_obj.dimensions.z
selected_objects = bpy.context.selected_objects
union = spatial.get_union_shape_from_selected_objects(selected_objects)
union = spatial.get_union_shape_from_selected_objects()
for i, linear_ring in enumerate(union.interiors):
poly = spatial.get_buffered_poly_from_linear_ring(linear_ring)
bm = spatial.get_bmesh_from_polygon(poly, mat, h)
bm = spatial.get_bmesh_from_polygon(poly, h)
name = "Space" + str(i)
mesh = bpy.data.meshes.new(name=name)
+1 -2
View File
@@ -810,8 +810,7 @@ class Spatial:
def set_relative_object_matrix(cls, target_obj, relative_to_obj, matrix): pass
def show_scene_objects(cls): pass
#HERE STARTS SPATIAL TOOL
# def get_container_and_active_obj(cls): pass
def get_union_shape_from_selected_objects(cls, selected_objects): pass
def get_union_shape_from_selected_objects(cls): pass
def get_boundary_elements(cls, selected_objects): pass
def get_polygons(cls, boundary_elements): pass
def get_obj_base_points(cls, obj): pass