Skip to content

Commit

Permalink
clean flippability and train tracks with GREEN or PURPLE edges
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Jul 17, 2023
1 parent 72b63f0 commit 35375d9
Show file tree
Hide file tree
Showing 2 changed files with 168 additions and 96 deletions.
10 changes: 10 additions & 0 deletions veerer/triangulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
Triangulation of surfaces.
"""

import numbers
from array import array

from .permutation import *
from .env import require_package, flipper, curver

Expand Down Expand Up @@ -322,6 +324,14 @@ def _check(self, error=RuntimeError):
if self._fp[self._ep[self._vp[i]]] != i:
raise error('fev relation not satisfied')

def _check_half_edge(self, e):
if not isinstance(e, numbers.Integral):
raise TypeError('invalid half-edge {}'.format(e))
e = int(e)
if e < 0 or e >= self._n:
raise ValueError('half-edge number out of range e={}'.format(e))
return e

def __eq__(self, other):
if type(self) != type(other):
raise TypeError
Expand Down
Loading

0 comments on commit 35375d9

Please sign in to comment.