mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Minor improvements to shape utility.
This commit is contained in:
@@ -24,8 +24,10 @@ import ifcopenshell.util.representation
|
|||||||
tol = 1e-6
|
tol = 1e-6
|
||||||
|
|
||||||
|
|
||||||
def is_x(value, x):
|
def is_x(value, x, tolerance=None):
|
||||||
return abs(x - value) < tol
|
if tolerance is None:
|
||||||
|
tolerance = tol
|
||||||
|
return abs(x - value) < tolerance
|
||||||
|
|
||||||
|
|
||||||
def get_volume(geometry):
|
def get_volume(geometry):
|
||||||
@@ -286,7 +288,7 @@ def get_profiles(element):
|
|||||||
material = ifcopenshell.util.element.get_material(element, should_skip_usage=True)
|
material = ifcopenshell.util.element.get_material(element, should_skip_usage=True)
|
||||||
if material and material.is_a("IfcMaterialProfileSet"):
|
if material and material.is_a("IfcMaterialProfileSet"):
|
||||||
return [mp.Profile for mp in material.MaterialProfiles]
|
return [mp.Profile for mp in material.MaterialProfiles]
|
||||||
return []
|
return [e.SweptArea for e in get_extrusions(element)]
|
||||||
|
|
||||||
|
|
||||||
def get_extrusions(element):
|
def get_extrusions(element):
|
||||||
|
|||||||
Reference in New Issue
Block a user