Skip to content

Conversation

@Littie28
Copy link
Owner

@Littie28 Littie28 commented Dec 5, 2025

Summary

Adds Example 04 demonstrating advanced coordinate frame usage in optical raytracing. This example showcases how frame transformations dramatically simplify optical system design by allowing lens repositioning and reorientation
with single-line changes while keeping all geometric algorithms unchanged.

What's included

New notebook: examples/04-simple-raytracing.ipynb

  • Complete raytracing implementation with frame-based coordinates
  • Spherical and hyperbolic lens surface profiles
  • Meridional plane reduction technique for axisymmetric surfaces
  • Visualization of optical aberrations (spherical aberration, coma)
  • Immutable Ray class following hazy design philosophy
  • Snell's law vector-form refraction
  • Numerical intersection finding with scipy.optimize.brentq

Key demonstrations

  1. Frame transformations simplify optics: Reposition/rotate entire optical system by modifying frame definitions - all geometric calculations (intersection, refraction, propagation) remain unchanged
  2. Interchangeable components: Swap lens profiles (spherical -> hyperbolic) by changing one function - the raytracing algorithm stays identical
  3. Real-world techniques: Uses meridional plane reduction and conic surface formulas

Educational structure

  • TL;DR section for quick value proposition
  • Three progressive examples: aligned lens, misaligned lens (coma), hyperbolic lens
  • Comprehensive takeaways explaining frame-based coordinate benefits
  • Visualizations: 3D ray traces + 2D footprint plots

Changes

  • Created examples/04-simple-raytracing.ipynb
  • Updated CHANGELOG.md with new example entries

Demonstrates frame transformations in optical systems with:
- Spherical and hyperbolic lens surfaces
- Meridional plane reduction technique
- Frame-based lens positioning and orientation
- Visualization of spherical aberration and coma

Features immutable Ray class, Snell's law refraction, and
axisymmetric surface intersection using numerical root finding.

Also adds example 03 (robot arm kinematics) to CHANGELOG.
@Littie28 Littie28 merged commit c6f54f3 into main Dec 5, 2025
3 checks passed
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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

@Littie28 Littie28 deleted the docs/example4 branch February 1, 2026 20:59
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.

2 participants