# Bad orientation using BuildDmesh

**URL:** <https://community.freefem.org/t/bad-orientation-using-builddmesh/1879>\
**Category:** General Discussion\
**Created:** [July 7, 2022, 9:50am UTC](https://community.freefem.org/t/bad-orientation-using-builddmesh/1879 "2022-07-07T09:50:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![slh](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@slh](https://community.freefem.org/u/slh)\
**Post date:** [July 7, 2022, 9:50am UTC](https://community.freefem.org/t/bad-orientation-using-builddmesh/1879/1 "2022-07-07T09:50:55Z")

</div>

Hi  
I am trying to import a mesh file (.mesh) generated in Gmsh (starting from a .step file).  
In the post [Bad orientation](https://community.freefem.org/t/bad-orientation/411), @prj proposed to use

```nohighlight
lockOrientation = false;
mesh3 Th("d.mesh");
lockOrientation = true;
mesh3 renumbered = Th;

```

Adding this to my code, the import works, but when trying to use BuildDmesh(Th), the following error is displayed:

```auto
Build meshS from mesh3 ...
Bad orientation: The adj border element defined by [2044 2045] is oriented in the same direction in element 22090 and in the element 3392 ****** bug in mesh construction? orientation parameter?

```

Is it correct to call BuildDmesh on Th or rather on renumbered? What is the exact difference between the two? I would appreciate any input, thanks in advance!

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [July 7, 2022, 10:36am UTC](https://community.freefem.org/t/bad-orientation-using-builddmesh/1879/2 "2022-07-07T10:36:40Z")

</div>

Could you please share your mesh?
