[ab7503]: / testing / mesh / meshes / Mesh_save_mesh_test.py

Download this file

21 lines (13 with data), 537 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
import os
import tempfile
import pymskt as mskt
from pymskt.utils import testing
MESH_WITH_SMOOTHING = mskt.mesh.io.read_vtk("data/femur_mesh_orig.vtk")
from pymskt import ATOL, RTOL
def test_saving_image(
mesh=MESH_WITH_SMOOTHING, loc_save=tempfile.gettempdir(), filename="test.vtk"
):
mesh = mskt.mesh.Mesh(mesh=mesh)
mesh.save_mesh(os.path.join(loc_save, filename))
mesh2 = mskt.mesh.io.read_vtk(os.path.join(loc_save, filename))
testing.assert_mesh_coordinates_same(mesh.mesh, mesh2, rtol=RTOL, atol=ATOL)