Git Product home page Git Product logo

open-optical-designer's Introduction

Open Optical Designer

Alexander Bock

Launch Open Optical Designer

Open Optical Designer Screenshot 2 Open Optical Designer Screenshot 1

Introduction

This is a work-in-progress web application for designing optical lenses consisting of sequential lens elements. It is intended to support practical design of, for example, a large aperture double Gauss lens for a full frame camera with effective control of image aberrations. Support for mirrors and the design of reflecting telescopes is planned in the future.

Features

  • Full geometrical ray tracing simulated in 3D
  • Aspherical surfaces (conic constant)
  • Formula support for dynamically calculated surface properties
  • Incoming ray environment control
  • Automatic 2D cross section viewport
  • Geometric point spread function (spot diagram)
  • Display of focal length, effective f-number, and numerical aperture
  • Autofocus
  • Optical path length and phase
  • Axial and transverse chromatic aberration
  • Transverse ray aberration
  • Material database
  • Save/load designs as local JSON files
  • Import designs from ".len" files
  • Light and dark UI color schemes

Next Development Priorities

  • Mirrors (including systems such as catadioptric telescopes)
  • Design Optimization

Future Plans

  • Generate links for sharing designs by URL
  • Example designs (achromatic doublet, double Gauss, Cooke triplet, historical lenses, etc.)
  • Design generators/wizards (singlet, achromatic doublet, telescope objective, spherical best form lens, etc.)
  • Overall surface transmission for unpolarized light
  • Field curvature
  • Distortion
  • Abbe sine condition
  • Wavefront analysis
  • Modulation transfer function graph
  • Through-the-lens scene simulation (test chart, astronomical, custom photo with optional depth map)
  • 3D design view
  • Material browser/editor

Potential Future Considerations

  • Export standard element drawing PDFs for manufacturing
  • Even-degree polynomial terms added to aspherical surfaces
  • Anti-reflective coatings
  • Tolerances

Notes

Aspherical Surfaces

Open Optical Designer supports centered, symmetrical, aspherical surfaces of revolution from curves of the form:

$$ z(y) = \frac{y^2}{R + \sqrt{R^2-(K+1)y^2}} $$

defined by the radius of curvature $R$ and the conic constant $K$. The intersection of a ray with surfaces defined in this manner is implemented using direct evaluation of the exact solutions for the intersection of the surface with a parameterized line. The additional even-degree polynomial terms:

$$ {A_4}y^4 + {A_6}y^6 + {A_8}y^8 + {A_{10}}y^{10} + \cdots{} $$

used for more complex aspherical surfaces are not currently supported because a more complex procedure is required to determine ray intersections in the absence of an algebraic solution for the parameter of an intersecting line. The derivations directory contains artifacts from the process of finding these solutions for reference.

Units

Design parameters use generic measurement units, but designs generally follow a standard such as considering units equivalent to millimeters. Inputs and outputs that require specific units (such as the design center wavelength in micrometers) are labeled appropriately.

Formula Syntax and Evaluation

A surface input field value beginning with an equals sign (=) will be interpreted as a formula which can include numbers, arithmetic operations, and references to the final values of other surface fields.

Supported operators: (for arbitrary operands x and y)

  • x + y: addition
  • x - y: subtraction
  • x * y: multiplication
  • x / y: division
  • x ^ y: exponentiation
  • (x): parentheses
  • -x: negation

Supported surface variables: (where # is the 1-based surface index)

  • RC#: radius of curvature
  • AR#: aperture radius
  • TH#: thickness
  • CC#: conic constant

Examples:

  • To set the aperture radius of surface 2 to automatically update to match the aperture radius of surface 1, enter =AR1 into the aperture radius field for surface 2.
  • To set the thickness of surface 1 to automatically update to be one quarter of surface 1's radius of curvature, enter =RC1/4 into the thickness field for surface 1.

Note that the dynamic thickness of the final surface is not available for use in a formula when the "Last Surface Autofocus" setting in the "Environment Control" section is on.

Saving and Loading Files

The "Save JSON File" button will download the current lens design as a JSON file. Depending on your browser settings, this may prompt for a location and name to save the file or immediately save the file in your downloads directory with the default name (lens-design.json). The "Load JSON File" button can be used to load a lens design that was previously saved to a local file. JSON project files contain both the lens design and the environment settings.

Importing ".len" Files

The ".len" file import feature imports design surfaces and recognizes the following surface parameters:

  • Radius of curvature
  • Aperture radius
  • Thickness
  • Material
  • Conic constant

Development

Implemented Using Standard Web Technologies With No External Dependencies

This software does not utilize any external or third-party dependencies, fonts, images, packages, or frameworks. It is written in plain, modern JavaScript as a single page application using standard HTML and CSS with no build, preprocessing, generation, or transformation steps. It can be run directly in the browser locally without a web server if desired.

Unit Tests

Open tests/test.html in a browser to run the unit test suite.

Copyright

See COPYRIGHT.txt.

License

See LICENSE.txt.

open-optical-designer's People

Contributors

alexbock avatar

Stargazers

Moritz Riede avatar Mateusz Muszyński avatar Ziwei Zhu avatar Cheng Chen avatar Ryan Govostes avatar Lorenzo Mauro avatar Your Big Brother avatar  avatar Guangyuan Zhao avatar Xinge Yang avatar  avatar Eugen Pirogoff avatar  avatar  avatar Dong Gun Lee avatar Qingyao avatar Roy Smart avatar  avatar  avatar  avatar Robert Kondratowicz avatar James Bull avatar Matt avatar Xiaobo avatar Yitzchok Gottlieb avatar Cambera avatar overtube avatar  avatar  avatar Julian Xhokaxhiu avatar Andy Bao avatar  avatar Devon 'fire' Adkisson avatar Sean Stevens avatar  avatar  avatar

Watchers

 avatar  avatar Kostas Georgiou avatar

open-optical-designer's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.