Question #403663 on Yade changed: https://answers.launchpad.net/yade/+question/403663
Status: Open => Answered Jan Stránský proposed the following answer: Hi Seti, something like this? ############## from yade import pack import random mat1 = CpmMat() # ... mat2 = CpmMat() # ... sp = pack.randomDensePack(pack.inAlignedBox((0,0,0),(1,1,1)),radius=.05,spheresInCell=500,returnSpherePack=True) sp.toSimulation() for b in O.bodies: if random.random() < 0.2: b.mat = mat1 b.shape.color = (1,0,0) else: b.mat = mat2 b.shape.color = (0,1,1) ############## cheers Jan 2016-10-31 12:14 GMT+01:00 Seti <question403...@answers.launchpad.net>: > New question #403663 on Yade: > https://answers.launchpad.net/yade/+question/403663 > > Hi All, > > I have the same question which has been asked in Q # 372295. I really > need to know how I can control the percentage of spheres when I am > modelling different materials through CPM model. > > Can you please shed some lights on this issue? > > > Cheers, > Seti > > -- > You received this question notification because your team yade-users is > an answer contact for Yade. > > _______________________________________________ > Mailing list: https://launchpad.net/~yade-users > Post to : yade-users@lists.launchpad.net > Unsubscribe : https://launchpad.net/~yade-users > More help : https://help.launchpad.net/ListHelp > -- You received this question notification because your team yade-users is an answer contact for Yade. _______________________________________________ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp