Solution (source code)

= Solution

Let $E=\operatorname{aff}K$ be the <affine hull> and put $k=\dim E\leq n$. If $k=0$, $K$ is a singleton and is <homeomorphic> to $\mathbb B^0$. Suppose $k>0$. Choose $k+1$ <affinely independent> points of $K$ spanning $E$. Their <simplex> is contained in $K$ because $K$ is a <convex set>, and its <barycentre> $a$ has a neighbourhood in $E$ contained in that <simplex>. Identifying $E-a$ with $\mathbb R^k$, put $D=K-a$. For some $0<r\leq R<\infty$,
$$
r\mathbb B^k\subset D\subset R\mathbb B^k.
$$
Here the inner inclusion follows from that neighbourhood, and the outer one follows from the <compactness> of $K$.

Use the <Minkowski functional>
$$
p(z)=\inf\{t>0:z\in tD\}.
$$
The inclusions imply $|z|/R\leq p(z)\leq|z|/r$. The fact that $D$ is a <convex set> implies $p(z+w)\leq p(z)+p(w)$: if $z\in sD$ and $w\in tD$, then $(z+w)/(s+t)$ is a <convex combination> of points of $D$. Also $p(tz)=tp(z)$ for $t\geq0$. Consequently
$$
p(z)-p(w)\leq p(z-w)\leq|z-w|/r,
\qquad |p(z)-p(w)|\leq|z-w|/r.
$$
Thus $p$ is a <continuous function>. Since $D$ is closed and contains zero, $D=\{p\leq1\}$: the forward inclusion is immediate, and for the reverse inclusion one takes a limit of $z/t_j\in D$ with $t_j\to p(z)\leq1$, using <positive homogeneity> and the fact that $D$ is a <convex set>. For $z\ne0$, $p(z)>0$, so this limiting argument has no division by zero.

Define a radial <continuous map> by
$$
h(0)=a,\qquad h(t\theta)=a+\frac{t}{p(\theta)}\theta
\quad(0<t\leq1,\ |\theta|=1).
$$
Each ray meets $D$ in exactly $\{s\theta:0\leq s\leq1/p(\theta)\}$. Hence $h$ is a <bijection> from $\mathbb B^k$ to $K$. Away from zero its <continuity> follows from that of $p$, and at zero $|h(t\theta)-a|\leq Rt$. A <continuous map> that is a <bijection> from a <compact space> to a <Hausdorff space> is a <homeomorphism>. Therefore
$$
\boxed{K\cong\mathbb B^k,\qquad k=\dim(\operatorname{aff}K).}
$$
Using the <affine hull> is essential: $K$ can have empty interior in the ambient $\mathbb R^n$.