# Error when exporting 3d mesh model to VTU file, and invisible VTK file in Paraview

**URL:** https://discourse.slicer.org/t/error-when-exporting-3d-mesh-model-to-vtu-file-and-invisible-vtk-file-in-paraview/25150
**Category:** Support
**Created:** [September 8, 2022, 7:29am UTC](https://discourse.slicer.org/t/error-when-exporting-3d-mesh-model-to-vtu-file-and-invisible-vtk-file-in-paraview/25150 "2022-09-08T07:29:30Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![torquil](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@torquil](https://discourse.slicer.org/u/torquil)
#### Post date: [September 8, 2022, 7:29am UTC](https://discourse.slicer.org/t/error-when-exporting-3d-mesh-model-to-vtu-file-and-invisible-vtk-file-in-paraview/25150/1 "2022-09-08T07:29:30Z")

</div>

I have created a model by using Segment Mesher with tetgen to create a 3d tetrahedral mesh. However, when I go to the Data module and try to export the model to file, I get the following error when selecting the VTU format:

- Error: No writer found to write file /path/to/folder/Model.vtu of type ModelFile.
- Error: Error encountered while exporting Model.

Do I need to install something for this to work?

When exporting to the VKT file format instead, I do get an output file which seems to contain the mesh, however, in Paraview this mesh is invisible for some reason, no matter which Display Representation or Colouring I use. I was able to see it using a pyvista visualization within Python.

Update: This was when using the mouse right click menu in the Data module for the export. However, if I go to the “save data” button, and select the Model.vtk that is on the list of data to save, I can save to VTU by selecting VTU in the drop-down menu there. Also, if I select VKT there, the resulting file IS visible in Paraview…

So for some reason there is a big difference between using the “Export to file” dropdown menu for the Model in the Data module, and to do it within the “Save data” function of Slicer.

This is with 3D Slicer 5.1.0-2022-09-01 on Debian Linux.

---

<div class="post-metadata">

### Author: ![ebrahim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ebrahim/32/13403_2.png) [@ebrahim](https://discourse.slicer.org/u/ebrahim)
#### Post date: [September 8, 2022, 2:56pm UTC](https://discourse.slicer.org/t/error-when-exporting-3d-mesh-model-to-vtu-file-and-invisible-vtk-file-in-paraview/25150/2 "2022-09-08T14:56:52Z")

</div>

The difference between export and save should be that export does not modify the nodes in the scene (adjusting storage nodes or marking nodes as already saved since the last changes).

When I create a model node in Slicer I don’t see the VTU option, not in the save dialog and not in the export dialog. Maybe I am not checking the correct node type.

---

<div class="post-metadata">

### Author: ![Xiaojie\_Guo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xiaojie_guo/32/67098_2.png) [@Xiaojie\_Guo](https://discourse.slicer.org/u/Xiaojie_Guo)
#### Post date: [May 22, 2024, 10:00am UTC](https://discourse.slicer.org/t/error-when-exporting-3d-mesh-model-to-vtu-file-and-invisible-vtk-file-in-paraview/25150/3 "2024-05-22T10:00:23Z")

</div>

I found that, after saving the mesh file, the mesh format was changed to vtkPolyData, not vtkUnstructuredGrid.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [May 22, 2024, 2:49pm UTC](https://discourse.slicer.org/t/error-when-exporting-3d-mesh-model-to-vtu-file-and-invisible-vtk-file-in-paraview/25150/4 "2024-05-22T14:49:42Z")

</div>

A model node can store surface mesh (vtkPolyData) or volumetric mesh (vtkUnstructuredGrid). Surface mesh files can be stored in many formats (vtk, vtp, ply, stl, obj, …), while volumetric meshes can only be stored in a few (vtk, vtu).

_Saving_ of volumetric meshes works well, but indeed _exporting_ is currently broken due to small bug. I’ve [submitted a fix](https://github.com/Slicer/Slicer/pull/7760), which should be available in the Slicer Preview Release from tomorrow. Until you get the fix, you can use “Save data” instead of export.

---

<div class="post-metadata">

### Author: ![Xiaojie\_Guo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xiaojie_guo/32/67098_2.png) [@Xiaojie\_Guo](https://discourse.slicer.org/u/Xiaojie_Guo)
#### Post date: [May 24, 2024, 9:08am UTC](https://discourse.slicer.org/t/error-when-exporting-3d-mesh-model-to-vtu-file-and-invisible-vtk-file-in-paraview/25150/5 "2024-05-24T09:08:17Z")

</div>

Yeah, great. What I said saving the mesh means exporting the model node.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [May 24, 2024, 10:59am UTC](https://discourse.slicer.org/t/error-when-exporting-3d-mesh-model-to-vtu-file-and-invisible-vtk-file-in-paraview/25150/6 "2024-05-24T10:59:54Z")

</div>

Saving (menu: File / Save data) and exporting (Data module: right-click / Export to file) are two different features. Saving has been working well. Export was failing for volumetric meshes but it is fixed now in the Slicer Preview Release.

---

<div class="post-metadata">

### Author: ![Xiaojie\_Guo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xiaojie_guo/32/67098_2.png) [@Xiaojie\_Guo](https://discourse.slicer.org/u/Xiaojie_Guo)
#### Post date: [May 27, 2024, 2:13am UTC](https://discourse.slicer.org/t/error-when-exporting-3d-mesh-model-to-vtu-file-and-invisible-vtk-file-in-paraview/25150/7 "2024-05-27T02:13:31Z")

</div>

Got it. Thanks very much.
