Add a Glass refractive material with Sellmeier dispersion#176
Open
jacobdparker wants to merge 1 commit into
Open
Add a Glass refractive material with Sellmeier dispersion#176jacobdparker wants to merge 1 commit into
Glass refractive material with Sellmeier dispersion#176jacobdparker wants to merge 1 commit into
Conversation
Adds `optika.materials.Glass`, the first surface material that changes the index of refraction of a transmitted ray (`Vacuum`, the mirrors, and the multilayers all leave the transmitted index unchanged). The index of refraction follows the three-term Sellmeier dispersion equation, with `n_bk7()` and `f2()` constructors for SCHOTT N-BK7 crown and F2 flint glass. This makes refractive (lens) systems representable in optika, and gives the stop root-finding problem a real surface where `n2 != n1` for a transmitted ray. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #176 +/- ##
=======================================
Coverage 99.34% 99.35%
=======================================
Files 116 116
Lines 5974 6024 +50
=======================================
+ Hits 5935 5985 +50
Misses 39 39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What
Adds
optika.materials.Glass, the first surface material whose index ofrefraction changes the index carried by a transmitted ray. Every existing
surface material leaves the transmitted index unchanged —
Vacuumreturns 1,and the mirrors/multilayers/filters all
return rays.index_refraction— sorefractive (lens) systems weren't representable in optika.
How
Glass.index_refraction(rays)evaluates the three-term Sellmeier dispersionequation,
at the ray's vacuum wavelength. Classmethods
Glass.n_bk7()andGlass.f2()return SCHOTT N-BK7 crown and F2 flint glass using published coefficients.
Tests
TestGlassruns the standardAbstractTestAbstractMaterialbattery, plustest_glass_dispersionwhich checks the index at the helium d Fraunhofer lineagainst the published value (N-BK7 → 1.5168, F2 → 1.6200), confirms normal
dispersion (higher index toward the blue), and that the glass transmits rather
than reflects.
Why
This is the prerequisite for representing refractive optics in optika, and it
gives the stop root-finding problem a real surface where
n2 ≠ n1for atransmitted ray (relevant to the
_anchor_surfacediscussion on #169). Afollow-up will use it for a lens tutorial once the stop-solver supports
refractive systems — see the companion issue.
🤖 Generated with Claude Code