mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Add non-planar curve to filter_by(Plane) tests
This commit is contained in:
parent
9b72b4648e
commit
80a5729a5a
1 changed files with 9 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue