← Back to team overview

yade-users team mailing list archive

Re: [Question #668727]: How to give each clump a new material and a new color?

 

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

Kalyan  Khanal gave more information on the question:
#### show how to use makeClumpTemplate():


#dyad:
relRadList1 = [1,1]
relPosList1 = [[1,0,0],[-1,0,0]]

#peanut:
relRadList2 = [.5,1,.5]
relPosList2 = [[1,0,0],[0,0,0],[-1,0,0]]

#stick:
relRadList3 = [1,1,1,1,1]
relPosList3 = [[0,1,0],[0,2,0],[0,3,0],[0,4,0],[0,5,0]]

templates= []
templates.append(clumpTemplate(relRadii=relRadList1,relPositions=relPosList1))
templates.append(clumpTemplate(relRadii=relRadList2,relPositions=relPosList2))
templates.append(clumpTemplate(relRadii=relRadList3,relPositions=relPosList3))


#### show how to use replaceByClumps():


#replace by 50% dyads, 30% peanuts and 10% sticks:
O.bodies.replaceByClumps(templates,[.5,.3,.1])


How can I give different material to different clumps  like for dyad=materialx, peanut=materialY and so on?

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