Question #265598 on Yade changed: https://answers.launchpad.net/yade/+question/265598
Jan Stránský proposed the following answer: > > > yes, my materials are completely different, one of them is sand and the > another one plastic grains. > > ok, then you can create just one sp (with two makeCloud calls) and do material assignment afterwards, something like: from yade import pack O.materials.append((FrictMat(young=1e9),FrictMat(young=3e9))) mat1,mat2 = [O.materials[i] for i in (0,1)] r1,r2 = 1.0,2.0 sp = pack.SpherePack() maxCorner = (20,20,20) sp.makeCloud(maxCorner=maxCorner,rMean=r1,num=20) sp.makeCloud(maxCorner=maxCorner,rMean=r2,num=10) sp.toSimulation() bodies1 = [b for b in O.bodies if b.shape.radius==r1] bodies2 = [b for b in O.bodies if b.shape.radius==r2] for b in bodies1: b.mat = mat1 b.shape.color = (1,0,0) for b in bodies2: b.mat = mat2 b.shape.color = (0,0,1) cheers Jan -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. _______________________________________________ Mailing list: https://launchpad.net/~yade-users Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp

