mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 04:27:53 +00:00
Handle edge case of low ring end
This commit is contained in:
parent
dd0e91015c
commit
bd2d45ebc6
1 changed files with 2 additions and 0 deletions
|
|
@ -432,6 +432,8 @@ def earclip_triangulation(verts: Vect3Array | Vect2Array, ring_ends: list[int])
|
|||
|
||||
# Points at the same position may cause problems
|
||||
for i in rings:
|
||||
if len(i) < 2:
|
||||
continue
|
||||
verts[i[0]] += (verts[i[1]] - verts[i[0]]) * epsilon
|
||||
verts[i[-1]] += (verts[i[-2]] - verts[i[-1]]) * epsilon
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue