Fix some errors and update notes

This commit is contained in:
Massimo Fabbro
2022-11-10 23:27:14 +01:00
committed by Dion Moult
parent 4d4ab63404
commit 20f4737ffd
3 changed files with 18 additions and 12 deletions
@@ -378,13 +378,13 @@ mapper = {
'Length' : None,
},
'Qto_WallBaseQuantities' : {
'Length' : "get_length",
'Length' : { "function_name" : "get_length", "args" : ", main_axis = 'x'"},
'Width' : "get_width",
'Height' : "get_height",
'GrossFootprintArea' : "get_gross_footprint_area",
'NetFootprintArea' : "get_net_footprint_area",
'GrossSideArea' : { "function_name" : "get_half_lateral_area", "args" : ", exclude_end_areas = True, subtract_openings = False" },
'NetSideArea' : { "function_name" : "get_half_lateral_area", "args" : ", exclude_end_areas = True" },
'GrossSideArea' : { "function_name" : "get_half_lateral_area", "args" : ", exclude_end_areas = True, subtract_openings = False, main_axis = 'x'" },
'NetSideArea' : { "function_name" : "get_half_lateral_area", "args" : ", exclude_end_areas = True, main_axis = 'x'" },
'GrossVolume' : "get_gross_volume",
'NetVolume' : "get_net_volume",
'GrossWeight' : None,
@@ -6,14 +6,17 @@ without the related IFC opening.
So, if an object is created lets say with a hole but without defining the opening, the hole is counted into net volume (so get volume and net volume are the same).
This is in order to follow the native IFC approach.
WALLS AND BEAM LENGTH, HEIGHT, WIDTH AND LATERAL AREA
These dimensions are calculated with the convention that the object can have main axis along x or z.
The same with lateral area.
WALLS
Walls quantities are calculated with the convention that the object main axis is the 'x'.
SLAB THICKNESS
The slab thickness is defined as Width, following the IFC definition
Also, note that these dimensions are calculated only if the slab is prismatic.
LATERAL AREA
All lateral areas are counted, so for example also the inside surfaces.
It shouldn't be like that so we should find a method to only external lateral area.
@@ -95,12 +95,12 @@ class QtoCalculator:
z = (Vector(o.bound_box[1]) - Vector(o.bound_box[0])).length
return max(x, y, z)
def get_length(self, o, vg_index=None):
def get_length(self, o, vg_index=None, main_axis: str = ""):
if vg_index is None:
x = (Vector(o.bound_box[4]) - Vector(o.bound_box[0])).length
y = (Vector(o.bound_box[3]) - Vector(o.bound_box[0])).length
z = (Vector(o.bound_box[1]) - Vector(o.bound_box[0])).length
if self.get_object_main_axis(o) == "x":
if self.get_object_main_axis(o) == "x" or main_axis=="x":
return max(x, y)
if self.get_object_main_axis(o) == "z":
return max(z, x)
@@ -423,6 +423,7 @@ class QtoCalculator:
exclude_side_areas: bool = False,
angle_z1: int = 45,
angle_z2: int = 135,
main_axis: str = "",
):
"""_summary_
@@ -439,15 +440,15 @@ class QtoCalculator:
y_axis = [0, 1, 0]
z_axis = [0, 0, 1]
if self.get_object_main_axis(obj) == "x":
if self.get_object_main_axis(obj) == "x" or main_axis == "x":
main_axis = x_axis
side_axis = y_axis
top_axis = z_axis
if self.get_object_main_axis(obj) == "z":
elif self.get_object_main_axis(obj) == "z":
main_axis = z_axis
side_axis = x_axis
top_axis = y_axis
if self.get_object_main_axis(obj) == "y":
elif self.get_object_main_axis(obj) == "y":
main_axis = y_axis
side_axis = z_axis
top_axis = x_axis
@@ -481,6 +482,7 @@ class QtoCalculator:
exclude_side_areas: bool = False,
angle_z1: int = 45,
angle_z2: int = 135,
main_axis: str = "",
):
"""_summary_
@@ -499,7 +501,7 @@ class QtoCalculator:
gross_obj = bpy.data.objects.new("MyObject", gross_mesh)
gross_lateral_area = self.get_lateral_area(gross_obj, subtract_openings, exclude_end_areas, exclude_side_areas, angle_z1, angle_z2 )
gross_lateral_area = self.get_lateral_area(gross_obj, subtract_openings, exclude_end_areas, exclude_side_areas, angle_z1, angle_z2, main_axis )
self.delete_obj(gross_obj)
self.delete_mesh(gross_mesh)
@@ -515,6 +517,7 @@ class QtoCalculator:
exclude_side_areas: bool = False,
angle_z1: int = 45,
angle_z2: int = 135,
main_axis: str = "",
):
"""_summary_:
:param blender-object obj: blender object, bpy.types.Object