3
$\begingroup$

I have a problem with Delaunay triangulation in 3D. I know that the function DelaunayTriangulation[vector] does not work in case of three-dimensional vectors. But I need no graphics but connections between points. For instance, in 2D case I can get following list of connections:

{{1, {64, 10, 22, 51, 55, 15, 41}}, {2, {71, 76, 50, 61, 80, 95}}, {3, {101, 94, 78, 100, 7, 66}}, {4, {102, 99, 57, 43, 64, 56}}, ...}

Is it possible to get a similar list for 3D points? At this moment, I have only such a picture thanks to function DelaunayMesh. Maybe there is a possibility to get a list of connections?

Delaunay mesh Thank you very much for your help!

$\endgroup$
1
  • $\begingroup$ It is not clear to me what you mean by connections? Maybe you mean the vertex-vertex adjacency lists? $\endgroup$ Commented Jan 10, 2019 at 17:46

2 Answers 2

3
$\begingroup$

Maybe this is what you are looking for? In order to use it, you have to install Szabolcs' package "IGraphM" first.

vector = RandomReal[{-1, 1}, {100, 2}];
M = DelaunayMesh[vector];

Needs["IGraphM`"]
IGMeshCellAdjacencyMatrix[M, 0, 0]["AdjacencyLists"]
$\endgroup$
4
  • $\begingroup$ Thank you for your reply. Connections, for me, means vertex-vertex adjacency lists. I have tried use these commands but I got a list which has greater numbers than the total number of vertex, for instance {261, 331, 431, 438} I have only 100 points (but you have created 2-dimensional vector, I need the 3-dimensional one), so probably it is not a good solution. $\endgroup$
    – Kamil17
    Commented Jan 10, 2019 at 20:24
  • $\begingroup$ Ah sorry, my fault. Please see my edit. $\endgroup$ Commented Jan 10, 2019 at 21:08
  • $\begingroup$ It works! Thank you very much for your help! $\endgroup$
    – Kamil17
    Commented Jan 10, 2019 at 22:01
  • $\begingroup$ You're welcome. $\endgroup$ Commented Jan 10, 2019 at 22:09
3
$\begingroup$

You can also use the property "VertexVertexConnectivity" :

Using M from Henrik's answer:

SeedRandom[1]
vector = RandomReal[{-1, 1}, {100, 2}];
M = DelaunayMesh[vector];

vvc = M["VertexVertexConnectivity"]
Short @ %

{{24,89,18,91,2},{24,1,91,21,87},{77,86,71,48,59},<<94>>,{36,58,34,21,85},{18,86,77,96,84},{6,61,38,60,40}}

This is the same as Henrik's result up to ordering of sublists:

Sort /@ vvc == Sort /@ IGMeshCellAdjacencyMatrix[M, 0, 0]["AdjacencyLists"]

True

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.