diff --git a/src/blenderbim/blenderbim/bim/module/pset/calc_quantity_function_mapper.py b/src/blenderbim/blenderbim/bim/module/pset/calc_quantity_function_mapper.py index f25da588ec..a2f00eba76 100644 --- a/src/blenderbim/blenderbim/bim/module/pset/calc_quantity_function_mapper.py +++ b/src/blenderbim/blenderbim/bim/module/pset/calc_quantity_function_mapper.py @@ -65,10 +65,10 @@ mapper = { 'GrossWeight' : None, }, 'Qto_DoorBaseQuantities' : { - 'Width' : None, - 'Height' : None, - 'Perimeter' : None, - 'Area' : None, + 'Width' : { "function_name" : "get_length", "args" : ", main_axis = 'x'"}, + 'Height' : "get_height", + 'Perimeter' : "get_rectangular_perimeter", + 'Area' : "get_net_side_area", }, 'Qto_DuctSegmentBaseQuantities' : { 'Length' : None, @@ -506,10 +506,10 @@ mapper = { 'GrossWeight' : None, }, 'Qto_WindowBaseQuantities' : { - 'Width' : None, - 'Height' : None, - 'Perimeter' : None, - 'Area' : None, + 'Width' : { "function_name" : "get_length", "args" : ", main_axis = 'x'"}, + 'Height' : "get_height", + 'Perimeter' : "get_rectangular_perimeter", + 'Area' : "get_net_side_area", }, 'Qto_SanitaryTerminalBaseQuantities' : { 'GrossWeight' : None, diff --git a/src/blenderbim/blenderbim/bim/module/pset/notes_about_mapped_calculated_quantities.txt b/src/blenderbim/blenderbim/bim/module/pset/notes_about_mapped_calculated_quantities.txt index d6a7e89ada..07c078bb13 100644 --- a/src/blenderbim/blenderbim/bim/module/pset/notes_about_mapped_calculated_quantities.txt +++ b/src/blenderbim/blenderbim/bim/module/pset/notes_about_mapped_calculated_quantities.txt @@ -8,6 +8,7 @@ This is in order to follow the native IFC approach. WALLS Walls quantities are calculated with the convention that the object main axis is the 'x'. +Also openings inside a wall have to main axis 'x' SLAB THICKNESS The slab thickness is defined as Width, following the IFC definition @@ -17,6 +18,9 @@ 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. +DOORS AND WINDOWS +Doors and Windows have to have the main axis along 'x' and the height is measured along 'z' axis + diff --git a/src/blenderbim/blenderbim/bim/module/pset/qto_calculator.py b/src/blenderbim/blenderbim/bim/module/pset/qto_calculator.py index 2e61d74001..884272dba1 100644 --- a/src/blenderbim/blenderbim/bim/module/pset/qto_calculator.py +++ b/src/blenderbim/blenderbim/bim/module/pset/qto_calculator.py @@ -161,6 +161,11 @@ class QtoCalculator: self.delete_obj(gross_obj) return gross_perimeter + def get_rectangular_perimeter(self, obj): + length = self.get_length(obj, main_axis='x') + height = self.get_height(obj) + return (length+height)*2 + def get_lowest_polygons(self, o): lowest_polygons = [] lowest_z = None @@ -408,7 +413,7 @@ class QtoCalculator: bl_OBB_opening_object = self.get_OBB_object(bl_opening_obj) opening_area = self.get_lateral_area( #self.get_OBB_object(bl_opening_obj), angle_z1=angle_z1, angle_z2=angle_z2, exclude_end_areas=True - bl_OBB_opening_object, angle_z1=angle_z1, angle_z2=angle_z2, exclude_end_areas=True, + bl_OBB_opening_object, angle_z1=angle_z1, angle_z2=angle_z2, exclude_end_areas=True, main_axis = 'x', ) if opening_area >= min_area: total_opening_area += opening_area