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

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:

Final region

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?

  • $\begingroup$ It might be helpful to give a link to your dataset $\endgroup$ – Feyre Aug 9 '16 at 12:05
  • $\begingroup$ 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...) $\endgroup$ – kirma Aug 9 '16 at 12:27
  • $\begingroup$ 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. $\endgroup$ – Jason B. Aug 9 '16 at 13:32
  • $\begingroup$ JasonB answer worked perfectly! Thanks a lot $\endgroup$ – Salva Aug 9 '16 at 13:58
  • $\begingroup$ @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 $\endgroup$ – Jason B. Aug 9 '16 at 14:01

Browse other questions tagged or ask your own question.