Skip to content

Commit

Permalink
Merge pull request #649 from jdegenstein/jernArc360fix
Browse files Browse the repository at this point in the history
Complete JernArc relocates vertex
  • Loading branch information
jdegenstein authored Jun 24, 2024
2 parents 2cd6365 + 74f5f68 commit a0dc935
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/build123d/objects_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion tests/test_build_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a0dc935

Please sign in to comment.