Surface meshes extraction from reference and a deformed version of a volumetric mesh

Hi,

I first extract the surface mesh from a reference volumetric mesh (.vtk format) using extract surface filter in Paraview and save to disk (as .stl file).

I then deform this volumetric mesh by applying simple translation using another tool and then attempt to extract the sufrace mesh using the same filter (i.e. using extract surface filter) and save as a .stl file.

However, I encounter different face ids when I checked them with trimesh package.

I just want to extract the surface meshes from the reference and the deformed version and save them for other postprocessing steps.

Am I missed anything or any steps here ? If so can you elaborate the steps with an example please ?

I herewith attached a sample reference mesh and its deformed version for your further reference.

I also make an effort by writing Python shell code. But it also did not function well.

import os

volumetric_mesh_path = 'F:/deformed_1.vtk'
save_path = 'F:/deformed_1.stl'

meshReader = OpenDataFile(volumetric_mesh_path)
extracted_surface = ExtractSurface(Input=meshReader)

writer = CreateWriter(save_path)
writer.UpdatePipeline()

The Extract Surface filter is multithreaded, so there may be a difference in face ids. You may want to set the number of threads to 1 by vtkSMPTools::Initialize function as shown below.

import os
from paraview.simple import *
import vtk

volumetric_mesh_path = 'F:/deformed_1.vtk'
save_path = 'F:/deformed_1.stl'

# Set the number of threads to 1
vtk.vtkSMPTools.Initialize(1);

meshReader = OpenDataFile(volumetric_mesh_path)
extracted_surface = ExtractSurface(Input=meshReader)

writer = CreateWriter(save_path)
writer.UpdatePipeline()

data removed as requested by @chathu