predicte
Hi All,
last time I asked the question in this post:https:/
one answer for the local bodies is we can use the following code:
###
The same for interactions (e.g. based on their contactPoint):
###
predicate = pack.inAlignedB
localIntrs = [i for i in O.interactions if predicate(
#################
I did the same way, here is my code:
def local_interacti
predicate = pack.inAlignedB
#predicate = pack.inSphere(
localintrs = [i for i in O.interactions if predicate(
for i in localintrs:
constnormal1 = i.geom.normal[0]
constnormal2 = i.geom.normal[1]
constnormal3 = i.geom.normal[2]
print('this is contact normal 1:',constnormal1)
print('this is contact normal 2:',constnormal2)
print('this is contact normal 3:',constnormal3)
###############but I got the error:
In [1]: -------
ArgumentError Traceback (most recent call last)
/usr/bin/yade in <module>()
/usr/bin/yade in local_interaction()
40 predicate = pack.inAlignedB
41 #predicate = pack.inSphere(
---> 42 localintrs = [i for i in O.interactions if predicate(
43 for i in localintrs:
44 constnormal1 = i.geom.normal[0]
ArgumentError: Python argument types in
Predicate.
did not match C++ signature:
__call_
__call_
###############
sorry, I don't know the error, but i know it's related to line 42 "if predicate(
it seems i need to add something here.
#######
if we use another code post at that question.
###
predicate = pack.inAlignedB
localBodies = [b for b in O.bodies if predicate(
###
these code didn't give me error.
but if i change here---
for these code, i think we need the position as well as the radius to identify one sphere, so we need:b.
but for an interaction point, why we can't just use i.geom.contactPoint to determine the contact point is in this predicate or not?
overall, I think my question is how to use the predicate to determine whether a contact point is in this predicate or not?
thanks
Yong
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: