mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 22:31:55 +00:00
Fix #1375. Spatial zones as non-hierarchical entities are now supported.
This commit is contained in:
@@ -31,7 +31,7 @@ class TestImplementsTool(NewFile):
|
||||
|
||||
|
||||
class TestCanContain(NewFile):
|
||||
def test_a_spatial_element_can_contain_an_element(self):
|
||||
def test_a_spatial_structure_element_can_contain_an_element(self):
|
||||
ifc = ifcopenshell.file()
|
||||
tool.Ifc.set(ifc)
|
||||
structure = ifc.createIfcSite()
|
||||
@@ -42,7 +42,7 @@ class TestCanContain(NewFile):
|
||||
tool.Ifc.link(element, element_obj)
|
||||
assert subject.can_contain(structure_obj, element_obj) is True
|
||||
|
||||
def test_a_spatial_element_can_contain_an_element_ifc2x3(self):
|
||||
def test_a_spatial_structure_element_can_contain_an_element_ifc2x3(self):
|
||||
ifc = ifcopenshell.file(schema="IFC2X3")
|
||||
tool.Ifc.set(ifc)
|
||||
structure = ifc.createIfcSite()
|
||||
@@ -53,6 +53,17 @@ class TestCanContain(NewFile):
|
||||
tool.Ifc.link(element, element_obj)
|
||||
assert subject.can_contain(structure_obj, element_obj) is True
|
||||
|
||||
def test_a_spatial_zone_element_cannot_contain_an_element(self):
|
||||
ifc = ifcopenshell.file()
|
||||
tool.Ifc.set(ifc)
|
||||
structure = ifc.createIfcSpatialZone()
|
||||
structure_obj = bpy.data.objects.new("Object", None)
|
||||
tool.Ifc.link(structure, structure_obj)
|
||||
element = ifc.createIfcWall()
|
||||
element_obj = bpy.data.objects.new("Object", None)
|
||||
tool.Ifc.link(element, element_obj)
|
||||
assert subject.can_contain(structure_obj, element_obj) is False
|
||||
|
||||
def test_unlinked_elements_cannot_contain_anything(self):
|
||||
structure_obj = bpy.data.objects.new("Object", None)
|
||||
element_obj = bpy.data.objects.new("Object", None)
|
||||
|
||||
Reference in New Issue
Block a user