2 from test_case
import TestCase
9 pts = hppfcl.StdVec_Vec3f()
10 pts.append(np.array((0, 0, 0)))
11 pts.append(np.array((0, 1, 0)))
12 pts.append(np.array((1, 0, 0)))
13 pts.append(np.array((0, 0, 1)))
14 tri = hppfcl.StdVec_Triangle()
15 tri.append(hppfcl.Triangle(0, 1, 2))
16 tri.append(hppfcl.Triangle(0, 1, 3))
17 tri.append(hppfcl.Triangle(0, 2, 3))
18 tri.append(hppfcl.Triangle(1, 2, 3))
19 return hppfcl.Convex(pts, tri)
25 halfspace = hppfcl.Halfspace(np.array((0, 0, 1)), 0)
27 req = hppfcl.CollisionRequest()
28 res = hppfcl.CollisionResult()
30 M1 = hppfcl.Transform3f()
31 M2 = hppfcl.Transform3f(np.eye(3), np.array([0, 0, -0.1]))
33 hppfcl.collide(convex, M1, halfspace, M2, req, res)
34 self.assertFalse(hppfcl.collide(convex, M1, halfspace, M2, req, res))
36 M1 = hppfcl.Transform3f()
37 M2 = hppfcl.Transform3f(np.eye(3), np.array([0, 0, 0.1]))
39 self.assertTrue(hppfcl.collide(convex, M1, halfspace, M2, req, res))
41 M1 = hppfcl.Transform3f()
42 M2 = hppfcl.Transform3f(np.eye(3), np.array([0, 0, 2]))
44 self.assertTrue(hppfcl.collide(convex, M1, halfspace, M2, req, res))
47 if __name__ ==
"__main__":