1
- # Generated file. To retain edits, remove this comment.
1
+ from pathlib import Path
2
+
3
+ from itkwasm_mesh_io import read_mesh
4
+ from itkwasm_compare_meshes import compare_meshes
2
5
3
6
from itkwasm_mesh_filters_wasi import slice_mesh
4
7
5
- from .common import test_input_path , test_output_path
8
+ from .common import test_baseline_path
6
9
7
10
def test_slice_mesh ():
8
- pass
11
+ input_mesh_path = test_baseline_path / "suzanne-repair.off"
12
+ input_mesh = read_mesh (input_mesh_path )
13
+
14
+ planes = [
15
+ {
16
+ "origin" : [0.0 , 0.0 , 0.0 ],
17
+ "normal" : [0.0 , 0.0 , 1.0 ],
18
+ },
19
+ {
20
+ "origin" : [0.0 , 0.0 , 1.0 ],
21
+ "normal" : [0.0 , 0.0 , 1.0 ],
22
+ },
23
+ {
24
+ "origin" : [0.0 , 0.0 , 2.0 ],
25
+ "normal" : [0.0 , 0.0 , 1.0 ],
26
+ },
27
+ ]
28
+
29
+ polylines = slice_mesh (input_mesh , planes )
30
+
31
+ assert polylines
32
+
33
+ # baseline_mesh_path = test_baseline_path / "suzanne-slice.iwm.cbor"
34
+ # baseline_mesh = read_mesh(baseline_mesh_path)
35
+
36
+ # TODO: uncomment after mesh type is supported?
37
+ # comparison = compare_meshes(polylines, baseline_meshes=[baseline_mesh])
38
+
39
+ # assert comparison[0]['almostEqual']
0 commit comments