Metadata-Version: 2.4
Name: ray-tracing-shapely-optiland
Version: 0.1.2
Summary: 3D verification of ray_tracing_shapely nonimaging-optics designs via Optiland's non-sequential ray tracer -- scene assembly, notebook-embedded visualization, and ray/run persistence
Author: ray-tracing-shapely authors and contributors
Author-email: Michele Benetti <michele@tiberavon.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/tiberavon/ray-tracing-shapely-optiland
Project-URL: Repository, https://github.com/tiberavon/ray-tracing-shapely-optiland
Keywords: ray-tracing,optics,optiland,non-sequential,simulation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: NOTICE.txt
Requires-Dist: ray-tracing-shapely[flows,radiometry]>=0.4.3
Requires-Dist: optiland>=0.6.3
Provides-Extra: notebook
Requires-Dist: trame; extra == "notebook"
Requires-Dist: trame-vtk; extra == "notebook"
Requires-Dist: trame-vuetify; extra == "notebook"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Dynamic: license-file

# ray-tracing-shapely-optiland

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.24418339.svg)](https://doi.org/10.5281/zenodo.24418339)

3D verification of [`ray_tracing_shapely`](https://github.com/tiberavon/ray-tracing-shapely)
designs with [Optiland](https://github.com/optiland/optiland)'s non-sequential ray tracer.
A 2D design is handed over as a `profile.json`: its outline, the role and mechanism of
every surface, and the light it is designed for. Here it becomes a 3D scene, is traced,
and comes back.

## What it does

- **Solids and sheets from a profile.**
  - **An extruded profile** becomes a solid with polygon end caps.
  - **A revolved profile** becomes a solid or a mirror of revolution, each surface the one
    exact Optiland geometry it describes: planes, cones, conics (zones and azimuth cuts
    included), and two this package adds, a spline of revolution and an even asphere of
    revolution.
  - **Every stored point and normal is checked** against the surface built from it.
  - **Built solids read back** to `profile.json` (`import_from_optiland`,
    `import_revolved_from_optiland`).
- **Sources.** A source specification from the profile is placed where the 2D scene had
  it. A measured LED's rayfile is traced ray for ray (`RayfileSource`).
- **2D against 3D.**
  - **`compare_2d_3d`** traces the same meridional rays in both engines and compares them
    face by face.
  - **`compare_slice_3d`** compares a rayfile's 2D slice with its own records traced in 3D.
  - **Both as flows** (`Compare2D3DFlow`, `SliceCompareFlow`), from profile files alone
    (lenses and other solids, revolved mirror sheets, a profile's rayfile source): an
    agent starts them by name, and their 2D and 3D traces run as jobs an executor follows,
    here or on Modal.
- **A third engine.** A collimator's designed faces in Optiland's sequential mode, for an
  independent check.
- **What the light did.**
  - **Event logs** cut into one record per ray, and persisted to SQLite for queries.
  - **Irradiance maps** on a plane past the optic, plotted with their sections.
  - **Static 3D pictures,** rendered off-screen so that they survive a saved notebook,
    and an inline-Jupyter viewer.
- **Agent tools.** Read-only tools over a traced 3D scene and the 2D-against-3D comparison,
  registered into `ray_tracing_shapely`'s tool lists, and the two comparison flows,
  registered among the flows that can be started by name.

The components' own pages, in the `ray_tracing_shapely` repository, say what each part
guarantees:

- [`optiland_scene_bridge`](https://github.com/tiberavon/ray-tracing-shapely/blob/master/dev_doc/architecture/components/optiland_scene_bridge.md)
- [`optiland_nsq_run_registry`](https://github.com/tiberavon/ray-tracing-shapely/blob/master/dev_doc/architecture/components/optiland_nsq_run_registry.md)
- [`optiland_nsq_viewer`](https://github.com/tiberavon/ray-tracing-shapely/blob/master/dev_doc/architecture/components/optiland_nsq_viewer.md)

Distinct from the sibling [`optiland-sms`](https://github.com/tiberavon/optiland-sms) package,
an Optiland plugin that makes a profile's spline span a surface of Optiland's sequential
engine, which Optiland finds by entry point. This package works in the non-sequential
engine, and is found through `ray_tracing_shapely`'s own docs, not Optiland's.

## Install

Requires Python 3.11 or later, `ray_tracing_shapely` 0.3.0 or later and Optiland 0.6.3 or
later.

Not yet on PyPI. From a checkout:

```bash
pip install -e ".[dev]"
# or, for the inline-notebook viewer:
pip install -e ".[notebook]"
```

## Citing

If you use this software, please cite it, and the ray-tracing-shapely project whose designs
it verifies. `CITATION.cff` carries the metadata for both; GitHub formats it from the *Cite
this repository* link.

This project: [doi:10.5281/zenodo.24418339](https://doi.org/10.5281/zenodo.24418339). That is
the *concept* DOI, which always resolves to the latest release. Each release also has its own
DOI, to cite when a result must be pinned to the exact version it came from.

ray-tracing-shapely: [doi:10.5281/zenodo.23991020](https://doi.org/10.5281/zenodo.23991020).

## Licence

Apache-2.0. See `NOTICE.txt`.
