Add non-planar curve to filter_by(Plane) tests

This commit is contained in:
MatthiasJ 2023-10-28 14:45:38 -06:00
parent 9b72b4648e
commit 80a5729a5a

View file

@ -365,6 +365,15 @@ class TestShapeList(unittest.TestCase):
self.assertAlmostEqual(abs((faces[1].center()-faces[0].center()).dot(plane.z_dir)), 1)
axis_index = list(map(int, map(abs, plane.z_dir))).index(1)
self.assertTrue(all(abs(list(e.center())[axis_index]) > 0.1 for e in edges))
if plane == Plane.XY:
with BuildLine():
line = Line((0, 0, 0), (10, 0, 0)).edge()
bezier2d = Bezier((0, 0, 0), (5, 3, 0), (10, 0, 0)).edge()
bezier3d = Bezier((0, 0, 0), (3, 3, 0), (7, 1, 3), (10, 0, 0)).edge()
edges = ShapeList([line, bezier2d, bezier3d]) | plane
self.assertIn(line, edges)
self.assertIn(bezier2d, edges)
self.assertNotIn(bezier3d, edges)
# test filter by type
with BuildPart() as test: