pyOpTools
pyOpTools is an open-source Python and Cython library for simulating optical systems using 3D non-sequential ray tracing, component modeling, and wavefront calculations.
Originally developed by the technological development team at Combustión Ingenieros S.A.S. and Colombian Imaging Technologies S.A.S..
Features
- 3D Ray Tracing: Fast 3D non-sequential ray tracing with Eigen-accelerated coordinate transformations and intersection solvers.
- Optical Component Library: Spherical lenses, aspheric lenses, prisms, mirrors, apertures, stops, detectors, and compound optical systems.
- Vendor Catalogs: Built-in access to commercial optics catalogs (Thorlabs, Edmund Optics).
- Wavefront Propagation & Diffraction: Rayleigh-Sommerfeld, Angular Spectrum, and Fractional Fourier Transform methods.
- Interactive Visualization: 3D interactive system visualization in JupyterLab and Marimo using Plotly and WebGL.
Installation
pyOpTools requires Python 3.10+.
Using uv (Recommended)
# Add to an existing uv project:
uv add pyoptools
# Or install in your virtual environment:
uv pip install pyoptools
Using pip
pip install pyoptools
Quickstart
Here is a simple example showing how to build an optical system with a spherical lens and trace a ray:
from pyoptools.raytrace.comp_lib import SphericalLens
from pyoptools.raytrace.ray import Ray
from pyoptools.raytrace.system import System
# 1. Define optical components
lens = SphericalLens(
radius=25.0,
thickness=5.0,
curvature_s1=1.0 / 100.0,
curvature_s2=-1.0 / 100.0,
material=1.5168,
)
# 2. Assemble the optical system
system = System(complist=[(lens, (0, 0, 50), (0, 0, 0))], n=1.0)
# 3. Define an incident ray and propagate
ray = Ray(origin=(0, 10, 0), direction=(0, 0, 1), wavelength=0.589)
system.ray_add(ray)
system.propagate()
# 4. Inspect traced ray and component hits
final_rays = ray.get_final_rays()
print("Final ray direction:", final_rays[0].direction)
print("Impacts on lens:", len(lens.hit_list))
Documentation
Comprehensive documentation, tutorials, and API reference are available at: https://pyoptools.readthedocs.io/
Contributing & Development
We welcome contributions! Please see:
- CONTRIBUTING.md for developer setup, testing, and pull request guidelines.
- AGENTS.md for automated agent and internal architectural guidelines.
To set up a local development environment:
git clone https://github.com/cihologramas/pyoptools.git
cd pyoptools
uv sync
uv run python setup.py build_ext --inplace
uv run pytest
Release files for pyoptools 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 234.6 MB
Release files / pyoptools-0.4.0-cp313-cp313-win_amd64.whl
| Download URL | pyoptools-0.4.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 14.7 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
969e25fe825055925782d58281dc6715b84ef0f43418b752390eb2bedaccb3dd
|
|
BLAKE2b-256 checksum How to use checksums |
af733cbf7b95d333142d5823578b5e9d873d6a31bde53f2328be19524ab2ea6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyoptools-0.4.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pyoptools-0.4.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 29.6 MB |
| Tags | CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
1522ea7659251c5f3fdf4d893312cb0d77ad028ac57dd0206325f5f96e68663f
|
|
BLAKE2b-256 checksum How to use checksums |
3e934de9c4dfc5c95f3e2ca4d52327808f5ba0d362f9369bb582c0a88a01fed8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyoptools-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pyoptools-0.4.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 14.8 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
747c7e7382799fe96d8abce07d7ab9670815196dbb033b18e2ae33f8247cfc63
|
|
BLAKE2b-256 checksum How to use checksums |
fda5fcea5eb945b51e1813ecb5d75b09925bc8023b7a6336bdaa9daeb1575b79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyoptools-0.4.0-cp312-cp312-win_amd64.whl
| Download URL | pyoptools-0.4.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 14.7 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b5fd49df383d33fabbe49e5004ae650630ed6d4bb58c425b6da3392c4c5dd59e
|
|
BLAKE2b-256 checksum How to use checksums |
bf4eeea8747fbc0b312b28912d6956c988658bcea739deca0990a5a3902d4c69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyoptools-0.4.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pyoptools-0.4.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 29.8 MB |
| Tags | CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
3c444d9a8798278db341ec87ba9b4d0bf047db65ee1518b42fe1b9c66982a897
|
|
BLAKE2b-256 checksum How to use checksums |
c2962cae553d08bfddc07065e3316dd1fb391fc67fa5bff46fde9c824affcfbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyoptools-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyoptools-0.4.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 14.8 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d39abf3dc811c35ee7662888ee21a223db0c6e15a1528a2291ac2c2c1cb6e52a
|
|
BLAKE2b-256 checksum How to use checksums |
752437b5af648e8ee7ec549d413b9bb5a8ff93e818dea356c47b109fc7ec8e84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyoptools-0.4.0-cp311-cp311-win_amd64.whl
| Download URL | pyoptools-0.4.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 14.7 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
984e93effe417c1ba87cd04eabb50b49869694a24b170764306e36c6938d2288
|
|
BLAKE2b-256 checksum How to use checksums |
8dfe80b32ba893ba63b8ff1ef281832f648eb150b8474b30cd2efa8e54521441
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyoptools-0.4.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pyoptools-0.4.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 29.6 MB |
| Tags | CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
83447b483cb0d9c1f0e63a074a69904a30665f9f399504e9f3ba750b5bd08488
|
|
BLAKE2b-256 checksum How to use checksums |
f7c58f9ddf7194863b94a14877032e8d81843c568afd04ff4bfd117578d69166
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyoptools-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyoptools-0.4.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 14.8 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
bf955d3d1979c25f5e6eaf7e8759ef3eefa3a500806e072cc9cdeeaf4c874ec7
|
|
BLAKE2b-256 checksum How to use checksums |
3d368fb1ad9ba4188d189a4a628bdba828a8f73d1bb32c1fa0cca1c21beb4e21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyoptools-0.4.0-cp310-cp310-win_amd64.whl
| Download URL | pyoptools-0.4.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 14.4 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
83911a5d395a8c3dbf4bb0c4fac1ce8497a5a71b1d0d7d49ec33c966724e627c
|
|
BLAKE2b-256 checksum How to use checksums |
fb449eb55ec8d26a460019c1d35aabef94c71041bb51390e80746a66304780ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyoptools-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyoptools-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 27.8 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
03e68c986b53309a0a13e0bf37060a618c7c0d668f59bd5d9bece95ecf5f4502
|
|
BLAKE2b-256 checksum How to use checksums |
aa529a7c0c154297a64236360e82bf2b94177117064b92a612a459a8b370e487
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyoptools-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyoptools-0.4.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 14.8 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
79fcd23aeebe97771113b3fad27cd4e96279ddda9a7a161390db3839acd61ee0
|
|
BLAKE2b-256 checksum How to use checksums |
46ad1b0d88c9e9daf4eae2756e6708b163e5eb6ed9aa1a1f34c8e562a4474305
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|