# Question:Percolation theory and cylinder random packing

## Question:Percolation theory and cylinder random packing

Maple

Hi,

I'm working at the moment on percolation theory and, in order to get interesting images I use Maple to produce random spheres packing using the code below:

with(RandomTools):
with(plots):

x:=Generate(list(integer(range=0..20),100)): # random coordinate for x parameter
y:=Generate(list(integer(range=0..20),100)): # random coordinate for y parameter
z:=Generate(list(integer(range=0..20),100)): # random coordinate for z parameter
R:=Generate(list(float(range=1..3),12)):  # random radius parameter

P:=(x,y,z,R)->[x+R*cos(phi)*cos(theta),y+R*cos(phi)*sin(theta),z+R*sin(phi)]: # equation for one sphere

S:=(i,j,k,R)-> plot3d(P(i,j,k,R),phi=-Pi/2..Pi/2,theta=0..2*Pi): # 3D plot in space

display3d({S(x,y,z,R),S(x,y,z,R), and so and so....}); ## I finally plot everything in one space.

The result is not bad actually even if the method would be faster with a procedure... Here I only have to export the result in COLLADA format and I can play with it on a 3D render like Blender... and also do the calculations forthe percolation, on Maple.

Now, just to compare I would like to obtain the same kind of random packing using capped cylinders randomly distributed in the space with various radius and length. The problem is not coming from the spacial distribution but all the cylinders are on the same direction. Does somebody has an idea to also work with random directions ?

I tried this method but it doesn't work:

1. Random distribution of discs

2. Calculation of normal vector for all of them

3. Ptotting of cylinders using the description of this normal vector

I was quiet happy when I begin but It's seems really much more difficult than expected... The rotation can also be an interesting thing but I don't know how to introduce it...

Can you help me ?

Thanks,

Lisa ﻿