Hello,
I’m trying to visualize my .stl file using glvis library (for using mfem )
.stl format is not supported in mfem, so I tried converting it to .vtk format. (using the following code)
vtkSmartPointer<vtkSTLReader> stlReader__ = vtkSmartPointer<vtkSTLReader>::New();
stlReader__->SetFileName("D:\\C3.stl");
stlReader__->Update();
vtkSmartPointer<vtkPolyDataWriter> vtkWriter = vtkSmartPointer<vtkPolyDataWriter>::New();
vtkWriter->SetFileName("D:\\c3.vtk");
vtkWriter-> SetInputData(stlReader__-> GetOutput());
vtkWriter->Update();
The vtk format conversion was successful, but when I run it in glvis, the following error occurs.
Verification failed: (major_vtk_version >= 2 && major_vtk_version <= 4) is false:
--> Unsupported VTK format
... in function: void __cdecl mfem::Mesh::Loader(class std::basic_istream<char,struct std::char_traits<char> > &,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)
... in file: E:\mfem-master\mesh\mesh.cpp:4052
After searching, it says that I need to change my vtk file to ASCII VTK version 4, or XML VTK. Is there a way to change using vtk code without using ParaView? (I have to solve it inside vtk project without using Paraview.