def __init__(self, pqr, init_dist):
     self.active = [bool(x) for x in init_dist]
     self.cox_mat = helpers.make_symmetry_matrix(pqr)
     self.dfa = automata.get_automaton(self.cox_mat)
     self.mirrors = self.get_mirrors(self.cox_mat)
     self.init_v = helpers.get_init_point(self.mirrors, init_dist)
     self.reflections = self.get_reflections(self.mirrors, init_dist)
     self.fundamental_faces = []
    def __init__(self, pqr, init_dist):
        if helpers.get_geometry_type(pqr) != 0:
            raise ValueError("The triple (p, q, r) must satisfy 1/p+1/q+1/r=1")

        self.active = [bool(x) for x in init_dist]
        self.cox_mat = helpers.make_symmetry_matrix(pqr)
        self.dfa = get_automaton(self.cox_mat)
        self.mirrors = self.get_mirrors(self.cox_mat)
        self.init_v = helpers.get_init_point(self.mirrors, init_dist)
        self.reflections = self.get_reflections(self.mirrors, init_dist)
        self.fundamental_faces = []
Exemplo n.º 3
0
    def __init__(self, coxeter_matrix, mirrors, init_dist, extra_relations=()):
        """
        parameters
        ----------
        :coxeter_matrix: Coxeter matrix of the symmetry group of this polytope.

        :mirrors: normal vectors of the mirrors.

        :init_dist: distances between the initial vertex and the mirrors.

        A presentation of a star polytope can be obtained by imposing more
        relations on the generators. For example "(ρ0ρ1ρ2ρ1)^n = 1" for some
        integer n, where n is the number of sides of a hole.

        See Coxeter's article

            "Regular skew polyhedra in three and four dimensions,
            and their topological analogues"

        """
        self.coxeter_matrix = coxeter_matrix
        # reflection transformations about the mirrors
        self.reflections = tuple(helpers.reflection_matrix(v) for v in mirrors)
        # the initial vertex
        self.init_v = helpers.get_init_point(mirrors, init_dist)
        # a mirror is active if and only if the initial vertex is off it
        self.active = tuple(bool(x) for x in init_dist)

        # generators of the symmetry group
        self.symmetry_gens = tuple(range(len(coxeter_matrix)))
        # relations between the generators
        self.symmetry_rels = tuple(
            (i, j) * self.coxeter_matrix[i][j]
            for i, j in combinations(self.symmetry_gens, 2))

        self.symmetry_rels += tuple(extra_relations)

        # to be calculated later
        self.vtable = None
        self.num_vertices = None
        self.vertex_coords = []

        self.num_edges = None
        self.edge_indices = []
        self.edge_coords = []

        self.num_faces = None
        self.face_indices = []
        self.face_coords = []
Exemplo n.º 4
0
    def __init__(self, upper_triangle, init_dist):
        # the Coxeter matrix
        self.coxeter_matrix = helpers.get_coxeter_matrix(upper_triangle)

        # the reflecting mirrors
        self._mirrors = helpers.get_mirrors(upper_triangle)

        # reflection transformations about the mirrors
        self._reflections = tuple(
            helpers.reflection_matrix(v) for v in self._mirrors)

        # coordinates of the initial vertex
        self.init_v = helpers.get_init_point(self._mirrors, init_dist)

        # a bool list holds if a mirror is active or not.
        self.active = tuple(bool(x) for x in init_dist)

        dim = len(self.coxeter_matrix)

        # generators of the Coxeter group
        self.symmetry_gens = tuple(range(dim))

        # relations between the generators
        self.symmetry_rels = tuple(
            (i, j) * self.coxeter_matrix[i][j]
            for i, j in combinations(self.symmetry_gens, 2))

        # to be calculated later
        self._vtable = None

        self.num_vertices = None
        self.vertex_coords = []

        self.num_edges = None
        self.edge_indices = []
        self.edge_coords = []

        self.num_faces = None
        self.face_indices = []
        self.face_coords = []
Exemplo n.º 5
0
    def __init__(self, coxeter_matrix, mirrors, init_dist, extra_relations):
        """
        params:
            `coxeter_matrix`: Coxeter matrix of the symmetry group.

            `mirrors`: normal vectors of the mirrors.

            `init_dist`: the distances between the initial point and the mirrors.

            `extra_relations`: extra relations to be imposed on the generators.
        """
        self.coxeter_matrix = coxeter_matrix
        self.reflections = tuple(helpers.reflection_matrix(v) for v in mirrors)
        self.init_v = helpers.get_init_point(mirrors, init_dist)
        self.active = tuple(bool(x) for x in init_dist)

        # generators of the symmetry group
        self.symmetry_gens = tuple(range(len(coxeter_matrix)))
        # relations between the generators
        self.symmetry_rels = tuple(
            (i, j) * self.coxeter_matrix[i][j]
            for i, j in combinations(self.symmetry_gens, 2))
        self.symmetry_rels += extra_relations

        # to be calculated later
        self.vtable = None
        self.num_vertices = None
        self.vertex_coords = []

        self.num_edges = None
        self.edge_indices = []
        self.edge_coords = []

        self.num_faces = None
        self.face_indices = []
        self.face_coords = []