yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #26328
Re: [Question #698980]: How to remove particles from a packing?
Question #698980 on Yade changed:
https://answers.launchpad.net/yade/+question/698980
Status: Open => Answered
Jan Stránský proposed the following answer:
Thanks for clarification.
To remove particles / use only some particles, you have several options.
One is to extract particles and use only those you need in reset
simulation or a new simulation.
Another option is to use O.bodies.erase [1].
###
circleCenter = Vector3(1,2,3)
circleRadius = 123
for b in O.bodies:
d = (b.state.pos - circleCenter).norm() # distance of circleCenter and center of "b"
if d < circleRadius:
O.bodies.erase(b.id)
###
Cheers
Jan
[1] https://yade-
dem.org/doc/yade.wrapper.html#yade.wrapper.BodyContainer.erase
--
You received this question notification because your team yade-users is
an answer contact for Yade.