# Extract a region from a list of points [duplicate]

I need to extract a region out of a list of points. My points are displayed as follows:

I have divided the points in three different regions and then joined them, R1, R2 and R3 are the list of points for each of the three regions. Then I execute the code:

aux1 = ConvexHullMesh[R1];

aux2 = ConvexHullMesh[R2];

aux3 = ConvexHullMesh[R3];

R = RegionUnion[aux1, aux2, aux3];


And the result is:

So I have two problems: In the left region it is not taking into account the 'hole' and in the right side ones it is doing a convex region (as the command i used is convex). I have tried other commands but none of them work as expected. Any idea?

• It might be helpful to give a link to your dataset – Feyre Aug 9 '16 at 12:05
• You have to set some intelligently chosen limit to what is considered to be a hole and what not. My first thought on this would be to consider all triangles formed of sides (= pairs of points) of length less than some constant value. To form a list of such candidate points you can use Nearest (with some deduplication of entries). After this, you should be able to create a (boundary) mesh of these regions. (I'm not saying this method is necessarily particularly efficient...) – kirma Aug 9 '16 at 12:27
• What you need is the alpha shape of these regions, a sort of concave hull. You can use either of the answers here and get it right away. – Jason B. Aug 9 '16 at 13:32
• JasonB answer worked perfectly! Thanks a lot – Salva Aug 9 '16 at 13:58
• @Salva - glad to help! This will probably get marked as a duplicate then, but feel free to come back and participate more in the future – Jason B. Aug 9 '16 at 14:01