Skip to content

Add file-backed optical layout presets and editor loading improvements#497

Open
dragonleopardpig wants to merge 9 commits intoDCC-Lab:masterfrom
dragonleopardpig:common-optical-layouts
Open

Add file-backed optical layout presets and editor loading improvements#497
dragonleopardpig wants to merge 9 commits intoDCC-Lab:masterfrom
dragonleopardpig:common-optical-layouts

Conversation

@dragonleopardpig
Copy link
Copy Markdown

@dragonleopardpig dragonleopardpig commented Apr 3, 2026

Summary

This PR adds file-backed common optical layout presets to the UI editor and improves loading/saving workflows so layouts and examples can be loaded
through the same editor path.

Main changes

  • add a new raytracing/common-optical-layouts/ directory with one Python file per preset layout
  • make the common-layout dropdown load directly from those files instead of using hardcoded in-app preset data
  • add a template file for creating new layouts:
    • raytracing/common-optical-layouts/_template.py
  • make new layout files appear automatically in the dropdown when they are loadable
  • ignore private/template files that start with _

Included common layouts

  • Single Lens
  • 2f
  • 4f
  • Cooke Triplet
  • Double Gauss Lens
  • Telephoto (Infinity Focus)
  • Retrofocus Lenses
  • Finite Conjugate Objective
  • 20x Infinity Objective + 200 mm Tube Lens
  • Object-Space Telecentric
  • Double-Sided Telecentric
  • Galilean Beam Expander
  • Keplerian Beam Expander

Editor and loading improvements

  • add Open, Save, and Save As support for layout .py files through the File menu
  • save editor state back into a loadable layout Python file instead of exporting only a PDF
  • load layouts through the same reconstruction pipeline used for examples
  • improve example loading support for more simple sequential examples
  • keep layout/example dropdowns aligned and file-backed
  • preserve the original application menus (Quit, Edit, Help) while extending the File menu

Optical/pupil updates

  • add entrance pupil / exit pupil information to the UI
  • add pupil markers in the plot
  • avoid duplicated pupil markers across refreshes
  • improve exit pupil calculation so it does not rely on reversing the full optical path

Notes

These layout files are intended as editable starting points for exploration in the UI editor, not as final production prescriptions.

@dragonleopardpig dragonleopardpig changed the title Add common optical layout presets to the UI editor Add file-backed optical layout presets and editor loading improvements Apr 4, 2026
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