First of all, this only works for some very special triangles, namely those whose reflections tile the plane. Up to congruency, there are only finitely many of those. Fortunately, your example falls into this category, so here is the construction.
The basic idea is to extend $f$ by repeated reflection in the sides to a meromorphic function of the plane. This function will be doubly periodic with some period lattice $\Gamma$. Now using the fact that every such function is a rational function of $\wp$ and $\wp'$, where $\wp$ is the Weierstrass function corresponding to $\Gamma$, you can figure out an explicit expression.
In your case, if we normalize by $f(0)=\infty$, $f(1)=0$, and $f(i)=1$, the meromorphic function we get by repeated reflection has a corresponding lattice $\Gamma$ generated by $\omega_1=2$ and $\omega_2=2i$. In the fundamental square $[0,2)\times[0,2)$ it has double poles at $0$ and $1+i$, and critical points of local degree $4$ at $1$ and $i$. Its degree on the fundamental square is $4$, and it is also easy to see that $f$ is even. This all shows that $f(z) = R(\wp(z))$, where $\wp$ is the Weierstrass function with lattice $\Gamma$, and $R$ is a rational function of degree $2$. By comparing poles we see that $R$ has to have simple poles at $\infty$ and at $\wp(1+i)=e_3$, and by comparing zeros we see that $R$ has to have a double root at $\wp(1)=e_1$, so $R(w)= a \frac{(w-e_1)^2}{w-e_3}$. By using the normalization $1=f(i) = R(\wp(i)) = R(e_2)$ we get $a= \frac{e_2-e_3}{(e_2-e_1)^2}$, so to summarize $ f(z) = \frac{e_2-e_3}{(e_2-e_1)^2} \frac{(\wp(z)-e_1)^2}{\wp(z)-e_3} $ where we used the standard notation (see Wikipedia) $e_1 = \wp(\omega_1/2) = \wp(1), \quad e_2 = \wp(\omega_2/2) = \wp(i), \quad e_3 = \wp((\omega_1+\omega_2)/2) = \wp(1+i).$ Using either symmetry arguments or the explicit expression with $\theta$-functions we also know that $e_3=0$, $e_1>0$, and $e_2=-e_1$, so $ f(z) = -\frac{1}{4e_1} \frac{(\wp(z)-e_1)^2}{\wp(z)} $