mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-15 15:20:37 -08:00
Add Vector.distance_from_plane.
This commit is contained in:
parent
99bb3a52a2
commit
1e7bfc53bc
2 changed files with 16 additions and 0 deletions
|
|
@ -2486,6 +2486,18 @@ class TestVector(DirectApiTestCase):
|
|||
self.assertEqual(a, b)
|
||||
self.assertEqual(a, c)
|
||||
|
||||
def test_vector_distance(self):
|
||||
"""
|
||||
Test line distance from plane.
|
||||
"""
|
||||
v = Vector(1,2,3)
|
||||
self.assertAlmostEqual(1, v.distance_from_plane(Plane.YZ))
|
||||
self.assertAlmostEqual(2, v.distance_from_plane(Plane.ZX))
|
||||
self.assertAlmostEqual(3, v.distance_from_plane(Plane.XY))
|
||||
self.assertAlmostEqual(-1, v.distance_from_plane(Plane.ZY))
|
||||
self.assertAlmostEqual(-2, v.distance_from_plane(Plane.XZ))
|
||||
self.assertAlmostEqual(-3, v.distance_from_plane(Plane.YX))
|
||||
|
||||
def test_vector_project(self):
|
||||
"""
|
||||
Test line projection and plane projection methods of Vector
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue