mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
ifc2x3 tests
This commit is contained in:
@@ -53,3 +53,7 @@ class TestAddBoolean(test.bootstrap.IFC4):
|
||||
ifcopenshell.api.run("geometry.add_boolean", self.file, representation=rep, matrix=np.eye(4))
|
||||
assert rep.Items[0].is_a() == "IfcBooleanClippingResult"
|
||||
assert rep.RepresentationType == "Clipping"
|
||||
|
||||
|
||||
class TestAddBooleanIFC2X3(test.bootstrap.IFC2X3, TestAddBoolean):
|
||||
pass
|
||||
|
||||
@@ -89,3 +89,7 @@ class TestAssignRepresentation(test.bootstrap.IFC4):
|
||||
assert wall.Representation.Representations[0].RepresentationType != "MappedRepresentation"
|
||||
assert wall.Representation.Representations[0] == rep
|
||||
assert not walltype.RepresentationMaps
|
||||
|
||||
|
||||
class TestAssignRepresentationIFC2X3(test.bootstrap.IFC2X3, TestAssignRepresentation):
|
||||
pass
|
||||
|
||||
@@ -20,7 +20,7 @@ import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
|
||||
|
||||
class TestConnectPath(test.bootstrap.IFC4):
|
||||
class TestConnectElement(test.bootstrap.IFC4):
|
||||
def test_connecting_an_element(self):
|
||||
wall1 = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||
wall2 = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||
@@ -85,3 +85,7 @@ class TestConnectPath(test.bootstrap.IFC4):
|
||||
)
|
||||
assert rel.RelatingElement == wall2
|
||||
assert rel.RelatedElement == wall1
|
||||
|
||||
|
||||
class TestConnectElementIFC2X3(test.bootstrap.IFC2X3, TestConnectElement):
|
||||
pass
|
||||
|
||||
@@ -146,3 +146,7 @@ class TestConnectPath(test.bootstrap.IFC4):
|
||||
related_connection=related_connection,
|
||||
description=description,
|
||||
)
|
||||
|
||||
|
||||
class TestConnectPathIFC2X3(test.bootstrap.IFC2X3, TestConnectPath):
|
||||
pass
|
||||
|
||||
@@ -20,7 +20,7 @@ import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
|
||||
|
||||
class TestDisconnectPath(test.bootstrap.IFC4):
|
||||
class TestDisconnectElement(test.bootstrap.IFC4):
|
||||
def test_disconnecting_an_element(self):
|
||||
wall1 = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||
wall2 = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||
@@ -34,3 +34,7 @@ class TestDisconnectPath(test.bootstrap.IFC4):
|
||||
ifcopenshell.api.run("geometry.connect_element", self.file, relating_element=wall1, related_element=wall2)
|
||||
ifcopenshell.api.run("geometry.disconnect_element", self.file, relating_element=wall2, related_element=wall1)
|
||||
assert not self.file.by_type("IfcRelConnectsElements")
|
||||
|
||||
|
||||
class TestDisconnectElementIFC2X3(test.bootstrap.IFC2X3, TestDisconnectElement):
|
||||
pass
|
||||
|
||||
@@ -68,3 +68,7 @@ class TestDisconnectPath(test.bootstrap.IFC4):
|
||||
total_elements = len([e for e in self.file])
|
||||
ifcopenshell.api.run("geometry.disconnect_path", self.file, relating_element=wall2, related_element=wall1)
|
||||
assert len([e for e in self.file]) == total_elements
|
||||
|
||||
|
||||
class TestDisconnectPathIFC2X3(test.bootstrap.IFC2X3, TestDisconnectPath):
|
||||
pass
|
||||
|
||||
@@ -268,7 +268,7 @@ class TestEditObjectPlacement(test.bootstrap.IFC4):
|
||||
def test_changing_placements_relative_to_a_nest_parent(self):
|
||||
ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject")
|
||||
ifcopenshell.api.run("unit.assign_unit", self.file)
|
||||
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcChiller")
|
||||
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcFlowSegment")
|
||||
subelement = ifcopenshell.api.run("system.add_port", self.file, element=element)
|
||||
matrix = numpy.array(
|
||||
(
|
||||
@@ -546,7 +546,7 @@ class TestEditObjectPlacement(test.bootstrap.IFC4):
|
||||
def test_changing_placements_always_affecting_child_ports_as_a_special_case(self):
|
||||
ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject")
|
||||
ifcopenshell.api.run("unit.assign_unit", self.file)
|
||||
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcChiller")
|
||||
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcFlowSegment")
|
||||
subelement = ifcopenshell.api.run("system.add_port", self.file, element=element)
|
||||
|
||||
matrix = numpy.eye(4)
|
||||
@@ -662,7 +662,7 @@ class TestEditObjectPlacement(test.bootstrap.IFC4):
|
||||
assert numpy.array_equal(ifcopenshell.util.placement.get_local_placement(wall.ObjectPlacement), matrix)
|
||||
|
||||
|
||||
class TestEditObjectPlacementIFC2X3(test.bootstrap.IFC2X3):
|
||||
class TestEditObjectPlacementIFC2X3(test.bootstrap.IFC2X3, TestEditObjectPlacement):
|
||||
def test_changing_placements_relative_to_a_distribution_element(self):
|
||||
ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject")
|
||||
ifcopenshell.api.run("unit.assign_unit", self.file)
|
||||
|
||||
Reference in New Issue
Block a user