def D33(): R2 = flatsurf.Vector['eantic::renf_elem_class'] R = eantic.renf_elem zero = R(O, 0) one = R(O, 1) two = R(O, 2) one_fourth = R(O, 1) / R(O, 4) three_fourth = R(O, 3) / R(O, 4) eleven_fourth = R(O, 11) / R(O, 4) fifteen_fourth = R(O, 15) / R(O, 4) x = O.gen() vectors = [ R2(x + one_fourth, x), R2(-x, zero), R2(-one_fourth, -x), R2(x + three_fourth, 2), R2(-x, zero), R2(-three_fourth, -two), R2(one, two), R2(-one_fourth, zero), R2(-three_fourth, -two), R2(one, two), R2(x - fifteen_fourth, zero), R2(eleven_fourth - x, -two) ] vertices = [[1, -3, 5, -4, 9, -8, 10, -12, 11, -10, 6, -5], [3, -2, 4, -6, 8, -7, 12, -11, 7, -9, 2, -1]] return Surface(vertices, vectors)
def hexagon(): R2 = flatsurf.Vector['eantic::renf_elem_class'] x = K.gen() R = eantic.renf_elem vectors = [ R2(R(K, 2), R(K, 0)), R2(R(K, 1), x), R2(R(K, 3), x), R2(R(K, 1), -x), R2(R(K, 4), R(K, 0)), R2(R(K, 3), x) ] vertices = [[1, 3, -4, -5, -3, -2], [2, -1, -6, 4, 5, 6]] return Surface(vertices, vectors)
def random_hexagon(R2): x = K.gen() M = NumberFieldModule(K, RealNumber.rational(1), RealNumber.random(), RealNumber.random()) # The side lengths are going to be 2, 2·μ, 2·ν where μ,ν are the random parameters of M. one = M.gen(0) μ = M.gen(1) ν = M.gen(2) # We build our vectors from (2, 0), μ·(1, √3), ν.(-1, √3). u = R2(2 * one, 0 * one) v = R2(μ, x * μ) w = R2(-ν, x * ν) vectors = [u, v, u + v, -w, u + v - w, u + v] vertices = [[1, 3, -4, -5, -3, -2], [2, -1, -6, 4, 5, 6]] return Surface(vertices, vectors)
def hexagon(R2): x = K.gen() R = R2.Coordinate if R2 == flatsurf.Vector[cppyy.gbl.eantic.renf_elem_class]: R = eantic.renf_elem vectors = [ R2(R(K, 2), R(K, 0)), R2(R(K, 1), x), R2(R(K, 3), x), R2(R(K, 1), -x), R2(R(K, 4), R(K, 0)), R2(R(K, 3), x) ] vertices = [[1, 3, -4, -5, -3, -2], [2, -1, -6, 4, 5, 6]] return Surface(vertices, vectors)
def L(R2): vectors = [ R2(1, 0), R2(1, 1), R2(0, 1), R2(-1, 0), R2(-1, -1), R2(1, 0), R2(1, 1), R2(0, 1), R2(0, -1) ] vertices = [[ 1, 2, 3, 4, 5, -3, 6, 7, 8, -6, -2, 9, -4, -5, -9, -1, -7, -8 ]] return Surface(vertices, vectors)
cycles = [] while vertices: key = next(iter(vertices.keys())) cycle = [] while True: cycle.append(key) successor = vertices[key] del vertices[key] key = successor if key == cycle[0]: break cycles.append(cycle) vertices = cycles surface = Surface(vertices, vectors) print(surface) for connection in surface.saddle_connections(flatsurf.Bound(args.bound, 0)): print("Investigating in direction %s" % (connection.vector())) decomposition = flatsurf.makeFlowDecomposition(surface, connection.vector()) decomposition.decompose() if not all([ bool(component.cylinder()) for component in decomposition.components() ]): for component in decomposition.components(): print(component) if any([
def square(R2): vectors = [R2(1, 0), R2(0, 1), R2(1, 1)] vertices = [[1, 3, 2, -1, -3, -2]] return Surface(vertices, vectors)