Skip to content

Commit

Permalink
fix type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
mozman committed Feb 5, 2025
1 parent 139aa93 commit 4698a5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ezdxf/entities/boundary_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,16 @@ def polyline_to_edge_paths(self, just_with_bulge=True) -> None:
"""

def _edges(points) -> Iterable[Union[LineEdge, ArcEdge]]:
prev_point = None
prev_bulge = None
prev_point: Vec3 | None = None
prev_bulge: float = 0.0
for x, y, bulge in points:
point = Vec3(x, y)
if prev_point is None:
prev_point = point
prev_bulge = bulge
continue

if prev_bulge != 0:
if prev_bulge != 0.0:
arc = ArcEdge()
# bulge_to_arc returns always counter-clockwise oriented
# start- and end angles:
Expand All @@ -286,7 +286,7 @@ def _edges(points) -> Iterable[Union[LineEdge, ArcEdge]]:
start_angle,
end_angle,
arc.radius,
) = bulge_to_arc(prev_point, point, prev_bulge) # type: ignore
) = bulge_to_arc(prev_point, point, prev_bulge)
chk_point = arc.center + Vec2.from_angle(start_angle, arc.radius)
arc.ccw = chk_point.isclose(prev_point, abs_tol=1e-9)
arc.start_angle = math.degrees(start_angle) % 360.0
Expand Down

0 comments on commit 4698a5c

Please sign in to comment.