mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 18:57:17 +00:00
committed by
Massimo Fabbro
parent
3f823573cf
commit
05be0f69bd
@@ -95,6 +95,18 @@ def get_stair_length(obj: bpy.types.Object) -> float:
|
|||||||
stair_length = math.sqrt(pow(length, 2) + pow(height, 2))
|
stair_length = math.sqrt(pow(length, 2) + pow(height, 2))
|
||||||
return stair_length
|
return stair_length
|
||||||
|
|
||||||
|
def get_footing_length(o: bpy.types.Object) -> float:
|
||||||
|
element = tool.Ifc.get_entity(o)
|
||||||
|
assert element
|
||||||
|
predefined_type = ifcopenshell.util.element.get_predefined_type(element)
|
||||||
|
if not predefined_type:
|
||||||
|
return get_length(o)
|
||||||
|
if predefined_type == "FOOTING_BEAM" or predefined_type == "STRIP_FOOTING":
|
||||||
|
return get_z(o)
|
||||||
|
elif predefined_type == "PAD_FOOTING":
|
||||||
|
return max(get_x(o), get_y(o))
|
||||||
|
else:
|
||||||
|
return get_length(o)
|
||||||
|
|
||||||
def get_net_stair_area(obj: bpy.types.Object) -> float:
|
def get_net_stair_area(obj: bpy.types.Object) -> float:
|
||||||
OBB_obj = get_OBB_object(obj)
|
OBB_obj = get_OBB_object(obj)
|
||||||
@@ -174,6 +186,19 @@ def get_width(o: bpy.types.Object) -> float:
|
|||||||
y = get_y(o)
|
y = get_y(o)
|
||||||
return min(x, y)
|
return min(x, y)
|
||||||
|
|
||||||
|
def get_footing_height(o: bpy.types.Object) -> float:
|
||||||
|
element = tool.Ifc.get_entity(o)
|
||||||
|
assert element
|
||||||
|
predefined_type = ifcopenshell.util.element.get_predefined_type(element)
|
||||||
|
if not predefined_type:
|
||||||
|
return get_height(o)
|
||||||
|
if predefined_type == "FOOTING_BEAM" or predefined_type == "STRIP_FOOTING":
|
||||||
|
return get_y(o)
|
||||||
|
elif predefined_type == "PAD_FOOTING":
|
||||||
|
return get_z(o)
|
||||||
|
else:
|
||||||
|
return get_height(o)
|
||||||
|
|
||||||
|
|
||||||
def get_height(o: bpy.types.Object) -> float:
|
def get_height(o: bpy.types.Object) -> float:
|
||||||
"""_summary_: Returns the height of the object bounding box
|
"""_summary_: Returns the height of the object bounding box
|
||||||
|
|||||||
@@ -318,8 +318,8 @@
|
|||||||
"GrossSurfaceArea": "get_gross_surface_area",
|
"GrossSurfaceArea": "get_gross_surface_area",
|
||||||
"GrossVolume": "get_gross_volume",
|
"GrossVolume": "get_gross_volume",
|
||||||
"GrossWeight": "get_gross_weight",
|
"GrossWeight": "get_gross_weight",
|
||||||
"Height": "get_height",
|
"Height": "get_footing_height",
|
||||||
"Length": "get_length",
|
"Length": "get_footing_length",
|
||||||
"NetVolume": "get_net_volume",
|
"NetVolume": "get_net_volume",
|
||||||
"NetWeight": "get_net_weight",
|
"NetWeight": "get_net_weight",
|
||||||
"OuterSurfaceArea": "get_outer_surface_area",
|
"OuterSurfaceArea": "get_outer_surface_area",
|
||||||
|
|||||||
@@ -441,6 +441,8 @@ class Blender(QtoCalculator):
|
|||||||
"get_rectangular_perimeter": Function("IfcLengthMeasure", "Rectangular Perimeter", ""),
|
"get_rectangular_perimeter": Function("IfcLengthMeasure", "Rectangular Perimeter", ""),
|
||||||
"get_stair_length": Function("IfcLengthMeasure", "Stair Length", ""),
|
"get_stair_length": Function("IfcLengthMeasure", "Stair Length", ""),
|
||||||
"get_width": Function("IfcLengthMeasure", "Width", ""),
|
"get_width": Function("IfcLengthMeasure", "Width", ""),
|
||||||
|
"get_footing_height": Function("IfcLengthMeasure", "Height", ""),
|
||||||
|
"get_footing_length": Function("IfcLengthMeasure", "Length", ""),
|
||||||
# IfcAreaMeasure
|
# IfcAreaMeasure
|
||||||
"get_covering_gross_area": Function("IfcAreaMeasure", "Covering Gross Area", ""),
|
"get_covering_gross_area": Function("IfcAreaMeasure", "Covering Gross Area", ""),
|
||||||
"get_covering_net_area": Function("IfcAreaMeasure", "Covering Net Area", ""),
|
"get_covering_net_area": Function("IfcAreaMeasure", "Covering Net Area", ""),
|
||||||
|
|||||||
Reference in New Issue
Block a user