Uniform piecewise polynomial approximation with variable joints