Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #57 +/- ##
==========================================
+ Coverage 73.46% 75.08% +1.62%
==========================================
Files 61 70 +9
Lines 3885 5150 +1265
==========================================
+ Hits 2854 3867 +1013
- Misses 1031 1283 +252 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b50da79f50
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| λ, | ||
| from_front | ||
| ) where {T, R <: Ray{T}} | ||
| ndir_t, _ = refraction3d(direction(ray), normal, n_incident, n_transmitted) |
There was a problem hiding this comment.
Handle total internal reflection before splitting
When a splitting coating is hit from a higher-index medium above the critical angle, refraction3d returns the reflected direction with the TIR flag set, but this path discards the flag and still creates a transmitted child with n_transmitted and T_coeff. A coated glass-air boundary with behavior = Splitting() will therefore emit a bogus transmitted branch instead of reflecting all power, corrupting traced beam trees in TIR cases.
Useful? React with 👍 / 👎.
| zrotate3d!(coating, π) | ||
| return RectangularPlateBeamsplitter(substrate, coating) | ||
| M = typeof(coating.model) | ||
| return RectangularPlateBeamsplitter{typeof(width), M}(substrate, coating) |
There was a problem hiding this comment.
Use promoted dimension type for plate constructors
If callers pass integer dimensions for width while other dimensions or mesh construction promote to floating point, this explicitly instantiates RectangularPlateBeamsplitter{Int64,...} even though substrate and coating are Prism{Float64,...}/Coating{Float64,...}. For inputs like RectangularPlateBeamsplitter(10, 10, 0.2, n) the constructor will fail at runtime; let T be inferred or use promote_type(typeof(width), typeof(height), typeof(thickness)).
Useful? React with 👍 / 👎.
…em to improve intersection checking.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb6397c429
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| w_dir_t, _ = refraction3d(direction(w_ray), normal, n_incident, n_transmitted) | ||
| d_dir_t, _ = refraction3d(direction(d_ray), normal, n_incident, n_transmitted) |
There was a problem hiding this comment.
Handle auxiliary beamlet TIR before splitting
When a GaussianBeamlet hits a splitting coating near the critical angle, the chief ray can still refract while the waist or divergence ray is already above critical angle because its direction/normal differs. refraction3d then returns a reflected direction with the TIR flag set, but these lines discard that flag and put the reflected support ray into the transmitted child with n_transmitted, producing an inconsistent split beamlet. Check the component-ray TIR flags before spawning the transmitted branch.
Useful? React with 👍 / 👎.
| retardance::Union{Real, Function}; | ||
| fast_axis_angle::Real=0.0 | ||
| ) | ||
| substrate_shape = BoxSDF(width, thickness, height) |
There was a problem hiding this comment.
Convert waveplate dimensions before constructing BoxSDF
When callers pass integer dimensions to this new rectangular plate constructor, BoxSDF(width, thickness, height) creates a BoxSDF{Int} and stores half-dimensions, so inputs like RectangularPlateWaveplate(10, 10, 1, n, π/2) throw an InexactError before the object is constructed. Promote/convert these dimensions to a floating T before constructing the substrate and coating, matching the updated plate beamsplitter constructors.
Useful? React with 👍 / 👎.
|
Splitted (by Gemini) into three sub-branches: |
…ix surface_tag fallback and numeric_gradient step
…SDF surface_tags to :top/:bottom, and make Aqua test conditional
…and preserve Gaussian beamlet ray weights
Abstract
This is a new attempt at coatings and is based on #55 as a prerequisite. It will also render #27 obsolete, as polarizing components can be handled using coatings which results in a much more flexible, modular and extensible API.
This should close #30.
Detailed description: Unified Coatings, Face Partitions, and Polarizing Optics
Overview
This PR implements a unified coatings and dynamic boundary physics pipeline in
BeamletOptics.jl. It standardizes boundary interactions (refraction, reflection, splitting) across rays and Gaussian/Astigmatic beamlets, modernizes polarizing components, and optimizes performance to achieve allocation-free tracing.Key Features
CoatingBehavior): Introduced traits (Transmissive,Reflective,Splitting) to cleanly dispatch boundary logic.Uncoated,SimpleARCoating,SimpleHRCoating,SimpleBeamsplitterCoating,JonesCoating, andThinFilmCoating(multi-layer characteristic matrix calculations).:front,:back,:hypotenuse), direction vectors, and spatial predicates to apply localized coatings.power_cutoffthreshold insolve_system!to prevent infinite loops.WaveplateandPolarizingBeamSplitter(plate & cube versions) to sit on top of the coating pipeline. Updated_calculate_global_E0to use correct 3D polarization projection mapping.