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 aec9aac5b2..c27349d1f3 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 @@ -3,39 +3,39 @@ mapper = { 'GrossWeight' : None, }, 'Qto_PlateBaseQuantities' : { - 'Width' : None, - 'Perimeter' : None, - 'GrossArea' : None, - 'NetArea' : None, - 'GrossVolume' : None, - 'NetVolume' : None, + 'Width' : "get_height", + 'Perimeter' : "get_gross_perimeter", + 'GrossArea' : "get_gross_footprint_area", + 'NetArea' : "get_net_footprint_area", + 'GrossVolume' : "get_gross_volume", + 'NetVolume' : "get_net_volume", 'GrossWeight' : None, 'NetWeight' : None, }, 'Qto_OpeningElementBaseQuantities' : { - 'Width' : None, - 'Height' : None, - 'Depth' : None, - 'Area' : None, - 'Volume' : None, + 'Width' : "get_length", + 'Height' : "get_opening_height", + 'Depth' : "get_opening_depth", + 'Area' : "get_opening_mapping_area", + 'Volume' : "get_net_volume", }, 'Qto_MarineFacilityBaseQuantities' : { - 'Length' : None, - 'Width' : None, - 'Height' : None, - 'Area' : None, - 'Volume' : None, + 'Length' : "get_length", + 'Width' : "get_width", + 'Height' : "get_height", + 'Area' : "get_net_footprint_area", + 'Volume' : "get_net_volume", }, 'Qto_ChillerBaseQuantities' : { 'GrossWeight' : None, }, 'Qto_PileBaseQuantities' : { - 'Length' : None, - 'CrossSectionArea' : None, - 'OuterSurfaceArea' : None, - 'GrossSurfaceArea' : None, - 'GrossVolume' : None, - 'NetVolume' : None, + 'Length' : "get_length", + 'CrossSectionArea' : "get_cross_section_area", + 'OuterSurfaceArea' : "get_outer_surface_area", + 'GrossSurfaceArea' : "get_gross_surface_area", + 'GrossVolume' : "get_gross_volume", + 'NetVolume' : "get_net_volume", 'GrossWeight' : None, 'NetWeight' : None, }, @@ -46,9 +46,9 @@ mapper = { 'GrossWeight' : None, }, 'Qto_VehicleBaseQuantities' : { - 'Length' : None, - 'Width' : None, - 'Height' : None, + 'Length' : "get_length", + 'Width' : "get_width", + 'Height' : "get_height", }, 'Qto_PipeFittingBaseQuantities' : { 'Length' : None, @@ -81,15 +81,15 @@ mapper = { 'GrossWeight' : None, }, 'Qto_FacilityPartBaseQuantities' : { - 'Length' : None, - 'Width' : None, - 'Height' : None, - 'Area' : None, - 'Volume' : None, + 'Length' : "get_length", + 'Width' : "get_width", + 'Height' : "get_height", + 'Area' : "get_net_footprint_area", + 'Volume' : "get_net_volume", }, 'Qto_ProjectionElementBaseQuantities' : { - 'Area' : None, - 'Volume' : None, + 'Area' : "get_net_side_area", + 'Volume' : "get_net_volume", }, 'Qto_SignBaseQuantities' : { 'Height' : None, @@ -138,13 +138,12 @@ mapper = { 'NetArea' : "get_net_footprint_area", }, 'Qto_PipeSegmentBaseQuantities' : { - 'Length' : None, + 'Length' : "get_length", 'GrossCrossSectionArea' : None, - 'NetCrossSectionArea' : None, - 'OuterSurfaceArea' : None, + 'NetCrossSectionArea' : "get_cross_section_area", + 'OuterSurfaceArea' : "get_outer_surface_area", 'GrossWeight' : None, 'NetWeight' : None, - 'FootPrintArea' : None, }, 'Qto_HumidifierBaseQuantities' : { 'GrossWeight' : None, @@ -243,9 +242,9 @@ mapper = { 'GrossWeight' : None, }, 'Qto_SlabBaseQuantities' : { - 'Width' : "get_height", + 'Width' : "get_width", 'Length' : "get_length", - 'Depth' : "get_width", + 'Depth' : "get_height", 'Perimeter' : "get_gross_perimeter", 'GrossArea' : "get_gross_footprint_area", 'NetArea' : "get_net_footprint_area", 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 8c123085c9..fd26390d76 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 @@ -29,6 +29,7 @@ Also GrossWallArea and NetWallArea need bounding object so for the moment is sti GrossFloorArea: following the definition, it should exclude the wall claddings, but for now, this is not considered into the calculation. NetFloorArea: it doesn't count the following entities contained in the spatial entity: IfcColumn and IfcWall. Just add other entities into 'get_net_floor_area' if it's needed NetVolume: like NetFloorArea, it doesn't count the following entities contained in the spatial entity: IfcColumn and IfcWall +Also, the entire IfcColumn (or IfcWall) object volume is substracted, so it should be better to substract only the shared volume between IfcSpace and IfcColumn. Look at todo list @@ -36,4 +37,7 @@ REMAINING TODO FUNCTIONS IfcSpace - NetPerimeter IfcSpace - GrossWallArea IfcSpace - NetWallArea +IfcSpace - Calculate only shared volume between IfcColumn and IfcSpace +IfcPipeSegment - Gross cross section area +Qto_PipeFittingBaseQuantities - Basically all quantities because the object can not be straight diff --git a/src/blenderbim/blenderbim/bim/module/pset/qto_calculator.py b/src/blenderbim/blenderbim/bim/module/pset/qto_calculator.py index 3a3f99b651..b4ed236e46 100644 --- a/src/blenderbim/blenderbim/bim/module/pset/qto_calculator.py +++ b/src/blenderbim/blenderbim/bim/module/pset/qto_calculator.py @@ -138,6 +138,24 @@ class QtoCalculator: """ return (Vector(o.bound_box[1]) - Vector(o.bound_box[0])).length + def get_opening_height(self, obj): + if self.is_opening_horizontal(obj): + return self.get_width(obj) + else: + return self.get_height(obj) + + def get_opening_depth(self, obj): + if self.is_opening_horizontal(obj): + return self.get_height(obj) + else: + return self.get_width(obj) + + def get_opening_mapping_area(self, obj): + if self.is_opening_horizontal(obj): + return self.get_net_footprint_area(obj) + else: + return self.get_net_side_area(obj) + def get_finish_ceiling_height(self, obj): space_height = self.get_height(obj) floor_height = self.get_finish_floor_height(obj) @@ -1063,6 +1081,13 @@ class QtoCalculator: else: return "x" + def is_opening_horizontal(self, o): + 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 + + return z < x and z < y + def delete_mesh(self, mesh): mesh.user_clear() bpy.data.meshes.remove(mesh)