fix: correct edge thickness calculation in LensOperand#528
Closed
lutzerb wants to merge 1 commit intooptiland:masterfrom
Closed
fix: correct edge thickness calculation in LensOperand#528lutzerb wants to merge 1 commit intooptiland:masterfrom
lutzerb wants to merge 1 commit intooptiland:masterfrom
Conversation
Two bugs in LensOperand.edge_thickness(): 1. TypeError crash when semi_aperture is None: the optimization loop does not call update_paraxial() before evaluating operands, so semi_aperture can still be None. Fix: call update_paraxial() internally when needed. 2. Wrong aperture used for sag evaluation: edge thickness was computed at the *minimum* semi-aperture, but a lens blank is ground to a single diameter set by the *maximum* clear aperture. Using the minimum masked real producibility issues. Fix: replace be.minimum with be.maximum. Fixes optiland#519 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
|
Hi there @lutzerb , Regarding the call of update_paraxial() inside the operand, I think that is not the safest approach, and would introduce other issues later on. Operands are evaluators and should not trigger global system traces, even if paraxial. I will think about a better approach here. NOTE: this is also then related to the issue #318 where I state the problem happening in the current codebase. I could work again on that in the coming week. I think it is time. The fix for the error in the computation of the edge_thickness makes sense, thank you for correcting that. I will come back to you on the first error your pointed out. Best, |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two bugs in LensOperand.edge_thickness():
TypeError crash when semi_aperture is None: the optimization loop does not call update_paraxial() before evaluating operands, so semi_aperture can still be None. Fix: call update_paraxial() internally when needed.
Wrong aperture used for sag evaluation: edge thickness was computed at the minimum semi-aperture, but a lens blank is ground to a single diameter set by the maximum clear aperture. Using the minimum masked real producibility issues. Fix: replace be.minimum with be.maximum.
Fixes #519