I can give a partial answer to this. That is to say, it's not a general approach but the idea could be used in some cases. What is necessary is to notice that we have, in essence (at least when restricting to real values), a gemoetry problem. We have points (p1,q1) and (p2,q2) on the unit circle and one unit apart from one another. So they, with the origin, give an equilateral triangle. Thus far we have two parametrized families of viable values, and they are identical up to swapping the two points. We now add the line y=x, and want to restrict our p's and q's, so to speak, to values that remain one unit from some point on this line. That gives a finite solution set, EXCEPT if we allow x to be zero, because then (x,x) corresponds to the third point on this parametrized family of equalateral triangles.
The way out of this is to add a variable and equation that forces x!=0. The standard approach is indicated in the code below.
NSolve[{d[{p1, q1}, {0, 0}] == 1, d[{p2, q2}, {0, 0}] == 1,
d[{p1, q1}, {p2, q2}] == 1, d[{p2, q2}, {x, x}] == 1,
d[{p1, q1}, {x, x}] == 1, x*xrecip == 1}, {p1, q1, p2, q2,
x}, {xrecip}]
(* Out[21]= {{p1 -> -0.258819045103, q1 -> -0.965925826289,
p2 -> -0.965925826289, q2 -> -0.258819045103,
x -> -1.22474487139}, {p1 -> -0.965925826289, q1 -> -0.258819045103,
p2 -> -0.258819045103, q2 -> -0.965925826289,
x -> -1.22474487139}, {p1 -> 0.965925826289, q1 -> 0.258819045103,
p2 -> 0.258819045103, q2 -> 0.965925826289,
x -> 1.22474487139}, {p1 -> 0.258819045103, q1 -> 0.965925826289,
p2 -> 0.965925826289, q2 -> 0.258819045103, x -> 1.22474487139}} *)
Solve
will do similarly with this restricted system.
Solve[{d[{p1, q1}, {0, 0}] == 1, d[{p2, q2}, {0, 0}] == 1,
d[{p1, q1}, {p2, q2}] == 1, d[{p2, q2}, {x, x}] == 1,
d[{p1, q1}, {x, x}] == 1, x*xrecip == 1}, {p1, q1, p2, q2,
x}, {xrecip}]
(* Out[20]= {{p1 -> -(Sqrt[(3/2)]/2) + 1/(2 Sqrt[2]),
q1 -> -(Sqrt[(3/2)]/2) - 1/(2 Sqrt[2]),
p2 -> -(Sqrt[(3/2)]/2) - 1/(2 Sqrt[2]),
q2 -> -(Sqrt[(3/2)]/2) + 1/(2 Sqrt[2]),
x -> -Sqrt[(3/2)]}, {p1 -> -(Sqrt[(3/2)]/2) - 1/(2 Sqrt[2]),
q1 -> -(Sqrt[(3/2)]/2) + 1/(2 Sqrt[2]),
p2 -> -(Sqrt[(3/2)]/2) + 1/(2 Sqrt[2]),
q2 -> -(Sqrt[(3/2)]/2) - 1/(2 Sqrt[2]),
x -> -Sqrt[(3/2)]}, {p1 -> Sqrt[3/2]/2 + 1/(2 Sqrt[2]),
q1 -> Sqrt[3/2]/2 - 1/(2 Sqrt[2]),
p2 -> Sqrt[3/2]/2 - 1/(2 Sqrt[2]),
q2 -> Sqrt[3/2]/2 + 1/(2 Sqrt[2]),
x -> Sqrt[3/2]}, {p1 -> Sqrt[3/2]/2 - 1/(2 Sqrt[2]),
q1 -> Sqrt[3/2]/2 + 1/(2 Sqrt[2]),
p2 -> Sqrt[3/2]/2 + 1/(2 Sqrt[2]),
q2 -> Sqrt[3/2]/2 - 1/(2 Sqrt[2]), x -> Sqrt[3/2]}} *)
NSolve
. $\endgroup$