← Back to team overview

yade-users team mailing list archive

Re: [Question #683555]: How to check if there is interaction between Id1 and Id2 at current step?


Question #683555 on Yade changed:

Description changed to:
I'd like to make the simulation pause when O.interactions[id1,id2] lost, so I tried two ways to check if there is interaction between id1 and id2 at current step?
1.def stopIfIntLost():
    if O.interactions[1,2].isReal ==False:
But I found that this way is wrong according to [1].
2. def stopIfIntLost():
    if O.interactions[1,2].geom.penetrationDepth==0:
But I think this way is not good (it is wrong), because when O.interactions[1,2] lost, there will post an error. 
What I want is something like:
def stopIfIntLost():
    if there is no interaction between id1 and id2:
Is there any strategy you recommend to achieve it?
Many thanks.


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