mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
improve the flooring height object quantity calculation
This commit is contained in:
@@ -260,20 +260,23 @@ class QtoCalculator:
|
|||||||
return min(z_values)
|
return min(z_values)
|
||||||
|
|
||||||
def get_finish_floor_height(self, obj: bpy.types.Object) -> float:
|
def get_finish_floor_height(self, obj: bpy.types.Object) -> float:
|
||||||
|
space_min_z_value = self.get_min_global_z(obj)
|
||||||
|
space_max_z_value = self.get_max_global_z(obj)
|
||||||
|
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
decompositions = ifcopenshell.util.element.get_decomposition(element)
|
decompositions = ifcopenshell.util.element.get_decomposition(element)
|
||||||
finish_floor_height = 0
|
flooring_max_z_value = space_min_z_value
|
||||||
for decomposition in decompositions:
|
for decomposition in decompositions:
|
||||||
if (
|
if (
|
||||||
decomposition.get_info()["PredefinedType"] == "FLOORING"
|
decomposition.get_info()["PredefinedType"] == "FLOORING"
|
||||||
and decomposition.get_info()["type"] == "IfcCovering"
|
and decomposition.get_info()["type"] == "IfcCovering"
|
||||||
):
|
):
|
||||||
floor_obj = tool.Ifc.get_object(decomposition)
|
flooring_obj = tool.Ifc.get_object(decomposition)
|
||||||
new_finish_floor_height = self.get_height(floor_obj)
|
flooring_z_value = self.get_max_global_z(flooring_obj)
|
||||||
if new_finish_floor_height > finish_floor_height:
|
if flooring_z_value > space_min_z_value:
|
||||||
finish_floor_height = new_finish_floor_height
|
flooring_max_z_value = flooring_z_value
|
||||||
|
|
||||||
return finish_floor_height
|
return flooring_max_z_value - space_min_z_value
|
||||||
|
|
||||||
def get_ceiling_height(self, obj: bpy.types.Object) -> float:
|
def get_ceiling_height(self, obj: bpy.types.Object) -> float:
|
||||||
space_min_z_value = self.get_min_global_z(obj)
|
space_min_z_value = self.get_min_global_z(obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user