# 3d mesh problem using readmesh3/savemesh in Windows 10

**URL:** <https://community.freefem.org/t/3d-mesh-problem-using-readmesh3-savemesh-in-windows-10/1978>\
**Category:** General Discussion\
**Created:** [August 31, 2022, 10:15am UTC](https://community.freefem.org/t/3d-mesh-problem-using-readmesh3-savemesh-in-windows-10/1978 "2022-08-31T10:15:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ydm](https://avatars.discourse-cdn.com/v4/letter/y/ba8739/32.png) [@ydm](https://community.freefem.org/u/ydm)\
**Post date:** [August 31, 2022, 10:15am UTC](https://community.freefem.org/t/3d-mesh-problem-using-readmesh3-savemesh-in-windows-10/1978/1 "2022-08-31T10:15:13Z")

</div>

Hello,

I am trying to import 3d mesh files from GMSH to FF++ and export the calculation results to Matlab for plotting. However, I found that under Windows 10, the program ends at the readmesh3 or savemesh function, even the format is INRIA MESH. For import mesh files, the gmshload3 function can be used in place of readmesh3 by changing the import file format to .msh.

I’ve also tried to run the matlab\_octave\_3d\_examples under Windows 10, the program ends at savemesh function and exports an empty capacitor3d.mesh. However, when I run the same program under Debian11 it works fine.

I wonder to know if it is a bug of Windows and is there anyway to replace the savemesh function?

Thanks!!!  
Daoming

---

<div class="post-metadata">

**Author:** ![aszaboa](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/aszaboa/32/2918_2.png) [@aszaboa](https://community.freefem.org/u/aszaboa)\
**Post date:** [August 31, 2022, 4:52pm UTC](https://community.freefem.org/t/3d-mesh-problem-using-readmesh3-savemesh-in-windows-10/1978/2 "2022-08-31T16:52:58Z")

</div>

I think there are three formats which you can try to import a mesh generated with GMSH into FreeFem with the following commands:

```auto
    DM dm("mesh0.msh"); // GMSH version 4 ascii. This requires PETSc
    th = dm;
    //
    th = gmshload3("mesh0.msh"); // GMSH version 2 ascii.
    //
    th = readmesh3("mesh0.mesh"); // INRIA 

```

(I hope I do not messed anything up in the code above, I tried this a long time ago)

---

<div class="post-metadata">

**Author:** ![ydm](https://avatars.discourse-cdn.com/v4/letter/y/ba8739/32.png) [@ydm](https://community.freefem.org/u/ydm)\
**Post date:** [September 1, 2022, 9:51am UTC](https://community.freefem.org/t/3d-mesh-problem-using-readmesh3-savemesh-in-windows-10/1978/3 "2022-09-01T09:51:49Z")

</div>

Thank you for your reply.

I think I didn’t ask my question clearly. It’s not about which mesh file format can be imported into FF++. My problem is that readmesh3 and savemesh functions are not working in Windows 10 system.

I think other users had the same problem a few days ago:

> [@Error of savemesh in 3D](https://community.freefem.org/t/error-of-savemesh-in-3d/1839):
>
> Hello!everyone, I install windows version FreeFem 4.11 in win 10. But there is something wrong when I save 3D mesh. So I test the following simple code: load "msh3" load "medit" mesh3 Th3=cube(10,15,5); plot(Th3); medit("Th3",Th3); savemesh(Th3, "surf.mesh"); The program is terminated when it runs to savemesh, then I get a empty surf.mesh file with 0KB, I don’t know what the problem is？ Thank you in advance.

> [@Problem reading/writing mesh file](https://community.freefem.org/t/problem-reading-writing-mesh-file/455/5):
>
> I ran this code on my computer But when I open the saved grid file, it is blank. I don’t no why.
