This script gives the primitive triangles with integer sides and a 60° angle (resp 120°).
x² = u² + v² ± uv, GCD(x,u,v)=1

For all r and s coprime, r not a multiple of 3

r and s odd

else

u = |3s²-r²-2rs|/4 v = |3s²-r²+2rs|/4 x = (r²+3s²)/4

u = |3s²-r²-2rs| v = |3s²-r²+2rs| x = r²+3s²

If r<s or r>3s, angle is 60°, x² = u² + v² - uv
If s<r<3s angle is 120°, x² = u² + v² + uv

This script really searches, for every x value, all suitable r and s,
which gives the triangles sorted by increasing x.

Annexe A - values of x with |u-v|=1

4x²-1 = 3z² is a Pell equation X²-3z² = 1, restricted to X = 2x even.
X = 2, z = 1 is the fundamental solution, all solutions with X even are (2,1)^{2n+1},
product being defined as (a,b)*(u,v) = (au+3bv, av+bu).
That is z_{n+2} = 14z_{n+1}-z_{n} with z_{0} = -1, z_{1} = 1
X_{n+2}/2 = x_{n+2} = 14x_{n+1}-x_{n} with x_{0} = 1, x_{1} = 1
(For x = 1 the only triangle is u = v = 1. So x = 1 is rejected)