コード例 #1
0
 def compute_transformations(self):
     Scanner.compute_transformations(self)
     if self.allow_inversions:
         # derive the connections with inversion rotations, based on those
         # without inversion rotations
         new_connections = []
         maximum = len(self.connections)
         for progress, connection in enumerate(self.connections):
             self.send(ProgressMessage("mirror", progress, maximum))
             new = copy.deepcopy(connection)
             mirror = (Translation(connection.triangle1.center) *
                       Rotation.from_properties(
                           numpy.pi, connection.triangle1.normal, True) *
                       Translation(-connection.triangle1.center))
             new.set_transformation(mirror * new.transformation)
             new_connections.append(new)
         self.connections.extend(new_connections)
         self.send(ProgressMessage("mirror", maximum, maximum))
コード例 #2
0
ファイル: triangle.py プロジェクト: mszep/zeobuilder
 def compute_transformations(self):
     Scanner.compute_transformations(self)
     if self.allow_inversions:
         # derive the connections with inversion rotations, based on those
         # without inversion rotations
         new_connections = []
         maximum = len(self.connections)
         for progress, connection in enumerate(self.connections):
             self.send(ProgressMessage("mirror", progress, maximum))
             new = copy.deepcopy(connection)
             mirror = (
                 Translation(connection.triangle1.center)
                 * Rotation.from_properties(numpy.pi, connection.triangle1.normal, True)
                 * Translation(-connection.triangle1.center)
             )
             new.set_transformation(mirror * new.transformation)
             new_connections.append(new)
         self.connections.extend(new_connections)
         self.send(ProgressMessage("mirror", maximum, maximum))