mjhoptics / ray-optics

geometric ray tracing for optical systems
BSD 3-Clause "New" or "Revised" License
263 stars 54 forks source link

Refocus feature in GUI does not work properly #102

Closed pwarciszewski closed 1 year ago

pwarciszewski commented 1 year ago

Description

Hi, After clicking the "Refocus" function the calculated distance is getting accumulated each time when the function is invoked. As result, the focal plane is getting shifted from the correct position. I believe that the bug is in this line: https://github.com/mjhoptics/ray-optics/blob/311a030908eed9b7a18ce972a30def706c78257e/src/rayoptics/gui/appcmds.py#L374

Solution

Replacing += with = seems to solve the issue.

Best, pwarciszewski

mjhoptics commented 1 year ago

Fixed in this commit

Thanks for reporting and investigating it. Mike