示例#1
0
    def __init__(self):
        Cube.__init__(self,
                      wall_type=Wall2x2,
                      fmt='''                + ---- + ---- +
                | {00} | {01} |  
                | {00} | {01} |  
                +----- U -----+
                | {02} | {03} |  
                | {02} | {03} |  
                + ---- + ---- +
+------+------+ +------+------+ +------+------+ +------+------+
| {04} | {05} | | {08} | {09} | | {12} | {13} | | {16} | {17} |  
| {04} | {05} | | {08} | {09} | | {12} | {13} | | {16} | {17} |  
+----- L -----+ +----- F -----+ +----- R -----+ +----- B -----+
| {06} | {07} | | {10} | {11} | | {14} | {15} | | {18} | {19} |  
| {06} | {07} | | {10} | {11} | | {14} | {15} | | {18} | {19} |  
+------+------+ +------+------+ +------+------+ +------+------+
                +------+------+
                | {20} | {21} |  
                | {20} | {21} |  
                +----- D -----+
                | {22} | {23} |  
                | {22} | {23} |  
                +------+------+
''')
示例#2
0
  def __init__(self, cubesize=[64,64,64]):
    """Create empty array of cubesize"""

    # call the base class constructor
    Cube.__init__(self,cubesize)
    # note that this is self.cubesize (which is transposed) in Cube
    self.data = np.zeros ( self.cubesize, dtype=np.uint16 )
示例#3
0
    def __init__(self):
        Cube.__init__(self,
                      wall_type=Wall3x3,
                      fmt='''                        + ---- + ---- + ---- +
                        | {00} | {01} | {02} |
                        | {00} | {01} | {02} |
                        +----- U ---- U -----+
                        | {03} | {04} | {05} |
                        | {03} | {04} | {05} |
                        +----- U ---- U -----+
                        | {06} | {07} | {08} |
                        | {06} | {07} | {08} |
                        + ---- + ---- + ---- +
+ ---- + ---- + ---- +  + ---- + ---- + ---- +  + ---- + ---- + ---- +  + ---- + ---- + ---- +
| {09} | {10} | {11} |  | {18} | {19} | {20} |  | {27} | {28} | {29} |  | {36} | {37} | {38} |  
| {09} | {10} | {11} |  | {18} | {19} | {20} |  | {27} | {28} | {29} |  | {36} | {37} | {38} |  
+----- L ---- L -----+  +----- F ---- F -----+  +----- R ---- R -----+  +----- B ---- B -----+
| {12} | {13} | {14} |  | {21} | {22} | {23} |  | {30} | {31} | {32} |  | {39} | {40} | {41} |  
| {12} | {13} | {14} |  | {21} | {22} | {23} |  | {30} | {31} | {32} |  | {39} | {40} | {41} |  
+----- L ---- L -----+  +----- F ---- F -----+  +----- R ---- R -----+  +----- B ---- B -----+
| {15} | {16} | {17} |  | {24} | {25} | {26} |  | {33} | {34} | {35} |  | {42} | {43} | {44} |  
| {15} | {16} | {17} |  | {24} | {25} | {26} |  | {33} | {34} | {35} |  | {42} | {43} | {44} |  
+ ---- + ---- + ---- +  + ---- + ---- + ---- +  + ---- + ---- + ---- +  + ---- + ---- + ---- +
                        + ---- + ---- + ---- +
                        | {45} | {46} | {47} |
                        | {45} | {46} | {47} |
                        +----- D ---- D -----+
                        | {48} | {49} | {50} |
                        | {48} | {49} | {50} |
                        +----- D ---- D -----+
                        | {51} | {52} | {53} |
                        | {51} | {52} | {53} |
                        + ---- + ---- + ---- +
''')
示例#4
0
  def __init__(self, cubesize=[128,128,16]):
    """Create empty array of cubesize"""

    # call the base class constructor
    Cube.__init__(self,cubesize)
    # note that this is self.cubesize (which is transposed) in Cube
    self.data = np.zeros ( self.cubesize, dtype=np.float32 )
示例#5
0
    def __init__(self, cubesize):
        """Create empty array of cubesize"""

        # call the base class constructor
        Cube.__init__(self, cubesize)
        self.data = np.zeros(self.cubesize, dtype=np.uint32)
        # variable that describes when a cube is created from zeros rather than loaded from another source
        self._newcube = False
示例#6
0
文件: anncube.py 项目: j6k4m8/ndstore
  def __init__(self, cubesize):
    """Create empty array of cubesize"""

    # call the base class constructor
    Cube.__init__( self, cubesize )
    self.data = np.zeros(self.cubesize, dtype=np.uint32)
    # variable that describes when a cube is created from zeros rather than loaded from another source
    self._newcube = False
示例#7
0
  def __init__(self, cubesize=[128,128,16]):
    """Create empty array of cubesize"""

    # call the base class constructor
    Cube.__init__(self,cubesize)
    # note that this is self.cubesize (which is transposed) in Cube
    self.data = np.zeros ( self.cubesize, dtype=np.uint64 )
    # variable that describes when a cube is created from zeros rather than loaded from another source
    self._newcube = False
    def __init__(self, cubesize=[128, 128, 16]):
        """Create empty array of cubesize"""

        # call the base class constructor
        Cube.__init__(self, cubesize)
        # note that this is self.cubesize (which is transposed) in Cube
        self.data = np.zeros(self.cubesize, dtype=np.uint64)
        # variable that describes when a cube is created from zeros rather than loaded from another source
        self._newcube = False
示例#9
0
    def __init__(self, cubesize=[128, 128, 16], timerange=[0, 0]):
        """Create empty array of cubesize"""

        # call the base class constructor
        Cube.__init__(self, cubesize)
        # note that this is self.cubesize (which is transposed) in Cube
        self.timerange = timerange
        self.data = np.zeros([self.timerange[1] - self.timerange[0]] + self.cubesize, dtype=np.float32)

        # variable that describes when a cube is created from zeros
        #  rather than loaded from another source
        self._newcube = False
示例#10
0
  def __init__(self, cubesize=[128,128,16], timerange=[0,0]):
    """Create empty array of cubesize"""

    # call the base class constructor
    Cube.__init__(self,cubesize)
    # note that this is self.cubesize (which is transposed) in Cube
    self.timerange = timerange
    self.data = np.zeros ([self.timerange[1]-self.timerange[0]]+self.cubesize, dtype=np.float32)

    # variable that describes when a cube is created from zeros
    #  rather than loaded from another source
    self._newcube = False
示例#11
0
    def __init__(self, n):
        self.length = n
        Cube.__init__(self, self.length)

        self.color_rgb_values = {
            "F": (0, 1, 0),
            "B": (0, 0, 1),
            "U": (1, 1, 1),
            "D": (1, 1, 0),
            "R": (1, 0, 0),
            "L": (1, 0.568, 0)
        }

        grid_verts_2d = self._create_grid_2d()
        face_verts_2d = self._create_face_2d()

        self.grid_verts_3d = self.create_3d_verts(grid_verts_2d)
        self.face_verts_3d = self.create_3d_verts(face_verts_2d)