← Back to team overview

yade-dev team mailing list archive

Re: strange behaviour in box-spheres interractions (sorry for the wrong previous title)

 

Ok, I found a strange behaviour with this code :

// Method1
scm->normal = pt1-pt2; scm->normal.Normalize();
scm->penetrationDepth = (pt1-pt2).Length();
cerr << "(pt1-pt2).Length()" << scm->penetrationDepth << "; normal=" << 
scm->normal << endl;
// Method 2
scm->normal = cOnBox_sphere;    //cOnBox_sphere is colinear to (pt1-pt2)
scm->penetrationDepth = depth;
cerr << "depth" << scm->penetrationDepth << "; normal=" << scm->normal 
<< endl;

scm->penetrationDepth is the same value with both methods, so that the 
box-spheres interpenetration has always been correct in Yade.
However, in method 1, the unit normal is (0, 0, 0) sometimes, even if 
(pt1-pt2).Length()  is NOT equal to 0.
I don't know if the problem is in "scm->normal = pt1-pt2" or in 
"scm->normal.Normalize()", but something bad is happening somewhere.
Now Yade uses method 2, but I'd really like to know what happens 
exactly. No time for more investigations today though.

Bruno



Bruno Chareyre a écrit :
> Hi
>
> The more I think the less I understand what is happening in 
> InteractingBox2InteractingSphere4SpheresContactGeometry.
>
> Vaclav, you were right, I didn't change anything in your code in 
> principle (except a small mistake that I introduced, I just corrected it 
> in svn, but it has no influence on what follows).
>
> Now I'm lost... I did run version 1194 and 1185, and I saw big 
> differences in the results regarding sphere-box interactions.
>
> Vaclav, could you have a look at the cpp file in version 1185 (your 
> version) and try to see a difference with the last revision. I really 
> can't see one (in the maths I mean, of course the code is a bit different).
>
> Just to be sure, in mathematics, those definitions of b are equivalent 
> right? :
> # a=x, then b=a
> # a=-x, then b=-a
> please, tell me that b=x in both cases  :-P 
>
> Bruno
>
>
>
>
>
>   
>> _______________________________________________
>> yade-dev mailing list
>> yade-dev@xxxxxxxxxxxxxxxx
>> https://lists.berlios.de/mailman/listinfo/yade-dev
>>
>>   
>>     
>
> _______________________________________________
> yade-dev mailing list
> yade-dev@xxxxxxxxxxxxxxxx
> https://lists.berlios.de/mailman/listinfo/yade-dev
>
>
>   

_______________________________________________
yade-dev mailing list
yade-dev@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-dev



References