← Back to team overview

yade-users team mailing list archive

[Question #683312]: How to fill a container with particles in STL format?

 

New question #683312 on Yade:
https://answers.launchpad.net/yade/+question/683312

Hi everyone,

I have a single particle (irregular geometry) which is in STL format and I want to use it as a replacement for spheres to fill a container. Similar to the makecloud function.

I am aware that STL format can only be imported as facets.
The input command I used to import the single particle in STL format is as follows:
particle1 = O.bodies.append(ymport.stl('/directory of file.stl'))

The script below is a sample for generating spheres in a container. Greatly appreciate if anyone could provide some guidance on how to fill the container with the single particle, which is in STL format. 

#Particle Generation Script
O=Omega()

# add a material type FrictMat
O.materials.append(FrictMat(young = 1E7, poisson = 0.25, frictionAngle = 0.6, density = 2650))

# Corners of the box
x_min, y_min, z_min = 0.0, 0.0, 0.0
x_max, y_max, z_max = 0.5, 0.2, 0.3

## Generate a container
# top wall
O.bodies.append(utils.box(center = [(x_min + x_max)/2, (y_min + y_max)/2, z_max], extents = [(-x_min +
x_max)/2, (-y_min + y_max)/2, 0], fixed = True, wire=True))
# bottom wall
O.bodies.append(utils.box(center = [(x_min + x_max)/2, (y_min + y_max)/2, z_min], extents = [(-x_min +
x_max)/2, (-y_min + y_max)/2, 0], fixed=True, wire=True))
# left wall
O.bodies.append(utils.box(center = [x_min, (y_min + y_max)/2, (z_min + z_max)/2], extents=[0, (-y_min
+ y_max)/2, (-z_min + z_max)/2], fixed=True, wire=True))
# right wall
O.bodies.append(utils.box(center = [x_max, (y_min + y_max)/2, (z_min + z_max)/2], extents=[0, (-y_min
+ y_max)/2, (-z_min + z_max)/2], fixed=True, wire=True))
# front wall
O.bodies.append(utils.box(center = [(x_min + x_max)/2, y_min, (z_min + z_max)/2], extents = [(-x_min +
x_max)/2, 0, (-z_min + z_max)/2], fixed=True, wire=True))
# behind wall
O.bodies.append(utils.box(center = [(x_min + x_max)/2, y_max, (z_min + z_max)/2], extents = [(-x_min +
x_max)/2, 0, (-z_min + z_max)/2], fixed=True, wire=True))

# Generate a cloud of spheres
sp=yade._packSpheres.SpherePack()
sp.makeCloud(Vector3(x_min, y_min, z_min), Vector3(x_max, y_max, z_max), 0.006, 0.2)
O.bodies.append([utils.sphere(s[0], s[1]) for s in sp])

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.