mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
clean up after running test_wall_opening.py
This commit is contained in:
@@ -64,6 +64,7 @@ X = 1.0, 0.0, 0.0
|
|||||||
Y = 0.0, 1.0, 0.0
|
Y = 0.0, 1.0, 0.0
|
||||||
Z = 0.0, 0.0, 1.0
|
Z = 0.0, 0.0, 1.0
|
||||||
|
|
||||||
|
|
||||||
# Creates an IfcAxis2Placement3D from Location, Axis and RefDirection specified as Python tuples
|
# Creates an IfcAxis2Placement3D from Location, Axis and RefDirection specified as Python tuples
|
||||||
def create_ifcaxis2placement(f, point=O, dir1=Z, dir2=X):
|
def create_ifcaxis2placement(f, point=O, dir1=Z, dir2=X):
|
||||||
point = f.createIfcCartesianPoint(point)
|
point = f.createIfcCartesianPoint(point)
|
||||||
@@ -100,7 +101,6 @@ def create_ifcextrudedareasolid(f, point_list, ifcaxis2placement, extrude_dir, e
|
|||||||
|
|
||||||
|
|
||||||
def create_case(fn, openings):
|
def create_case(fn, openings):
|
||||||
|
|
||||||
f = ifcopenshell.template.create()
|
f = ifcopenshell.template.create()
|
||||||
|
|
||||||
owner_history = f.by_type("IfcOwnerHistory")[0]
|
owner_history = f.by_type("IfcOwnerHistory")[0]
|
||||||
@@ -127,7 +127,6 @@ def create_case(fn, openings):
|
|||||||
)
|
)
|
||||||
|
|
||||||
for opening in openings:
|
for opening in openings:
|
||||||
|
|
||||||
opening_placement = create_ifclocalplacement(
|
opening_placement = create_ifclocalplacement(
|
||||||
f, (opening.x, 0.0, opening.z), (0.0, 1.0, 0.0), (1.0, 0.0, 0.0), wall_placement
|
f, (opening.x, 0.0, opening.z), (0.0, 1.0, 0.0), (1.0, 0.0, 0.0), wall_placement
|
||||||
)
|
)
|
||||||
@@ -147,7 +146,6 @@ def create_case(fn, openings):
|
|||||||
class TestWallOpenings:
|
class TestWallOpenings:
|
||||||
@pytest.mark.skipif(shutil.which("IfcConvert") is None, reason="Requires IfcConvert in path")
|
@pytest.mark.skipif(shutil.which("IfcConvert") is None, reason="Requires IfcConvert in path")
|
||||||
def test_all(self):
|
def test_all(self):
|
||||||
|
|
||||||
cases = [
|
cases = [
|
||||||
(
|
(
|
||||||
"wall-openings-non-intersecting-rect-circle.ifc",
|
"wall-openings-non-intersecting-rect-circle.ifc",
|
||||||
@@ -205,7 +203,6 @@ class TestWallOpenings:
|
|||||||
|
|
||||||
result.append([fn])
|
result.append([fn])
|
||||||
for i in range(2 if PERF else 1):
|
for i in range(2 if PERF else 1):
|
||||||
|
|
||||||
args = [
|
args = [
|
||||||
shutil.which("IfcConvert") or "IfcConvert",
|
shutil.which("IfcConvert") or "IfcConvert",
|
||||||
"-qyvvv",
|
"-qyvvv",
|
||||||
@@ -236,12 +233,16 @@ class TestWallOpenings:
|
|||||||
|
|
||||||
# breakpoint()
|
# breakpoint()
|
||||||
|
|
||||||
|
temp_files = [fn, f"{fn}.obj", f"{fn}.log.json", f"{fn}.mtl"]
|
||||||
|
for temp_fn in temp_files:
|
||||||
|
os.unlink(temp_fn)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import tabulate
|
import tabulate
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
|
||||||
print(tabulate.tabulate(result, headers=["file", "", "--no-2d-boolean"], tablefmt="github"))
|
print("\n" + tabulate.tabulate(result, headers=["file", "", "--no-2d-boolean"], tablefmt="github"))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user