Question

I'm looking for a Voronoi Tessellation library in C++, and Voro++ seems to fit the bill perfectly. There are certain things I need - for instance, easy access to the properties of the cells themselves - that Voro++ provides very well. However, Voro++ appears to be tailored for 3D work. Is it possible to use Voro++ in 2D mode and if so how would I do that?

I think just doing everything in 3D but having only points with a zero z-component would work (as long as the "box" has z-range -0.5 - 0.5), but this seems like massive overkill.

Était-ce utile?

La solution

Hi you might want to try Viennagrid, their source code generate various types of meshes including Voronoi diagrams. There is no limitation to spatial dimension. The website is

http://www.iue.tuwien.ac.at/index.php?id=viennagrid

Best regards...

Autres conseils

This is an old question, but after contacting the author of the software he confirmed that a 2d version, useful for the purpose of efficiency, is in the making via Subversion using the command

svn checkout https://codeforge.lbl.gov/anonscm/voro/trunk

If you have particle number < 100000 you can simply use the 3d version specifying a z coordinate of zero and a height of the container of 1

z_min = -0.5; z_max = 0.5

I would suggest you to contact the author of voro++. I had the same problem as you, I contacted him directly, and he told me he was working on a 2D optimized version, and even gave a preliminary code version to try. That code was working pretty well.

Even that, as another approach, you can of course use the 3d version and fix some dimension (let's say y) to be always of length one, and then all your volumes and data will need (if at all) trivial scaling. The advantages of 2d tailored version will be mainly speed.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top