Skip to content

Curvature solve does not convert a planar surface into a "standard" surface #659

Description

@HarrisonKramer

Checklist

  • I have searched the existing issues and discussions for a similar question or problem.
  • I have read the documentation and tried to find an answer there.
  • I am using the latest version of Optiland (if not, please update and retry).
  • I have tried to reproduce or debug the issue myself before opening this.
  • I have included all necessary context, such as version info, error messages, or minimal reproducible examples.

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)
Image

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:

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions