Skip to content

Commit

Permalink
Merge pull request #311 from buildingSMART/IVS-181-Fix-SPS007-Exempt-…
Browse files Browse the repository at this point in the history
…Feature-Elements

IVS181/Fix - Exempt feature elements for SPS007
  • Loading branch information
civilx64 authored Oct 24, 2024
2 parents 5770408 + eeaf1ec commit 54d3873
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 23 deletions.
9 changes: 2 additions & 7 deletions features/SPS007_Spatial-containment.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@implementer-agreement
@SPS
@version2
@version3
@E00040

Feature: SPS007 - Spatial Containment
Expand All @@ -20,7 +20,7 @@ The rule verifies that spatial containment via IfcRelContainedInSpatialStructure
Scenario: Instances of IfcElement must be part of a spatial structure, with certain exceptions

Given an IfcElement
Given Its Type is not 'IfcFeatureElementSubtraction' including subtypes
Given Its Type is not 'IfcFeatureElement' including subtypes
Given Decomposes = empty

Then a *required* relationship IfcRelContainedInSpatialStructure to IfcElement from IfcSpatialElement
Expand All @@ -33,11 +33,6 @@ The rule verifies that spatial containment via IfcRelContainedInSpatialStructure
Then ContainedInStructure = empty


Scenario: Instances of IfcFeatureElementSubtraction, including its subtypes, must not be contained within a spatial structure
Given an IfcFeatureElementSubtraction
Then ContainedInStructure = empty


Scenario: All other IFC entities must not be contained within a spatial structure
Given An IfcRoot
Given Its Type is not 'IfcElement' including subtypes
Expand Down
32 changes: 16 additions & 16 deletions test/files/sps007/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,23 @@ def generate_03():
f.write('pass-sps007-scenario03-aggregated_part_not_in_spatial_containment.ifc')


def generate_04():
f = ifcopenshell.template.create(schema_identifier="IFC4X3_ADD2")
project = f.createIfcProject(make_id())
site = f.createIfcSite(make_id())
building = f.createIfcBuilding(make_id())
storey = f.createIfcBuildingStorey(make_id())
# def generate_04():
# f = ifcopenshell.template.create(schema_identifier="IFC4X3_ADD2")
# project = f.createIfcProject(make_id())
# site = f.createIfcSite(make_id())
# building = f.createIfcBuilding(make_id())
# storey = f.createIfcBuildingStorey(make_id())

# f.createIfcRelAggregates(make_id(), RelatingObject=project, RelatedObjects=[site])
f.createIfcRelContainedInSpatialStructure(make_id(), RelatingStructure=site, RelatedElements=[building])
f.createIfcRelContainedInSpatialStructure(make_id(), RelatingStructure=building, RelatedElements=[storey])
# # f.createIfcRelAggregates(make_id(), RelatingObject=project, RelatedObjects=[site])
# f.createIfcRelContainedInSpatialStructure(make_id(), RelatingStructure=site, RelatedElements=[building])
# f.createIfcRelContainedInSpatialStructure(make_id(), RelatingStructure=building, RelatedElements=[storey])

opening_element = f.createIfcOpeningElement(make_id())
f.write('fail-sps007-scenario04-ifc_opening_not_part_of_spatial_containment.ifc')
# opening_element = f.createIfcOpeningElement(make_id())
# f.write('fail-sps007-scenario04-ifc_opening_not_part_of_spatial_containment.ifc')

f.createIfcRelContainedInSpatialStructure(make_id(), RelatingStructure=storey, RelatedElements=[opening_element])
# f.createIfcRelContainedInSpatialStructure(make_id(), RelatingStructure=storey, RelatedElements=[opening_element])

f.write("pass-sps007-scenario04-opening_part_of_spatial_containment.ifc")
# f.write("pass-sps007-scenario04-opening_part_of_spatial_containment.ifc")


def generate_05():
Expand All @@ -100,18 +100,18 @@ def generate_05():

alignment = f.createIfcAlignment(make_id())

f.write('pass-sps007-scenario05-alignment_not_in_spatial_containment.ifc')
f.write('pass-sps007-scenario04-alignment_not_in_spatial_containment.ifc')

f.createIfcRelContainedInSpatialStructure(make_id(), RelatingStructure=storey, RelatedElements=[alignment])

f.write('fail-sps007-scenario05-alignment_in_spatial_structure.ic')
f.write('fail-sps007-scenario04-alignment_in_spatial_structure.ic')




generate_01()
generate_02()
generate_03()
generate_04()
# generate_04()
generate_05()

0 comments on commit 54d3873

Please sign in to comment.