File: pack-cloud.py

package info (click to toggle)
yade 2025.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,308 kB
  • sloc: cpp: 93,298; python: 50,409; sh: 577; makefile: 162
file content (13 lines) | stat: -rw-r--r-- 387 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
# -*- encoding=utf-8 -*-
""" Generate random periodic sphere packing using SpherePack::makeCloud """
from yade import pack

p = pack.SpherePack()
O.cellSize = Vector3(10, 10, 10)
print(p.makeCloud(Vector3(0, 0, 0), Vector3(10, 10, 10), .5, .5, 200, True))
for s in p:
	O.bodies.append(sphere(s[0], s[1]))
O.engines = [BoundDispatcher([Bo1_Sphere_Aabb()])]
from yade import qt

qt.View()