From bee66421d4ccb3e16c69729f76c0eefa8875221e Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Mon, 24 Jun 2024 10:12:05 -0500 Subject: [PATCH 1/2] objects_curve.py -> update x_dir for 360(+) degree JernArc case --- src/build123d/objects_curve.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/build123d/objects_curve.py b/src/build123d/objects_curve.py index 9f48e3d8..0bce7c78 100644 --- a/src/build123d/objects_curve.py +++ b/src/build123d/objects_curve.py @@ -596,6 +596,7 @@ def __init__( if abs(arc_size) >= 360: circle_plane = copy.copy(jern_workplane) circle_plane.origin = self.center_point + circle_plane.x_dir = self.start - circle_plane.origin arc = Edge.make_circle(radius, circle_plane) else: arc = Edge.make_tangent_arc(start, start_tangent, self.end_of_arc) From 74f5f68bdcf4ce4c088ef6619a752ab118fdb254 Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Mon, 24 Jun 2024 10:19:42 -0500 Subject: [PATCH 2/2] test_build_line.py -> add test for vertex/start position --- tests/test_build_line.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_build_line.py b/tests/test_build_line.py index 4ee74ce2..e851ce2c 100644 --- a/tests/test_build_line.py +++ b/tests/test_build_line.py @@ -224,12 +224,15 @@ def test_jern_arc(self): self.assertAlmostEqual(iso1.radius, 1) self.assertAlmostEqual(iso1.length, pi) - with BuildLine() as l: + with BuildLine() as full_l: l1 = JernArc(start=(0, 0, 0), tangent=(1, 0, 0), radius=1, arc_size=360) + l2 = JernArc(start=(0, 0, 0), tangent=(1, 0, 0), radius=1, arc_size=300) self.assertTrue(l1.is_closed) + self.assertFalse(l2.is_closed) circle_face = Face(l1) self.assertAlmostEqual(circle_face.area, pi, 5) self.assertTupleAlmostEquals(circle_face.center().to_tuple(), (0, 1, 0), 5) + self.assertTupleAlmostEquals(l1.vertex().to_tuple(), l2.start.to_tuple(), 5) l1 = JernArc((0, 0), (1, 0), 1, 90) self.assertTupleAlmostEquals((l1 @ 1).to_tuple(), (1, 1, 0), 5)