-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtest_stl_patch.py
More file actions
77 lines (66 loc) · 2.24 KB
/
test_stl_patch.py
File metadata and controls
77 lines (66 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import os
import tempfile
from pathlib import Path
import numpy as np
from prettyPlot.plotting import pretty_labels
from bird.preprocess.stl_patch.stl_bc import write_boundaries
from bird.utilities.parser import parse_json
from bird.utilities.stl_plotting import plot_stl
def test_spider_sparger():
BIRD_PRE_PATCH_TEMP_DIR = os.path.join(
Path(__file__).parent,
"..",
"..",
"bird",
"preprocess",
"stl_patch",
"bc_patch_mesh_template",
)
input_dict = parse_json(
os.path.join(BIRD_PRE_PATCH_TEMP_DIR, "spider_spg/inlets_outlets.json")
)
# Output to temporary directory and delete when done
with tempfile.TemporaryDirectory() as tmpdirname:
write_boundaries(input_dict, output_folder=tmpdirname)
axes = plot_stl(os.path.join(tmpdirname, "inlets.stl"))
pretty_labels("x", "y", zlabel="z", fontsize=14, ax=axes)
def test_loop_reactor():
BIRD_PRE_PATCH_TEMP_DIR = os.path.join(
Path(__file__).parent,
"..",
"..",
"bird",
"preprocess",
"stl_patch",
"bc_patch_mesh_template",
)
input_dict = parse_json(
os.path.join(
BIRD_PRE_PATCH_TEMP_DIR, "loop_reactor_expl/inlets_outlets.json"
)
)
# Output to temporary directory and delete when done
with tempfile.TemporaryDirectory() as tmpdirname:
write_boundaries(input_dict, output_folder=tmpdirname)
axes = plot_stl(os.path.join(tmpdirname, "inlets.stl"))
pretty_labels("x", "y", zlabel="z", fontsize=14, ax=axes)
def test_loop_reactor_branch():
BIRD_PRE_PATCH_TEMP_DIR = os.path.join(
Path(__file__).parent,
"..",
"..",
"bird",
"preprocess",
"stl_patch",
"bc_patch_mesh_template",
)
input_dict = parse_json(
os.path.join(
BIRD_PRE_PATCH_TEMP_DIR, "loop_reactor_branch/inlets_outlets.json"
)
)
# Output to temporary directory and delete when done
with tempfile.TemporaryDirectory() as tmpdirname:
write_boundaries(input_dict, output_folder=tmpdirname)
axes = plot_stl(os.path.join(tmpdirname, "inlets.stl"))
pretty_labels("x", "y", zlabel="z", fontsize=14, ax=axes)