3
$\begingroup$

I had used

mesh = IGLatticeMesh["Hexagonal", Polygon@CirclePoints[3, 6], MeshCellLabel -> {2 -> "Index"}] graph = IGMeshCellAdjacencyGraph[mesh, 2, VertexCoordinates -> Automatic]; 

from a thread here to create nearest neighbor graph in Mathematica for a Hexagonal Grid. I would like to do the same in 3D with alternative sphere packing strategies. I have not figured out how to extend the item above

$\endgroup$
2
  • $\begingroup$ If you can generate the points you need in 3D, then IGGabrielGraph will give you what you need in most cases. You did not mention any specific point arrangements you want, so I won't go into that. $\endgroup$ Commented Mar 3, 2023 at 15:32
  • $\begingroup$ Thank you. That is helpful. Your IG package is most useful. The point arrangement is Hexagonal Close Packing (HCG) $\endgroup$ Commented Mar 6, 2023 at 22:11

1 Answer 1

1
$\begingroup$

A few approaches:

NearestNeighborGraph[RandomReal[1, {50, 3}], 2] 

enter image description here

data = RandomReal[{-1, 1}, {6, 17, 3}]; MeshConnectivityGraph[VoronoiMesh[#], 0] & /@ data 

enter image description here

data = RandomReal[{-1, 1}, {6, 17, 3}]; MeshConnectivityGraph[DelaunayMesh[#], 0] & /@ data 

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.