← Back to team overview

yade-users team mailing list archive

Re: [Question #212834]: Contact number estimation

 

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

Christian Jakob posted a new comment:
Hi jessica,

> I just want to know how to get the id of the all body which has a
contact with a specific body?

body_id = ... #this is your part

for i in O.bodies[body_id].intrs(): # get all interactions from body with body_id
  if (i.geom.penetrationDepth > 0): # to get sure bodies are overlapping
    id1 = i.id1
    id2 = i.id2
    if id1 == body_id:
      print id2
    else:
      print id1

I hope this is working, I did not test ...

Regards,

Christian.

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.