mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
weight calculator improvement (see #2859)
This commit is contained in:
committed by
Dion Moult
parent
94f06d9e18
commit
08fdf6014d
@@ -530,18 +530,14 @@ class QtoCalculator:
|
||||
else:
|
||||
return
|
||||
|
||||
|
||||
def get_single_material_mass_density(self, material):
|
||||
for material_property in material.HasProperties:
|
||||
if "Pset_MaterialCommon" in material_property.Name:
|
||||
for prop in material_property.Properties:
|
||||
if "MassDensity" in prop:
|
||||
return prop.NominalValue.wrappedValue
|
||||
if material_pset := ifcopenshell.util.element.get_pset(material, "Pset_MaterialCommon"):
|
||||
if material_mass_density := material_pset["MassDensity"]:
|
||||
return material_mass_density
|
||||
else:
|
||||
return
|
||||
|
||||
|
||||
|
||||
# The following is @Moult's older code. Keeping it here just in case the bmesh function is buggy. -vulevukusej
|
||||
|
||||
# def get_volume(self, o, vg_index=None):
|
||||
|
||||
Reference in New Issue
Block a user