Tips for life, tips for tech

Dưới đây là đoạn code giúp chạy tạo ra một box có hình dạng xác định trước.

# import yade pack
from yade import pack, plot

# Create the box of the triaxial test
O.bodies.append(utils.geom.facetBox((1,1,1),(1,1,1),wallMask=31)) # center at (1,1,1), from that point to the corner, it should be (1,1,1)
# to any direction, to it will create a box which has side = 2 units.
# wallMask=31 means a box without top

# Generate set of particles
sp=pack.SpherePack()

# ramdomize the diametre
sp.makeCloud((0,0,0),(2,2,2),rMean=.05,rRelFuzz=.5)

# add pack to simulation
sp.toSimulation() 

Reply in English

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: