コード例 #1
0
    def test_test3(self):
        p1 = create_yz_plane(1)

        v = np.array([1., 0., 0.])

        self.assertEqual(p1.distance, 1.)
        self.assertEqual(np.all(p1.norm_vector == v), True)
コード例 #2
0
    def test_test4(self):
        p1 = create_yz_plane(1)
        p1.translation = [1, -100, 22000.]

        v = np.array([1., 0., 0.])

        self.assertEqual(np.isclose(p1.distance, 2.), True)
        self.assertEqual(np.all(p1.norm_vector == v), True)
コード例 #3
0
ファイル: plane_demo.py プロジェクト: ocordes/pycollision
    print(p1.distance)

    # plane / sphere
    s1 = Sphere([0, 0, 0], 1.)

    p1 = create_xy_plane(1)
    p1.translation = [1, 0, 0]

    result = s1.has_collisions(p1, verbose=True)

    print(result)
    # get the result
    print(result())

    # plane / plane

    p1 = create_xy_plane(0)
    p2 = create_xy_plane(1e-5)

    result = p1.has_collisions(p2, verbose=True, atol=1e-4)

    print(result)
    # get the result
    print(result())

    # plane / box
    b1 = Box([0, 0, 0], [1, 1, 1])
    p1 = create_yz_plane(0.5)

    reult = b1.has_collisions(p1, verbose=True)
コード例 #4
0
    def test_test2(self):
        p1 = create_xy_plane(0)
        p2 = create_yz_plane(1)

        result = p1.has_collisions(p2)
コード例 #5
0
    def test_test20(self):
        p1 = create_xy_plane(0)
        p2 = create_yz_plane(1)

        result = p1.has_collisions(p2, verbose=True, item='value')