# yade-users team mailing list archive

## Re: [Question #695164]: Interparticle spacing

```Question #695164 on Yade changed:

Jan Stránský proposed the following answer:
> I couldn't find a function that can give the positions of the Delaunay
tetrahedrons corners

position of Delaunay tetrahedron corners are centers of particles

> Voronoi cells are not the same as the Delaunay tetrahedron (right?)

right, they are dual to each other [4]

A MWE using scipy.spatial.Delaunay [5]:
###
from scipy.spatial import Delaunay
sp = pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),rMean=.1,rRelFuzz=.5,num=10,seed=1)
sp.toSimulation()
pts = [b.state.pos for b in O.bodies]
#
t = Delaunay(pts)
for i1,i2,i3,i4 in t.simplices:
for j1,j2 in ((i1,i2),(i1,i3),(i1,i4),(i2,i3),(i2,i4),(i3,i4)):
p1,p2 = pts[j1],pts[j2]
print("spacing",j1,j2,(p1-p2).norm())
# TODO: remove duplicites?
# TODO: consider radius of particles?
###

cheers
Jan

[4] https://en.wikipedia.org/wiki/Delaunay_triangulation#Relationship_with_the_Voronoi_diagram
[5] https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.Delaunay.html

--

```