mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Replaced Axis.as_infinite_edge with Edge __init__ method Issue #648
This commit is contained in:
parent
b40bcf9a24
commit
ce20991745
3 changed files with 107 additions and 107 deletions
|
|
@ -300,7 +300,7 @@ class TestAxis(DirectApiTestCase):
|
|||
self.assertVectorAlmostEquals(axis.direction, (-1, 0, 0), 5)
|
||||
|
||||
def test_axis_as_edge(self):
|
||||
edge = Axis.X.as_infinite_edge()
|
||||
edge = Edge(Axis.X)
|
||||
self.assertTrue(isinstance(edge, Edge))
|
||||
common = (edge & Edge.make_line((0, 0, 0), (1, 0, 0))).edge()
|
||||
self.assertAlmostEqual(common.length, 1, 5)
|
||||
|
|
@ -994,7 +994,7 @@ class TestEdge(DirectApiTestCase):
|
|||
self.assertAlmostEqual(e3_trim.length, 7, 5)
|
||||
|
||||
a4 = Axis((0, 0, 0), (1, 1, 1))
|
||||
e4_trim = a4.as_infinite_edge().trim_to_length(0.5, 2)
|
||||
e4_trim = Edge(a4).trim_to_length(0.5, 2)
|
||||
self.assertAlmostEqual(e4_trim.length, 2, 5)
|
||||
|
||||
def test_bezier(self):
|
||||
|
|
@ -1068,6 +1068,10 @@ class TestEdge(DirectApiTestCase):
|
|||
e2r = e2.reversed()
|
||||
self.assertAlmostEqual((e2 @ 0.1).X, -(e2r @ 0.1).X, 5)
|
||||
|
||||
def test_init(self):
|
||||
with self.assertRaises(ValueError):
|
||||
Edge(direction=(1, 0, 0))
|
||||
|
||||
|
||||
class TestFace(DirectApiTestCase):
|
||||
def test_make_surface_from_curves(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue