Skip to content

Feature/coating models and components - #62

Open
TacHawkes wants to merge 7 commits into
masterfrom
feature/coating-models-and-components
Open

TacHawkes wants to merge 7 commits into
masterfrom
feature/coating-models-and-components

Conversation

@TacHawkes

Copy link
Copy Markdown
Collaborator

Part 3 of 3: Surface Coating Models, Component Modernization & Rendering

Note: Builds upon PR #61 (feature/boundary-physics).

This PR introduces the surface coating API and updates components:

  • Coating models (ThinFilmCoating, SimpleARCoating, SimpleHRCoating, SimpleBeamsplitterCoating, JonesCoating).
  • with_coatings surface property composition without redundant 2D mesh wrapper bodies.
  • Refactored PlateBeamsplitter, PolarizingBeamSplitter, CubeBeamsplitter, and Waveplate.
  • Surface coating visualization in Makie extension.

@codecov

codecov Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.33472% with 358 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.08%. Comparing base (4eb0229) to head (f8f3738).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/OpticalComponents/Coatings/CoatedComponents.jl 66.93% 82 Missing ⚠️
...rc/OpticalComponents/Coatings/StandaloneCoating.jl 59.50% 49 Missing ⚠️
src/OpticalComponents/FacePartition.jl 31.70% 28 Missing ⚠️
src/SDFs/AbstractSDF.jl 75.45% 27 Missing ⚠️
ext/RenderObjects.jl 0.00% 24 Missing ⚠️
src/OpticalComponents/Coatings/Models.jl 91.21% 18 Missing ⚠️
src/SDFs/UnionSDF.jl 73.84% 17 Missing ⚠️
src/SDFs/PrimitiveSDF.jl 85.55% 13 Missing ⚠️
ext/RenderPresets.jl 0.00% 9 Missing ⚠️
src/OpticalComponents/Mirrors.jl 74.28% 9 Missing ⚠️
... and 27 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #62      +/-   ##
==========================================
+ 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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a57e5f814f

ℹ️ 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".

"""
function coating_transmittance(c, θi, λ, n1, n2; from_front::Bool = true, local_p = nothing)
J_t = get_jones_matrix(c, θi, λ, n1, n2, false; from_front = from_front, local_p = local_p)
return clamp(unpolarized_transmittance(J_t), 0.0, 1.0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply impedance scaling to transmitted power

When n1 != n2, this treats field transmission amplitudes as power. For example, an uncoated normal-incidence air→glass boundary returns J_t = 0.8, so coating_transmittance becomes 0.64 even though the physical transmitted power is 1 - R = 0.96; scalar Ray weights through uncoated lenses or thin-film AR coatings are therefore undercounted and can trigger incorrect detector power or power-cutoff behavior. The transmittance path needs the usual admittance factor instead of just abs2(J_t).

Useful? React with 👍 / 👎.

Comment thread src/SDFs/PrimitiveSDF.jl Outdated
end

function bounding_sphere(s::CylinderSDF{T}) where T
return (Point3{T}(0), sqrt(s.radius^2 + (s.height / 2)^2))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the full cylinder half-height in the culling sphere

For CylinderSDF, the SDF subtracts cylinder.height directly, so the caps are at |y| == height; this new bounding sphere halves that extent again. Long cylinders now get valid side hits rejected before ray marching—for example CylinderSDF(1, 10) with a ray crossing the side near y = 9 never reaches _raymarch_outside because the undersized sphere misses. The radius should include the full stored y half-extent.

Useful? React with 👍 / 👎.

Generates a two-component "cemented" doublet lens consisting of two aspherical lens elements with conic constants `k1`, `k2`, and `k3`.
"""
@inline _to_refractive_index(n::Real) = (λ -> n)
@inline _to_refractive_index(n) = test_refractive_index_function(n)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return validated refractive-index objects

When n1 or n2 is any valid non-Real RefractiveIndex such as a function, DiscreteRefractiveIndex, or SellmeierEquation, this helper calls test_refractive_index_function and returns its nothing result. AsphericalDoubletLens then passes nothing into the Lens constructors below, so dispersive aspherical doublets fail at construction while constant numeric indices work. Return n after validation instead.

Useful? React with 👍 / 👎.

…ix surface_tag fallback and numeric_gradient step
@TacHawkes
TacHawkes force-pushed the feature/coating-models-and-components branch from a57e5f8 to 24b1328 Compare August 19, 2026 05:24
@TacHawkes
TacHawkes force-pushed the feature/coating-models-and-components branch from 24b1328 to 04a678a Compare August 19, 2026 05:27
Kliebisch, Oliver added 3 commits August 19, 2026 07:40
@TacHawkes
TacHawkes force-pushed the feature/coating-models-and-components branch from 04a678a to 56aae83 Compare August 19, 2026 05:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant