mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
Finish mapping Qto_BeamBaseQuantities
This commit is contained in:
committed by
Dion Moult
parent
6345daa708
commit
d8b0b097e9
@@ -308,9 +308,9 @@ mapper = {
|
|||||||
'GrossWeight' : None,
|
'GrossWeight' : None,
|
||||||
},
|
},
|
||||||
'Qto_ColumnBaseQuantities' : {
|
'Qto_ColumnBaseQuantities' : {
|
||||||
'Length' : "get_linear_length",
|
'Length' : "get_length",
|
||||||
'CrossSectionArea' : "get_cross_section_area",
|
'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",
|
'GrossSurfaceArea' : "get_gross_surface_area",
|
||||||
'NetSurfaceArea' : "get_net_surface_area",
|
'NetSurfaceArea' : "get_net_surface_area",
|
||||||
'GrossVolume' : "get_gross_volume",
|
'GrossVolume' : "get_gross_volume",
|
||||||
@@ -471,10 +471,10 @@ mapper = {
|
|||||||
},
|
},
|
||||||
'Qto_BeamBaseQuantities' : {
|
'Qto_BeamBaseQuantities' : {
|
||||||
'Length' : "get_length",
|
'Length' : "get_length",
|
||||||
'CrossSectionArea' : { "function_name" : "get_end_area", "args" : ", exclude_side_areas = True" },
|
'CrossSectionArea' : "get_cross_section_area",
|
||||||
'GrossSurfaceArea' : { "function_name" : "get_gross_lateral_area", "args" : ", exclude_end_areas = False, angle_z1 = 0, angle_z2 = 360" },
|
'GrossSurfaceArea' : "get_gross_surface_area",
|
||||||
'OuterSurfaceArea' : { "function_name" : "get_lateral_area", "args" : ", exclude_end_areas = True, angle_z1 = 0, angle_z2 = 360" },
|
'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",
|
'GrossVolume' : "get_gross_volume",
|
||||||
'NetVolume' : "get_net_volume",
|
'NetVolume' : "get_net_volume",
|
||||||
'GrossWeight' : None,
|
'GrossWeight' : None,
|
||||||
|
|||||||
@@ -251,12 +251,13 @@ class QtoCalculator:
|
|||||||
if item.is_a("IfcExtrudedAreaSolid"):
|
if item.is_a("IfcExtrudedAreaSolid"):
|
||||||
mesh = self.create_mesh_from_shape(item.SweptArea)
|
mesh = self.create_mesh_from_shape(item.SweptArea)
|
||||||
area = self.get_mesh_area(mesh)
|
area = self.get_mesh_area(mesh)
|
||||||
bpy.data.meshes.remove(mesh)
|
self.delete_mesh(mesh)
|
||||||
return area
|
return area
|
||||||
elif item.is_a("IfcBooleanClippingResult"):
|
elif item.is_a("IfcBooleanClippingResult"):
|
||||||
item = item.FirstOperand
|
item = item.FirstOperand
|
||||||
else:
|
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
|
# TODO handle other types of sections, and then fall back to mesh parsing
|
||||||
|
|
||||||
def get_gross_surface_area(self, o, vg_index=None):
|
def get_gross_surface_area(self, o, vg_index=None):
|
||||||
@@ -295,20 +296,21 @@ class QtoCalculator:
|
|||||||
o_mesh = bmesh.new()
|
o_mesh = bmesh.new()
|
||||||
o_mesh.from_mesh(o.data)
|
o_mesh.from_mesh(o.data)
|
||||||
volume = o_mesh.calc_volume()
|
volume = o_mesh.calc_volume()
|
||||||
bm.free()
|
o_mesh.free()
|
||||||
return volume
|
return volume
|
||||||
|
|
||||||
def get_gross_volume(self, o):
|
def get_gross_volume(self, o):
|
||||||
if not self.has_openings(o):
|
if not self.has_openings(o):
|
||||||
return self.get_net_volume(o)
|
return self.get_net_volume(o)
|
||||||
|
|
||||||
|
element = tool.Ifc.get_entity(o)
|
||||||
mesh = self.get_gross_element_mesh(element)
|
mesh = self.get_gross_element_mesh(element)
|
||||||
bm = self.get_bmesh_from_mesh(mesh)
|
bm = self.get_bmesh_from_mesh(mesh)
|
||||||
|
|
||||||
gross_volume = bm.calc_volume()
|
gross_volume = bm.calc_volume()
|
||||||
|
|
||||||
bm.free()
|
bm.free()
|
||||||
bpy.data.meshes.remove(mesh)
|
self.delete_mesh(mesh)
|
||||||
|
|
||||||
return gross_volume
|
return gross_volume
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user