Checklist
Thanks for taking the time to go through this — it really helps us help you!
Bug Report
Describe the bug
When applying a curvature solve (e.g., MarginalRayAngleCurvatureSolve) to a planar surface, the surface is not converted from planar to "standard", which means the surface has a defined "radius" attribute, but it remains fundamentally planar.
To Reproduce
import numpy as np
from optiland import optic
lens = optic.Optic()
# add surfaces
lens.surfaces.add(index=0, thickness=np.inf)
lens.surfaces.add(index=1, thickness=7, radius=20.0, is_stop=True, material="N-SF11")
lens.surfaces.add(index=2, thickness=23.0, radius=np.inf) # <-- starting at inf is the problem
lens.surfaces.add(index=3)
# add aperture
lens.set_aperture(aperture_type="EPD", value=20)
# add field
lens.fields.set_type(field_type="angle")
lens.fields.add(y=0)
# add wavelength
lens.wavelengths.add(value=0.55, is_primary=True)
# add solve
lens.solves.add("marginal_ray_angle", surface_idx=2, angle=-0.1)
lens.info()
_ = lens.draw(num_rays=10)
lens.info() reports a radius on surface 2 of 22.6285, but the plot shows a planar surface.
Expected behavior
Second surface should NOT be planar:
Environment
- Optiland Version: latest
master (July 5, 2026)
- Python Version:
3.13.2
- OS:
Windows
Additional context
To solve, we likely simply need to flag surfaces that have a curvature solve and which are planar, and they should be converted to a standard surface. Similar logic is used in OpticUpdater.set_radius.
Checklist
Thanks for taking the time to go through this — it really helps us help you!
Bug Report
Describe the bug
When applying a curvature solve (e.g.,
MarginalRayAngleCurvatureSolve) to a planar surface, the surface is not converted from planar to "standard", which means the surface has a defined "radius" attribute, but it remains fundamentally planar.To Reproduce
lens.info()reports a radius on surface 2 of 22.6285, but the plot shows a planar surface.Expected behavior
Second surface should NOT be planar:
Environment
master(July 5, 2026)3.13.2WindowsAdditional context
To solve, we likely simply need to flag surfaces that have a curvature solve and which are planar, and they should be converted to a standard surface. Similar logic is used in
OpticUpdater.set_radius.