6. As shown in Figure 3, with the right angle side $AB$ of the right triangle $\triangle ABC$ as the diameter, a semicircle $\odot O$ is drawn intersecting side $BC$ at point $D$. A tangent line is drawn through $D$ intersecting side $AC$ at point $E$. A line $EF$ parallel to $AB$ is drawn through $E$, intersecting $BC$ at point $F$. If $AB=20, OF=7.5$, then $CD=(\quad)$.
(A) 7
(B) 8
(C) 9
(D) 10
6. C.

From the problem, we know $A D \perp B C, D E=A E$. Therefore, $E$ is the midpoint of the hypotenuse $A C$ of the right triangle $\triangle A C D$.
$$
\begin{array}{l}
\text { Also, } E F / / A B \Rightarrow C F=B F \\
\Rightarrow A C=2 O F=15 \\
\Rightarrow B C=\sqrt{20^{2}+15^{2}}=25 .
\end{array}
$$

Thus, by the projection theorem, we get $C D=\frac{A C^{2}}{B C}=9$.