← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3712: introduce tolerence in overlap check for intersecting spheres

 

------------------------------------------------------------
revno: 3712
committer: Klaus Thoeni <klaus.thoeni@xxxxxxxxx>
timestamp: Fri 2013-08-30 16:19:46 +1000
message:
  introduce tolerence in overlap check for intersecting spheres
modified:
  core/Clump.cpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'core/Clump.cpp'
--- core/Clump.cpp	2013-07-05 07:33:47 +0000
+++ core/Clump.cpp	2013-08-30 06:19:46 +0000
@@ -119,7 +119,7 @@
 				const Sphere* sphere1 = YADE_CAST<Sphere*> (subBody1->shape.get());
 				const Sphere* sphere2 = YADE_CAST<Sphere*> (subBody2->shape.get());
 				Real un = (sphere1->radius+sphere2->radius) - dist.norm();
-				if (un > 0.) {intersecting = true; break;}
+				if (un > -0.001*min(sphere1->radius,sphere2->radius)) {intersecting = true; break;}
 			}
 		}
 	}