Question #680258 on Yade changed:
https://answers.launchpad.net/yade/+question/680258
Status: Open => Answered
Jan Stránský proposed the following answer:
Hello,
I don't know about any pre-defined function. But it is not difficult:
###
bID = ... # id of existing particle
b = O.bodies[bID] # body instance
pos,r = b.state.pos, b.shape.radius # position and radius
b2 = createDuplicate(pos,2*r) # define this function according to your needs
O.bodies.erase(bID) # delete existing particle
newID = O.bodies.append(b2) # and adds new particle. Note that ID is different
def createDuplicate(pos,size): # for example
from yade import polyhedra_utils
return polyhedra_utils.polyhedralBall(.5*size,30,mat,pos)
###
cheers
Jan
--
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 : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp