Is there any way to generate voronoi tessellation diagram?

Asked by Chu

Dear all,

I'd like to generate voronoi tessellation diagram like the fig[1]. I tried the TW.defToVtk() and got Delaunay triangulation diagram but not voronoi tesselation diagram. It seems the voro++[2] is what I am looking for, but the result seems not good because I didn't see any spheres.

Thanks for your any suggestion.

[1]https://www.yade-dem.org/wiki/File:Cell_volume.png
[2]http://math.lbl.gov/voro++/

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello,

> I'd like to generate voronoi tessellation diagram

Do you need nubers, of picture?

From what input would you like to generate it? Particle centers?

> I tried the TW.defToVtk() and got Delaunay triangulation diagram but not voronoi tesselation diagram.

They are dual, one uniquely determines the other, so if you have Delaunay triangulation, creating Voronoi tesselation is "easy".

> It seems the voro++[2] is what I am looking for, but the result seems not good because I didn't see any spheres.

I don't know voro++, but if I remember correctly, Paraview could do this.
If not natively, you can always create the Voronoi diagram and "manually" display the lines together with spheres.

Cheers
Jan

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#2

Hi,
The image [1] was generated semi-automatically with POV-ray, using data generated collected from FlowEngine.
There is no builtin function for doing that in Yade directly.
It seems your question has two sides:
1/ how to get the data
2/ how to display it

For 1/, it's pretty easy in C++ to iterate on the triangulation's facets and output a dual segment for each (one branch in Voronoi), but there is currently no python wrapping for such operation in TesselationWrapper. You may need to code a little within TessealationWrapper, or switch to FlowEngine. I can advise a bit more if needed.

For 2/, it is up to you. I'm not quite sure POV-ray still works on modern systems. There could be other softwares doing 3D rendering. There's paraview but I'm not sure precisely how to achieve [1] in paraview. Blender is another one but I have no experience.

Bruno

Revision history for this message
Chu (chu-1) said :
#3

Thanks Jan and Bruno,

>From what input would you like to generate it? Particle centers?

I think we need particle centers and radius.

>They are dual, one uniquely determines the other, so if you have Delaunay triangulation, creating Voronoi tesselation is "easy".

I agree with that. Is it possible to convert Delaynay triangulation to Voronoi tesselation in Paraview? Could you give me more advice?

>You may need to code a little within TessealationWrapper, or switch to FlowEngine. I can advise a bit more if needed.

I‘d like to try it. Could you give me more advice? In deed, I tried saveVtk() from FlowEngine and got similar result to TW.defToVtk().

Cheers
Chu

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#4

FlowEngine has more features to visit the graph.

Something like this should work (not tested but the needed functions are there):

for k in range(f.nCells): #where "f" is FlowEngine
    point1 = f.getCellCenter(k)
    others = f.getNeighbors(k)
     for j in others:
        if i<j: continue # this is to not print every branch twice
        point2 = f.getCellCenter(j )
        print( "voronoi branch from ", point1,"to",point2)

Bruno

Can you help with this problem?

Provide an answer of your own, or ask Chu for more information if necessary.

To post a message you must log in.