Finish mapping Qto_BeamBaseQuantities

This commit is contained in:
Massimo Fabbro
2022-11-10 22:55:01 +01:00
committed by Dion Moult
parent 056f7610c1
commit 4d4ab63404
2 changed files with 11 additions and 9 deletions
@@ -308,9 +308,9 @@ mapper = {
'GrossWeight' : None,
},
'Qto_ColumnBaseQuantities' : {
'Length' : "get_linear_length",
'Length' : "get_length",
'CrossSectionArea' : "get_cross_section_area",
'OuterSurfaceArea' : None,
'OuterSurfaceArea' : { "function_name" : "get_lateral_area", "args" : ", exclude_end_areas = True, angle_z1 = 0, angle_z2 = 360" },
'GrossSurfaceArea' : "get_gross_surface_area",
'NetSurfaceArea' : "get_net_surface_area",
'GrossVolume' : "get_gross_volume",
@@ -471,10 +471,10 @@ mapper = {
},
'Qto_BeamBaseQuantities' : {
'Length' : "get_length",
'CrossSectionArea' : { "function_name" : "get_end_area", "args" : ", exclude_side_areas = True" },
'GrossSurfaceArea' : { "function_name" : "get_gross_lateral_area", "args" : ", exclude_end_areas = False, angle_z1 = 0, angle_z2 = 360" },
'CrossSectionArea' : "get_cross_section_area",
'GrossSurfaceArea' : "get_gross_surface_area",
'OuterSurfaceArea' : { "function_name" : "get_lateral_area", "args" : ", exclude_end_areas = True, angle_z1 = 0, angle_z2 = 360" },
'NetSurfaceArea' : { "function_name" : "get_lateral_area", "args" : ", exclude_end_areas = False, angle_z1 = 0, angle_z2 = 360" },
'NetSurfaceArea' : "get_net_surface_area",
'GrossVolume' : "get_gross_volume",
'NetVolume' : "get_net_volume",
'GrossWeight' : None,
@@ -251,12 +251,13 @@ class QtoCalculator:
if item.is_a("IfcExtrudedAreaSolid"):
mesh = self.create_mesh_from_shape(item.SweptArea)
area = self.get_mesh_area(mesh)
bpy.data.meshes.remove(mesh)
self.delete_mesh(mesh)
return area
elif item.is_a("IfcBooleanClippingResult"):
item = item.FirstOperand
else:
break
area = self.get_end_area(obj, exclude_side_areas = True)
return area
# TODO handle other types of sections, and then fall back to mesh parsing
def get_gross_surface_area(self, o, vg_index=None):
@@ -295,20 +296,21 @@ class QtoCalculator:
o_mesh = bmesh.new()
o_mesh.from_mesh(o.data)
volume = o_mesh.calc_volume()
bm.free()
o_mesh.free()
return volume
def get_gross_volume(self, o):
if not self.has_openings(o):
return self.get_net_volume(o)
element = tool.Ifc.get_entity(o)
mesh = self.get_gross_element_mesh(element)
bm = self.get_bmesh_from_mesh(mesh)
gross_volume = bm.calc_volume()
bm.free()
bpy.data.meshes.remove(mesh)
self.delete_mesh(mesh)
return gross_volume