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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

you can add PyRunner with a function checking/deleting the bodies:
###
O.engines = [
   ...
   PyRunner(iterPeriod=1000,command="checkAndDelete()"), # modify 1000 to your 
needs
]
def checkAndDelete():
   for b in O.bodies:
      x,y,z = b.state.pos
      if x<0 or x>10 or y<0 or y>20: # modify this condition to your needs
         O.bodies.erase(b.id)
###

For next questions, usually it is good idea to provide a MWE [1].

cheers
Jan

[1] https://yade-dem.org/wiki/Howtoask

-- 
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

Reply via email to