mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
See #3334. Optimise pset getting and add simple "broadphase" filtering for all facets for faster validation.
This commit is contained in:
@@ -77,7 +77,9 @@ def get_pset(element, name, prop=None, should_inherit=True):
|
||||
|
||||
if not prop:
|
||||
if type_pset:
|
||||
type_pset.update(get_property_definition(pset))
|
||||
occurrence_pset = get_property_definition(pset)
|
||||
if occurrence_pset:
|
||||
type_pset.update(occurrence_pset)
|
||||
return type_pset
|
||||
return get_property_definition(pset)
|
||||
|
||||
@@ -128,9 +130,10 @@ def get_psets(element, psets_only=False, qtos_only=False, should_inherit=True):
|
||||
continue
|
||||
psets[definition.Name] = get_property_definition(definition)
|
||||
elif hasattr(element, "IsDefinedBy"):
|
||||
element_type = ifcopenshell.util.element.get_type(element)
|
||||
if element_type and should_inherit:
|
||||
psets = get_psets(element_type, psets_only=psets_only, qtos_only=qtos_only, should_inherit=False)
|
||||
if should_inherit:
|
||||
element_type = ifcopenshell.util.element.get_type(element)
|
||||
if element_type:
|
||||
psets = get_psets(element_type, psets_only=psets_only, qtos_only=qtos_only, should_inherit=False)
|
||||
for relationship in element.IsDefinedBy:
|
||||
if relationship.is_a("IfcRelDefinesByProperties"):
|
||||
definition = relationship.RelatingPropertyDefinition
|
||||
|
||||
Reference in New Issue
Block a user