← Back to team overview

yade-users team mailing list archive

Re: [Question #270991]: Packing in a predicate excluding the volume already occupied by spheres

 

Question #270991 on Yade changed:
https://answers.launchpad.net/yade/+question/270991

Bruno Chareyre proposed the following answer:
The problem is here:
O.bodies.append([utils.sphere(c,r,material='coke') for c,r in sp])

You need to filter out those spheres which correspond to the initial
clumps, else each clump member is inserted again.

The last 500 spheres are 
[[[s,r] for s,r in sp][-k-1] for k in range(500)]

So this seems to be ok:
O.bodies.append([utils.sphere(sp[0],sp[1],material='coke') for sp in [[[s,r] for s,r in sp][-k-1] for k in range(500)]])

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