def __init__(self, cube_size=2, block_size=None, start_pos=None, block_color=None, set_colors=True): RubiksCube.__init__(self, cube_size, False) BVCube.__init__(self, start_pos, cube_size) BFps.__init__(self) if block_size is None or block_size < 2: self._block_size = 2 else: self._block_size = block_size if block_color is None: self._block_color = color.gray(0.4) else: self._block_color = block_color start_point = self._dimension*self._block_size/2 start_vector = self._pos - vector(start_point, start_point, start_point) half_block = vector(self._block_size/2, self._block_size/2, self._block_size/2) # generate all the cubes for x in xrange(self._dimension): for y in xrange(self._dimension): for z in xrange(self._dimension): current_vector = vector(self._block_size*x, self._block_size*y, self._block_size*z) current_block_pos = start_vector + half_block + current_vector self._array[x][y][z] = VCube(current_block_pos,self._block_color,self._block_size*2) self.reset_array(set_colors)
def __init__(self, base_pos=None, base_color=None, base_dimension=None): Cube.__init__(self) BVCube.__init__(self, base_pos, base_dimension) if base_color is None: self.color = color.white else: self.color = base_color self._center_box = box(frame=self.v_frame, size=self.get_vector_size(), pos=self._pos, color=self.color)