VasiliBaranov / packing-generation

Hard-sphere packing generation in C++ with the Lubachevsky–Stillinger, Jodrey–Tory, and force-biased algorithms and packing post-processing.
MIT License
106 stars 43 forks source link

ascii output files #16

Open cgclark opened 4 years ago

cgclark commented 4 years ago

Hi Vasili,

I was curious if it would be possible to have your 10,000 pt examples with same and different radii as CSV files in addition to the xyzd binary files which are there. I cannot understand how to extract the data and load it into, for example, anything except R. Learning R will take me some time.

Many thanks, Chris

cgclark commented 4 years ago

After searching through the other issues, I did find that the following is able to accomplish this. hexdump -v -e '4 "%f "' -e '"\n"' < packing.xyzd > centers_in_ascii.txt

Would you mind posting the 10,000 pt xyzd examples with same and different radii that are in the readme? I will send you a nice image afterwards.

VasiliBaranov commented 4 years ago

Hi Chris,

i'm glad that you found this way, i didn't think about it. Just a note: it is possible to extract the data in any mainstream language. I have samples in C# (using BinaryReader), Matlab (in examples), C++ (directly in the code), python. In python it will be two lines, numpy.fromfile + numpy.reshape.

You can find a lot of packings here: https://datadryad.org/stash/dataset/doi:10.5061/dryad.35td0 (i don't remember if i rescaled radii in all of them, but you will notice if particles do not touch each other). If you have any questions, please contact me. Hope this helps!

Best Regards, Vasili