Extract border from 2D mesh

Hi everyone,

I was trying to extract the border from a 2D mesh. The only function that i could find on the FreeFem Documentation is only applied for a 3D mesh (mesh3, extractborder). I hope someone could help me on this topic, i was trying to find the solution for a long time, the border that i want to extract could be from a simple square or maybe more difficult from a random shape. The reason i want to extract the border is to define the initial condition for a simulation of the traffic flow.

Thanks for your help.

Maybe with an empty mesh: see here

Thank you but what i do really need was how to extract a part of the border, to set the initial limitation. For example it could be one edge of a square, half of the circle or random edge from a random shape. Because in my project, i already have the totally border extracted now all i need is just a part of it.

Thanks a lot for your help.

I think in curvature.edp example you get the good function:

curvature.edp:real l12=extractborder(Th,ll,b12);

see FreeFem-sources/curvature.edp at master · FreeFem/FreeFem-sources · GitHub