Closed Mateasek closed 4 years ago
I can confirm there is a bug. You can see it in the lens render:
Looking forward to these unit tests! Never had the time to write them for the less well used area of the framework.
Looks like it was due to a typo. The barrel was shifted forward, not backwards. It should be correct now.
Great, thanks for the fix. I will make tests for all the lenses and make PR.
Excellent, thanks.
I think I've spotted a problem in the construction of the back surface of the BiConcave lens. I tried to verify it with this simple test, where I defined edge points which I believe should be containted by the lens and then tested it by lens.contains.
The back surface points except the ceter one are not contained by the lens. I believe this is cause dy wrong shift of the lens barrel during initialisation:
I believe the problem is connected to the translation of the barrel having wrong z component value.
Also I would like to ask how the length of the barrel influences the performance during tracing? If it does not matter, than simply stretching it in between centres of the curvatures would be robust solution. If it does matter, then it could be made almost half of what it is now. I could review rest of the spherical lenses and make simmilar tests for all of them.