mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 14:31:39 +00:00
Compute wall net quantities (#2086)
* Compute wall net quantities * Remove opening check clause
This commit is contained in:
@@ -866,25 +866,24 @@ def calculate_quantities(usecase_path, ifc_file, settings):
|
|||||||
width = obj.dimensions[1] / unit_scale
|
width = obj.dimensions[1] / unit_scale
|
||||||
height = obj.dimensions[2] / unit_scale
|
height = obj.dimensions[2] / unit_scale
|
||||||
|
|
||||||
if product.HasOpenings:
|
bm_gross = bmesh.new()
|
||||||
# TODO: calculate gross / net
|
bm_gross.from_mesh(obj.data)
|
||||||
gross_footprint_area = 0
|
bm_gross.faces.ensure_lookup_table()
|
||||||
net_footprint_area = 0
|
|
||||||
gross_side_area = 0
|
bm_net = bmesh.new()
|
||||||
net_side_area = 0
|
depsgraph = bpy.context.evaluated_depsgraph_get()
|
||||||
gross_volume = 0
|
evaluated_mesh = obj.evaluated_get(depsgraph).data
|
||||||
net_volume = 0
|
bm_net.from_mesh(evaluated_mesh)
|
||||||
else:
|
bm_net.faces.ensure_lookup_table()
|
||||||
bm = bmesh.new()
|
|
||||||
bm.from_mesh(obj.data)
|
gross_footprint_area = sum([f.calc_area() for f in bm_gross.faces if f.normal.z < -0.9])
|
||||||
bm.faces.ensure_lookup_table()
|
net_footprint_area = sum([f.calc_area() for f in bm_net.faces if f.normal.z < -0.9])
|
||||||
gross_footprint_area = sum([f.calc_area() for f in bm.faces if f.normal.z < -0.9])
|
gross_side_area = sum([f.calc_area() for f in bm_gross.faces if f.normal.y > 0.9])
|
||||||
net_footprint_area = gross_footprint_area
|
net_side_area = sum([f.calc_area() for f in bm_net.faces if f.normal.y > 0.9])
|
||||||
gross_side_area = sum([f.calc_area() for f in bm.faces if f.normal.y > 0.9])
|
gross_volume = bm_gross.calc_volume()
|
||||||
net_side_area = gross_side_area
|
net_volume = bm_net.calc_volume()
|
||||||
gross_volume = bm.calc_volume()
|
bm_gross.free()
|
||||||
net_volume = gross_volume
|
bm_net.free()
|
||||||
bm.free()
|
|
||||||
|
|
||||||
ifcopenshell.api.run(
|
ifcopenshell.api.run(
|
||||||
"pset.edit_qto",
|
"pset.edit_qto",
|
||||||
|
|||||||
Reference in New Issue
Block a user