from gengeo import *
from stl2msh import *

tripatchset,bbox = stl2TriPatchSet("test.stl")
vol = MeshVolume(tripatchset)

minPoint = bbox[0]
maxPoint = bbox[1]

#specify bounding points of box:
boxMinPoint = Vector3(0,0,0)
boxMaxPoint = Vector3(5,5,5)

#specify min and max particle radii:
Rmin = 1.5
Rmax = 5.0


#create a neighbour table:
mntable = MNTable3D (
   minPoint = minPoint,
   maxPoint = maxPoint,
   gridSize = 2.5*Rmax,
   numGroups = 1
)

#create a packer (insertion generator):
packer = InsertGenerator3D (
   minRadius = Rmin,
   maxRadius = Rmax,
   insertFails = 10000,
   maxIterations = 1000,
   tolerance = 1.0e-6,
   seed = True
)

#generate the particle packing:
packer.generatePacking (
   volume = vol,
   ntable = mntable,
   groupID = 0,
   tag = 1
)

#write out a geometry file:
mntable.write("mymesh.geo",1)

#write out a geometry file:
mntable.write("mymesh.vtu",2)
GlossyBlue theme adapted by David Gilbert
Powered by PmWiki
www.000webhost.com