How to draw a triangular mesh (unstructured grid) of an arbitrary shape using Tikz?

I would like to draw a figure that looks like this one using Tikz: This one is adapted from a book and serve here as an example. It does not have to be with the exact same boundary curves because I will only use it to present some terms (like the ones we see on the picture). The context: it represents two domains: a solid and a fluid with different spatial discretizations, i.e., two spatial meshes or grids, in this case a triangular mesh (in my field, we call it an 'unstructured' mesh). My main question is: is it possible to automatically generate this unstructured mesh using Tikz (or any other LaTeX package) for an arbitrary boundary?

Many thanks in advance :)

• – Symbol 1 Apr 25 '17 at 22:50
• Thanks, I will give it a try, @Symbol1! I think this can be very useful if I import the points from an external mesh generator – iago Apr 26 '17 at 0:10
• Despite that, I think this can be done automatically. It would take some time. – Symbol 1 Apr 26 '17 at 0:26
• Pick any 4 points on a circle or ellipse. There are two different ways to create two triangles connecting them together. – John Kormylo Apr 26 '17 at 4:07
• A brute force approach would be to take every possibie pair of mesh points \$n(n-1)/2\$ and sort them by distance. Start drawing lines from shortest to longest, throwing out any that intersect previously drawn lines. – John Kormylo Apr 26 '17 at 15:25