mjhoptics / ray-optics

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

Qbfs polynomial aspheric surface #52

Open LaurenPao opened 3 years ago

LaurenPao commented 3 years ago

Hello Mike,

Thanks for the great package! The aspheric lens, ASL5040-UV from ThorLabs, is currently being treated as a spherical surface as opposed to a Qbfs polynomial surface. Perhaps, if possible, a future enhancement could include support for this type of surface?

Best, Lauren

brandondube commented 3 years ago

FYI, you can "borrow" the Qbfs code from prysm, which is highly optimized (and the other Q type polynomials). Since prysm is MIT, you could just vendor that into ray-optics as long as a license note is brought with it.

https://github.com/brandondube/prysm/blob/master/prysm/polynomials/qpoly.py#L39

A lru cache on the g,h,f would be prudent, but I never decided if I wanted to do that or hard-code the cache in some global variables, which would be a bit faster but "bad code."

mjhoptics commented 3 years ago

Hi Brandon, Thanks for the note. I stumbled across prysm recently but have been busy tying up loose ends from my IODC paper. I'll take a look and see whether it makes sense to lift the code or to include the project as a dependency. Thanks! Mike

On Sun, Aug 15, 2021 at 1:11 PM Brandon Dube @.***> wrote:

FYI, you can "borrow" the Qbfs code from prysm, which is highly optimized (and the other Q type polynomials). Since prysm is MIT, you could just vendor that into ray-optics as long as a license note is brought with it.

https://github.com/brandondube/prysm/blob/master/prysm/polynomials/qpoly.py#L39

A lru cache on the g,h,f would be prudent, but I never decided if I wanted to do that or hard-code the cache in some global variables, which would be a bit faster but "bad code."

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/mjhoptics/ray-optics/issues/52#issuecomment-899103734, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH6ANT6C2TNGULLVQXU74J3T5ANQVANCNFSM47KNSXAQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .