Skip to content

Fix annular lens polygon rendering#666

Merged
HarrisonKramer merged 2 commits into
optiland:masterfrom
ahfoysal:fix-annular-lens-polygons
Jul 11, 2026
Merged

Fix annular lens polygon rendering#666
HarrisonKramer merged 2 commits into
optiland:masterfrom
ahfoysal:fix-annular-lens-polygons

Conversation

@ahfoysal

@ahfoysal ahfoysal commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #538.

This splits 2D lens fill polygons around non-finite vertices so annular apertures render as separate clean patches instead of passing NaNs into Matplotlib polygons.

Tests:

  • pytest tests/visualization/system/test_lens2d_annular_aperture.py
  • pytest tests/visualization/system/test_optic_viewer_projection.py
  • ruff check optiland/visualization/system/lens.py tests/visualization/system/test_lens2d_annular_aperture.py
  • ruff format --check optiland/visualization/system/lens.py tests/visualization/system/test_lens2d_annular_aperture.py
  • uv build

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.01493% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
optiland/visualization/system/lens.py 92.30% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@HarrisonKramer

Copy link
Copy Markdown
Collaborator

Thanks for fixing this, @ahfoysal. I tested the update and all looks good.

I also added your name to the list of authors in the docs.

Merging now.

Best,
Kramer

@HarrisonKramer
HarrisonKramer merged commit a3371c5 into optiland:master Jul 11, 2026
8 of 9 checks passed
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.

2D layout: annular aperture (RadialAperture with r_min) causes polygon fill artifacts in Lens2D

2 participants