6. Among the 8 vertices, 12 midpoints of edges, 6 centers of faces, and 1 center of the cube, these 27 points, the number of groups of 8 points that lie on a common sphere is ( ).
(A) 4462
(B) 4584
(C) 4590
(D) 4602
6.B.

Place the cube in a spatial rectangular coordinate system, with the center of the cube as the origin, and the 8 vertices are $(2,2,2)$, $(-2,-2,-2)$, $(2,2,-2)$, $(2,-2,-2)$, where $(a, b, c)$ represents $(a, b, c)$ and its permutations.

The planes $z=0$, $z= \pm 2$ divide the 27 points into three layers. For each group of 8 points on a common sphere, there are at most 4 points on any layer (since there are no 5 points on a circle among the 9 points on each layer), and at least 3 points on a certain layer. The circumcenter $(x, y)$ of these 3 points can only be at
$(0,0)$; $(1,1),(-1,-1),(\overline{1,-1})$;
$(\overline{0,2}),(\overline{0,-2})$; $(\overline{0,1}),(\overline{0,-1})$;
$\left.\left(\overline{0, \frac{1}{2}}\right), \overline{0,-\frac{1}{2}}\right)$;
$(\overline{1,3}),(\overline{1,-3}),(\overline{-1,3}),(\overline{-1,-3})$;
$\left(\frac{1}{3}, \frac{1}{3}\right),\left(-\frac{1}{3},-\frac{1}{3}\right),\left(\frac{1}{3},-\frac{1}{3}\right)$.
Therefore, the center of the sphere for 8 points on a common sphere can only be at
(1) $(0,0,0)$;
(2) $(1,1,1),(-1,-1,-1)$,
$(\overline{1,1,-1}),(\overline{1,-1,-1})$;
(3) $(\overline{0,0,2}),(\overline{0,0,-2})$;
(4) $(\overline{0,0,1}),(\overline{0,0,-1})$;
(5) $\overline{0,1,1}),(\overline{0,1,-1}),(\overline{0,-1,-1})$;
(6) $\left.\left(\overline{0,0, \frac{1}{2}}\right), \overline{0,0,-\frac{1}{2}}\right)$;
(7) $(\overline{1,1,3}),(\overline{1,1,-3}),(\overline{1,-1,3})$,
$(\overline{1,-1,-3}),(\overline{-1,-1,3}),(-1,-1,-3)$;
(8) $\left(\frac{1}{3}, \frac{1}{3}, \frac{1}{3}\right),\left(-\frac{1}{3},-\frac{1}{3},-\frac{1}{3}\right)$,
$\left(\overline{\frac{1}{3}, \frac{1}{3},-\frac{1}{3}}\right),\left(\overline{\frac{1}{3},-\frac{1}{3},-\frac{1}{3}}\right)$.
Below, we denote the sphere with center $X$ and radius $r$ as $S(X, r)$. The number of points among the 27 points on this sphere is $|S(X, r)|$.
(1) $A(0,0,0)$.
$|S(A, 2)|=6,|S(A, 2 \sqrt{2})|=12$,
$|S(A, 2 \sqrt{3})|=8$;
(2) $B(1,1,1)$.
$|S(B, \sqrt{3})|=8,|S(B, \sqrt{11})|=12$;
(3) $C(0,0,2)$.
$|S(C, 2)|=5,|S(C, 2 \sqrt{2})|=8$,
$|S(C, 2 \sqrt{3})|=|S(C, 2 \sqrt{5})|$
$=|S(C, 2 \sqrt{6})|=4$;
(4) $D(0,0,1)$.
$|S(D, 1)|=2,|S(D, \sqrt{5})|=8$,
$|S(D, 3)|=9$,
$|S(D, \sqrt{13})|=|S(D, \sqrt{17})|=4$;
(5) $E(1,1,0)$.
$|S(E, \sqrt{2})|=|S(E, \sqrt{10})|=4$,
$|S(E, \sqrt{6})|=|S(E, \sqrt{14})|=8$;
(6) $F\left(0,0, \frac{1}{2}\right)$.
$$
\begin{array}{l}
\left|s\left(F, \frac{1}{2}\right)\right|=\left|S\left(F, \frac{3}{2}\right)\right|=1, \\
\left|S\left(F, \frac{\sqrt{17}}{2}\right)\right|=\left|S\left(F, \frac{\sqrt{33}}{2}\right)\right|=4, \\
\left|S\left(F, \frac{5}{2}\right)\right|=5,\left|S\left(F, \frac{\sqrt{41}}{2}\right)\right|=8 ;
\end{array}
$$
(7) $G(1,1,3)$.
$|S(G, \sqrt{3})|=4,|S(G, \sqrt{11})|=8$,
$$
|S(G, \sqrt{19})|=|S(G, 3 \sqrt{3})|=5 \text {; }
$$
(8) $H\left(\frac{1}{3}, \frac{1}{3}, \frac{1}{3}\right)$.
$$
\begin{array}{l}
\left|S\left(H, \frac{\sqrt{3}}{3}\right)\right|=1,|S(H, \sqrt{3})|=3, \\
\left.S\left(H, \frac{\sqrt{51}}{3}\right)|=| S(H, \sqrt{11}) \right\rvert\,=6, \\
\left.S\left(H, \frac{5 \sqrt{3}}{3}\right) \right\rvert\,=7 .
\end{array}
$$

In summary, the number of groups of 8 points on a common sphere is
$$
\begin{array}{l}
\left(\mathrm{C}_{n}^{8}+1\right)+8\left(1+\mathrm{C}_{12}^{8}\right)+6+6\left(1+\mathrm{C}_{9}^{8}\right)+ \\
\quad 2(1+1)+6+24 \\
=4584 \text { (groups). }
\end{array}
$$