Skip to content

Commit

Permalink
optimize archive/tricy.pyx
Browse files Browse the repository at this point in the history
  • Loading branch information
mozman committed Jul 30, 2022
1 parent 6f99fc3 commit 752f5d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions archive/tricy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ def earclip(vertices: Iterable[UVec]) -> Iterator[Tuple[Vec2, Vec2, Vec2]]:
next_next_point = <Vec2> polygon[next_next_index]

groups = [
(prev_prev_point, prev_point, next_point, polygon),
(prev_point, next_point, next_next_point, polygon),
(prev_prev_point, prev_point, next_point),
(prev_point, next_point, next_next_point),
]
for j in range(len(groups)):
group = groups[j]
p = group[1]
if _is_ear(<Vec2> group[0], <Vec2> p, <Vec2> group[2], <list> group[3]):
p = <Vec2> group[1]
if _is_ear(<Vec2> group[0], p, <Vec2> group[2], polygon):
if p not in ear_vertices:
ear_vertices.append(p)
elif p in ear_vertices:
Expand Down

0 comments on commit 752f5d9

Please sign in to comment.