# Would that possible to add Mshdist lib in FreeFem

**URL:** <https://community.freefem.org/t/would-that-possible-to-add-mshdist-lib-in-freefem/791>\
**Category:** Feature Request\
**Created:** [February 9, 2021, 7:04pm UTC](https://community.freefem.org/t/would-that-possible-to-add-mshdist-lib-in-freefem/791 "2021-02-09T19:04:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zcwang6](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/zcwang6/32/371_2.png) [@zcwang6](https://community.freefem.org/u/zcwang6)\
**Post date:** [February 9, 2021, 7:04pm UTC](https://community.freefem.org/t/would-that-possible-to-add-mshdist-lib-in-freefem/791/1 "2021-02-09T19:04:24Z")

</div>

Hello FreeFem team, thx to make such a perfect tool for us; I recently tried to add the [Mshdist](https://github.com/ISCDtoolbox/Mshdist) into FreeFem; However, the Mshdist uses the xxx.mesh or .sol files as its input, as my understanding, FreeFem needs to transfer whatever mesh objectives treated in FreeFem [such as the class defined in msh3.hpp] into the objectives used in Mshdist; I found out that this conversion is similar to add the mmg3d lib under 3rdparty into FreeFem; Unfortunately, there is little information I can find out about the msh3 class and I am also unable to catch up the information from the FreeFem source code; So would it be possible to add this lab into FreeFem or if I can hear any guidance from you?

Thank you very much.

---

<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:** [February 9, 2021, 8:09pm UTC](https://community.freefem.org/t/would-that-possible-to-add-mshdist-lib-in-freefem/791/2 "2021-02-09T20:09:51Z")

</div>

Do you know you can use the `distance` plugin as well? See [distance.edp](https://github.com/FreeFem/FreeFem-sources/blob/master/examples/plugin/distance.edp) and other examples.  
I’m working on a fork of Mshdist which I plan on integrating inside FreeFEM, but in the meantime, I hope the `distance` plugin will do the trick for you.

---

<div class="post-metadata">

**Author:** ![zcwang6](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/zcwang6/32/371_2.png) [@zcwang6](https://community.freefem.org/u/zcwang6)\
**Post date:** [February 9, 2021, 11:38pm UTC](https://community.freefem.org/t/would-that-possible-to-add-mshdist-lib-in-freefem/791/3 "2021-02-09T23:38:57Z")

</div>

Yes prj, Thx for the reply; I know the distance plugin of freefem, but it does not work well in my case;

---

<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:** [February 10, 2021, 6:59am UTC](https://community.freefem.org/t/would-that-possible-to-add-mshdist-lib-in-freefem/791/4 "2021-02-10T06:59:42Z")

</div>

Also, `.mesh` and `.sol` as generated by FreeFEM are usable by Mshdist. So you should be able to use it through and `exec("./mshdist ...");` call in your `.edp`.

---

<div class="post-metadata">

**Author:** ![zcwang6](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/zcwang6/32/371_2.png) [@zcwang6](https://community.freefem.org/u/zcwang6)\
**Post date:** [February 10, 2021, 2:46pm UTC](https://community.freefem.org/t/would-that-possible-to-add-mshdist-lib-in-freefem/791/5 "2021-02-10T14:46:06Z")

</div>

![Screen Shot 2021-02-10 at 9.44.24 AM](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/ddca502f355671ca66cd16121258bc001e476421.png)  
Did you mean this command in FreeFem? I will try this. thank you for mentioning it.

---

<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:** [February 10, 2021, 2:54pm UTC](https://community.freefem.org/t/would-that-possible-to-add-mshdist-lib-in-freefem/791/6 "2021-02-10T14:54:31Z")

</div>

Yes, exactly. + `savesol`, `readsol`, `readmesh` & co.

---

<div class="post-metadata">

**Author:** ![zcwang6](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/zcwang6/32/371_2.png) [@zcwang6](https://community.freefem.org/u/zcwang6)\
**Post date:** [February 10, 2021, 3:20pm UTC](https://community.freefem.org/t/would-that-possible-to-add-mshdist-lib-in-freefem/791/7 "2021-02-10T15:20:09Z")

</div>

Thank you very much Prj, that is very helpful;
