The h = 0.0 makes everything blow up in the closes_t calculation.
I first though that an initial guess of exactly 0.0 was extremely unlikely, but now that I think about it, I currently just assign spacepoints a z value of a pad center (which is discrete). So it is fairly easy that 2 spacepoints have exactly the same z value.
To fix this:
Deal with the case h = 0.0 in Helix::closest_t.
Deal with an initial parameter equal to exactly 0.0 in exactly the same way as scipy does it (they have a fixed variation rather than the 5% which wouldn't have an effect.
The
h = 0.0
makes everything blow up in thecloses_t
calculation.I first though that an initial guess of exactly
0.0
was extremely unlikely, but now that I think about it, I currently just assign spacepoints az
value of a pad center (which is discrete). So it is fairly easy that 2 spacepoints have exactly the samez
value.To fix this:
h = 0.0
inHelix::closest_t
.0.0
in exactly the same way asscipy
does it (they have a fixed variation rather than the 5% which wouldn't have an effect.