mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
fix generate spaces from walls bug
This commit is contained in:
@@ -125,7 +125,9 @@ def select_decomposed_elements(spatial):
|
|||||||
#HERE STARTS SPATIAL TOOL
|
#HERE STARTS SPATIAL TOOL
|
||||||
|
|
||||||
def generate_spaces_from_walls(ifc, spatial, collector):
|
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:
|
if not active_obj:
|
||||||
self.report({"ERROR"}, "No active object. Please select a wall")
|
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
|
h = active_obj.dimensions.z
|
||||||
selected_objects = bpy.context.selected_objects
|
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):
|
for i, linear_ring in enumerate(union.interiors):
|
||||||
poly = spatial.get_buffered_poly_from_linear_ring(linear_ring)
|
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)
|
name = "Space" + str(i)
|
||||||
mesh = bpy.data.meshes.new(name=name)
|
mesh = bpy.data.meshes.new(name=name)
|
||||||
|
|||||||
@@ -810,8 +810,7 @@ class Spatial:
|
|||||||
def set_relative_object_matrix(cls, target_obj, relative_to_obj, matrix): pass
|
def set_relative_object_matrix(cls, target_obj, relative_to_obj, matrix): pass
|
||||||
def show_scene_objects(cls): pass
|
def show_scene_objects(cls): pass
|
||||||
#HERE STARTS SPATIAL TOOL
|
#HERE STARTS SPATIAL TOOL
|
||||||
# def get_container_and_active_obj(cls): pass
|
def get_union_shape_from_selected_objects(cls): pass
|
||||||
def get_union_shape_from_selected_objects(cls, selected_objects): pass
|
|
||||||
def get_boundary_elements(cls, selected_objects): pass
|
def get_boundary_elements(cls, selected_objects): pass
|
||||||
def get_polygons(cls, boundary_elements): pass
|
def get_polygons(cls, boundary_elements): pass
|
||||||
def get_obj_base_points(cls, obj): pass
|
def get_obj_base_points(cls, obj): pass
|
||||||
|
|||||||
Reference in New Issue
Block a user