def test_position(self): p = plane.create_xz(distance=-5.) result = plane.position(p) self.assertTrue(np.allclose(result, [0., -5., 0.])) p = plane.create_from_position(position=[0., 0., 1.], normal=[0., 0., 1.]) self.assertTrue(np.allclose(plane.position(p), [0., 0., 1.]))
def test_create_from_points(self): result = plane.create_from_points( [1., 0., 0.], [0., 1., 0.], [1., 1., 0.], ) self.assertTrue(np.allclose(result, [0., 0., 1., 0.])) self.assertTrue(np.allclose(plane.position(result), [0., 0., 0.])) result = plane.create_from_points( [1., 1., 0.], [1., 1., 1.], [0., 1., 1.], ) expected = plane.create([0., 1., 0.], 1.) self.assertTrue(np.allclose(result, expected)) self.assertTrue(np.allclose(plane.position(result), [0., 1., 0.]))
def test_create_from_position( self ): position = numpy.array( [ 1.0, 0.0, 0.0 ] ) normal = numpy.array( [ 0.0, 3.0, 0.0 ] ) result = plane.create_from_position( position, normal ) expected_normal = numpy.array([0.0, 1.0, 0.0] ) expected_position = numpy.array([0.0, 0.0, 0.0] ) self.assertTrue( numpy.array_equal( result[ :3 ], expected_normal ), "Plane normal incorrect" ) self.assertTrue( numpy.array_equal( plane.position(result), expected_position ), "Plane position incorrect" )
def test_position(self): p = plane.create_xz(distance=5.) result = plane.position(p) self.assertTrue(np.allclose(result, [0., 5., 0.]))
def test_position(self): p = plane.create_xz(distance=5.) result = plane.position(p) self.assertTrue(np.allclose(result, [0.,5.,0.]))