I claim that the following algorithm will always give a primitive Pythagorean triple.
Let $d$ be some even number and let $D$ be the set containing all its factors. Then for any two coprime factors $d_1,d_2$ who multiply to $d$ where $d_1\equiv1\pmod 2$ and $d_2\equiv0\pmod2$, the following is always a primitive Pythagorean triple:
$$\left(d+d_1^2,d+\frac{d_2^2}{2},d+d_1^2+\frac{d_2^2}{2}\right)$$
Ex. $d=12$ has coprime factors $d_1=3$ and $d_2=4$. Plugging into our formula:
$$\left(12+3^2,12+\frac{4^2}{2},12+3^2+\frac{4^2}{2}\right)$$ $$(21,20,29)$$
I noticed this from doing some geometric constructions of inscribed circles of natural radius within known Pythagorean triple triangles and spotting patterns. I would be very surprised if this were not well known. It is fairly straightforward to show that this formula always generates a primitive Pythagorean triple by using prime factorizations. Choosing relatively composite factors simply generates nonprimitive triples.
However, I also wrote a program to check if this approach exhausts primitive Pythagorean triples, and for the first ~2.7 million triples it does. But I have no idea how one might prove something like this. Some advice would be greatly appreciated.
This is a case of Euclid's formula, which covers all primitive triples, see e.g. here.
Condition statement is "$m$ and $n$ are coprime and one of them is even" and "$m > n > 0$".
In your case only the $d+\frac{d_2^2}{2}$ item is even because $d = d_1 d_2$ and $d_2 = 2a$ by definition, in Euclid's formula it is only $2mn$, so
$2mn = d + \frac{d_2^2}{2} = d_1 d_2 + \frac{d_2^2}{2} = d_2(d_1 + \frac{d_2}{2}) = 2a(d1 + a)$
$mn = a(d1 + a)$
As $m$ is the bigger, $m = d_1 + a$ and $n = a$.
As above $d_2 = 2a = 2n$ and $m = d_1 + a = d_1 + n$ so $d_1 = m - n$. As $d_1$ is odd by definition, one of $m$ and $n$ is even, which is Euclid's formula's one condition. The other one is to be coprime, and it is also true, as if it wasn't, then $m - n$ could be written as $gcd(m,n)$ times a number, and the same for $2n$, but then $d_1$ and $d_2$ would also not be coprime, which contradicts your condition.
Checking your other two items:
$d + d_1^2 = d_1 d_2 + d_1^2 = (m - n)2n + (m - n)^2 = 2mn - 2n^2 + m^2 - 2mn + n^2 = -n^2 + m^2$
$d + d_1^2 + \frac{d_2^2}{2} = -n^2 + m^2 + \frac{d2^2}{2} = -n^2 + m^2 + \frac{(2n)^2}{2} = -n^2 + m^2 + 2n^2 = m^2 + n^2$
Which means all items are of the form of Euclid's formula's items, therefore all generate primitive Pythagorean triples. They cover all such triples, if any $(m,n)$ can be converted to $(d_1,d_2)$. Starting from the above $d + d_1^2 = -n^2 + m^2$:
$m^2 - n^2 = (m - n)(m + n) = d + d_1^2 = d_1 d_2 + d_1^2 = d_1(d_2 + d_1)$
or in short $(m - n)(m + n) = d_1(d_2 + d_1)$
As $d_1 = m - n$ always exists for any $(m,n)$, and $d_2 + d_1 = 2n + (m - n) = n + m$, we are done - or at least I hope I haven't missed something.