Esempio n. 1
0
 def test_plane_closest_pt_to(self):
     from lepton.domain import Plane
     from lepton.particle_struct import Vec3
     line = Plane((0, 0, 0), (0, 1, 0))
     for point, closest, normal in [
         ((0, 1, 0), (0, 0, 0), (0, 1, 0)),
         ((5, 0, 5), (5, 0, 5), (0, 1, 0)),
         ((10, -1, 0), (10, 0, 0), (0, -1, 0)),
     ]:
         p, N = line.closest_point_to(point)
         self.assertVector(p, closest)
         self.assertVector(N, normal)
Esempio n. 2
0
	def test_plane_closest_pt_to(self):
		from lepton.domain import Plane
		from lepton.particle_struct import Vec3
		line = Plane((0, 0, 0), (0, 1, 0))
		for point, closest, normal in [
			((0, 1, 0), (0, 0, 0), (0, 1, 0)),
			((5, 0, 5), (5, 0, 5), (0, 1, 0)),
			((10, -1, 0), (10, 0, 0), (0, -1, 0)),
			]:
			p, N = line.closest_point_to(point)
			self.assertVector(p, closest)
			self.assertVector(N, normal)