I've found at least two questions that deal with whether isometries are affine, Are isometries always linear? and Should isometries be linear?
However, both of these questions assume we are dealing with entire vector spaces. What if, instead, we have two normed vector spaces $V$ and $W$ over $\mathbb{R}$ with $X\subset V$ and $f:X\rightarrow W$ an isometry (i.e., $\vert\vert f(x_1)-f(x_2)\vert\vert_W=\vert\vert x_1-x_2\vert\vert_V$ for all $x_1,x_2$ in $X$)? Since a general subset $X$ isn't a vector space, the question must be made more precise: is $f$ the restriction of some affine transformation $g:V\rightarrow W$ to $X$? By the Mazur-Ulam theorem, this is equivalent to asking whether $f$ can always be extended to a surjective isometry on all of $V$. If not, what additional conditions have to be met for $f$ to be affine in this sense?
My motivation for asking this is that often we say rigid motions must be given by orthogonal transformations. For example, a rigid cube flying through the air can only rotate. But since the time evolution of the cube is only a map from the cube's initial configuration to its present, saying that such motion must be affine because isometries of $\mathbb{R}^3$ as a whole are affine doesn't seem to follow - I don't care about $\mathbb{R}^3$, I only care about the cube specifically.