Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • $\begingroup$ I am having a hard time putting together the whole code. Some error pops out when I attach everything. The pictures you generated are pretty much what I am looking for. Do you know, how export the co-ordinates in a text file (x1,y1,z1) & (x2,y2,z2)? $\endgroup$ Commented Aug 6, 2017 at 15:11
  • $\begingroup$ I found and fixed a typo in inb. The simplest way to export the cylinder data as text is Export["C:\\Temp\\cyls.txt", c], where the first argument is the location to which the data is to be exported. By the way, I now know how to make int exact, which will permit a few more cylinders to be packed into the box. It will take me a while to implement the code. Please do not forget to upvote and accept my answer, if it meets your needs. $\endgroup$ Commented Aug 6, 2017 at 15:54
  • $\begingroup$ What does (* {29.8132, 78} *) mean? I know 78 is the number of cylinders. What does 29.81 mean, is it time? Also, ict value of 5000, do you think it should be 500000? $\endgroup$ Commented Aug 6, 2017 at 20:23
  • $\begingroup$ The code runs now, however I can see multiple overlapping cylinders in mathematica. Is it something to do with the int or inb function? In addition, Is there a way we could incorporate a input parameter "n", which decides the number of cylinders inside the cube? $\endgroup$ Commented Aug 9, 2017 at 1:02
  • $\begingroup$ I am not looking for high packing fractions. So, a reasonable "n" would be useful. At the end, I would have a code that could generate random non-overlapping cylinders with specified aspect ratio and specified number. Could you show how to add n? $\endgroup$ Commented Aug 9, 2017 at 12:18