mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-15 18:14:08 +00:00
spatial.assign_container - support batching #4474
This commit is contained in:
@@ -347,6 +347,6 @@ for i in range(0, 4):
|
||||
location = np.eye(4)
|
||||
location[1][3] += i * 1
|
||||
ifcopenshell.api.run("geometry.edit_object_placement", model, product=wall, matrix=location)
|
||||
ifcopenshell.api.run("spatial.assign_container", model, relating_structure=storey, product=wall)
|
||||
ifcopenshell.api.run("spatial.assign_container", model, relating_structure=storey, products=[wall])
|
||||
|
||||
model.write(os.path.join(outdir, "library", "sample.ifc"))
|
||||
|
||||
@@ -1495,14 +1495,14 @@ class TestPartOf:
|
||||
container = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcSpace")
|
||||
facet = PartOf(name="IFCSPACE", relation="IFCRELCONTAINEDINSPATIALSTRUCTURE")
|
||||
run("Any contained element passes a containment relationship 1/2", facet=facet, inst=element, expected=False)
|
||||
ifcopenshell.api.run("spatial.assign_container", ifc, product=element, relating_structure=container)
|
||||
ifcopenshell.api.run("spatial.assign_container", ifc, products=[element], relating_structure=container)
|
||||
run("Any contained element passes a containment relationship 2/2", facet=facet, inst=element, expected=True)
|
||||
run("The container itself always fails", facet=facet, inst=container, expected=False)
|
||||
|
||||
ifc = ifcopenshell.file()
|
||||
element = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcElementAssembly")
|
||||
container = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcSpace")
|
||||
ifcopenshell.api.run("spatial.assign_container", ifc, product=element, relating_structure=container)
|
||||
ifcopenshell.api.run("spatial.assign_container", ifc, products=[element], relating_structure=container)
|
||||
facet = PartOf(relation="IFCRELCONTAINEDINSPATIALSTRUCTURE", name="IFCSITE")
|
||||
run("The container entity must match exactly 1/2", facet=facet, inst=element, expected=False)
|
||||
facet = PartOf(relation="IFCRELCONTAINEDINSPATIALSTRUCTURE", name="IFCSPACE")
|
||||
@@ -1519,7 +1519,7 @@ class TestPartOf:
|
||||
subelement = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcBeam")
|
||||
ifcopenshell.api.run("aggregate.assign_object", ifc, product=subelement, relating_object=element)
|
||||
container = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcSpace")
|
||||
ifcopenshell.api.run("spatial.assign_container", ifc, product=element, relating_structure=container)
|
||||
ifcopenshell.api.run("spatial.assign_container", ifc, products=[element], relating_structure=container)
|
||||
facet = PartOf(relation="IFCRELCONTAINEDINSPATIALSTRUCTURE", name="IFCSPACE")
|
||||
run("The container may be indirect", facet=facet, inst=subelement, expected=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user