# Error from inporting 3D mesh in FreeFem++

**URL:** <https://community.freefem.org/t/error-from-inporting-3d-mesh-in-freefem/294>\
**Category:** General Discussion\
**Created:** [March 7, 2020, 2:12pm UTC](https://community.freefem.org/t/error-from-inporting-3d-mesh-in-freefem/294 "2020-03-07T14:12:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![saptarshi](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@saptarshi](https://community.freefem.org/u/saptarshi)\
**Post date:** [March 7, 2020, 2:12pm UTC](https://community.freefem.org/t/error-from-inporting-3d-mesh-in-freefem/294/1 "2020-03-07T14:12:08Z")

</div>

Hello I am very new to FreeFem++. I am getting a error message while trying to import a 3D mesh built in Gmsh . The error message is this

read mesh ok 1Mesh3, num Tetra:= 0, num Vertice:= 0 num boundary Triangles:= 0  
– Mesh3::Mesh3 Erreur opening cube1.msh  
current line = 21  
Assertion fail : (0)  
line :161, in file …/femlib/Mesh3dn.cpp  
Assertion fail : (0)  
line :161, in file …/femlib/Mesh3dn.cpp  
err code 6 , mpirank 0

My .edp file file is

load “gmsh”  
load “medit”  
load “msh3”  
mesh3 TH = readmesh3(“gmsh\_mesh.msh”); // version 4 ASCII

.geo file is  
// Gmsh project created on Sat Mar 7 14:18:22 2020  
SetFactory(“OpenCASCADE”);  
//+  
Box(1) = {-0.2, -0.9, -0.2, 1, 1, 1};  
//+  
Surface Loop(2) = {5, 1, 3, 2, 6, 4};  
//+  
Surface Loop(3) = {5, 1, 3, 2, 6, 4};  
//+  
Surface Loop(4) = {4, 5, 1, 3, 2, 6};  
//+  
Surface Loop(5) = {2, 3, 5, 1, 6, 4};  
//+  
Surface Loop(6) = {5, 1, 3, 2, 6, 4};  
//+  
Surface Loop(7) = {6, 1, 3, 5, 4, 2};  
//+  
Surface Loop(8) = {2, 3, 5, 1, 6, 4};  
//+  
Surface Loop(9) = {1, 3, 5, 4, 2, 6};  
//+  
Surface Loop(10) = {2, 3, 5, 1, 6, 4};  
//+  
Surface Loop(11) = {2, 3, 5, 1, 6, 4};  
//+  
Surface Loop(12) = {2, 3, 5, 1, 6, 4};  
//+  
Surface Loop(13) = {2, 3, 5, 1, 6, 4};  
//+  
Surface Loop(14) = {1, 3, 5, 4, 2, 6};  
//+  
Surface Loop(15) = {2, 3, 5, 1, 6, 4};  
//+  
Surface Loop(16) = {2, 3, 5, 1, 6, 4};  
//+  
Surface Loop(17) = {4, 5, 1, 3, 2, 6};  
//+  
Surface Loop(18) = {4, 5, 1, 3, 2, 6};  
//+  
Surface Loop(19) = {4, 5, 1, 3, 2, 6};  
//+  
Surface Loop(20) = {1, 3, 5, 4, 2, 6};

---

<div class="post-metadata">

**Author:** ![simon.garnotel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/simon.garnotel/32/11_2.png) [@simon.garnotel](https://community.freefem.org/u/simon.garnotel)\
**Post date:** [March 9, 2020, 11:25am UTC](https://community.freefem.org/t/error-from-inporting-3d-mesh-in-freefem/294/2 "2020-03-09T11:25:36Z")

</div>

You have to use the `gmshload3` function to load Gmsh mesh, not `readmesh3`

---

<div class="post-metadata">

**Author:** ![saptarshi](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@saptarshi](https://community.freefem.org/u/saptarshi)\
**Post date:** [March 9, 2020, 6:26pm UTC](https://community.freefem.org/t/error-from-inporting-3d-mesh-in-freefem/294/3 "2020-03-09T18:26:19Z")

</div>

Thank you ! now it is working !
