diffinytrace 2.1__py3-none-any.whl → 2.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diffinytrace-2.2.dist-info/METADATA +125 -0
- {diffinytrace-2.1.dist-info → diffinytrace-2.2.dist-info}/RECORD +5 -5
- diffinytrace-2.1.dist-info/METADATA +0 -26
- {diffinytrace-2.1.dist-info → diffinytrace-2.2.dist-info}/WHEEL +0 -0
- {diffinytrace-2.1.dist-info → diffinytrace-2.2.dist-info}/licenses/LICENSE +0 -0
- {diffinytrace-2.1.dist-info → diffinytrace-2.2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: diffinytrace
|
|
3
|
+
Version: 2.2
|
|
4
|
+
Author: Martin Pflaum
|
|
5
|
+
Author-email: contact@martinpflaum.com
|
|
6
|
+
Requires-Python: ==3.12
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: colour-science==0.4.7
|
|
10
|
+
Requires-Dist: matplotlib==3.10.8
|
|
11
|
+
Requires-Dist: numpy==2.3.5
|
|
12
|
+
Requires-Dist: pandas==3.0.1
|
|
13
|
+
Requires-Dist: Pillow==12.0.0
|
|
14
|
+
Requires-Dist: plotly==6.6.0
|
|
15
|
+
Requires-Dist: pvlib==0.15.0
|
|
16
|
+
Requires-Dist: scikit_learn==1.8.0
|
|
17
|
+
Requires-Dist: scipy==1.17.1
|
|
18
|
+
Requires-Dist: tqdm==4.67.3
|
|
19
|
+
Requires-Dist: nbformat==5.1.3
|
|
20
|
+
Requires-Dist: ipykernel==7.2.0
|
|
21
|
+
Requires-Dist: cadquery==2.7.0
|
|
22
|
+
Requires-Dist: torchmetrics==1.9.0
|
|
23
|
+
Dynamic: author
|
|
24
|
+
Dynamic: author-email
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: description-content-type
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
Dynamic: requires-dist
|
|
29
|
+
Dynamic: requires-python
|
|
30
|
+
|
|
31
|
+
# DiffinyTrace
|
|
32
|
+
|
|
33
|
+
**DiffinyTrace** is a Python library for differentiable ray tracing and optical system optimization using PyTorch. It enables automatic differentiation through optical systems, making it possible to optimize lens designs, mirror configurations, and other optical components using gradient-based methods.
|
|
34
|
+
|
|
35
|
+
The source code is available at the [GitHub repository](https://github.com/martinpflaum/diffinytrace).
|
|
36
|
+
|
|
37
|
+
## Key Features
|
|
38
|
+
|
|
39
|
+
<div align="center">
|
|
40
|
+
<img src="docs/_static/system_3D_plot.png" width="60%" alt="Transformation example">
|
|
41
|
+
<p><strong>Flexible Transformations</strong> — apply general transformations such as rotations and translations to optical components, with full control over the parameters and their role in the transformation.</p>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div align="center">
|
|
45
|
+
<img src="docs/_static/cad_export.png" width="40%" alt="CAD export example">
|
|
46
|
+
<p><strong>Seamless CAD Export</strong> — generate lenses and mirrors that can be exported to standard CAD file formats.</p>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div align="center">
|
|
50
|
+
<img src="docs/_static/bspline_plot1.png" width="80%" alt="B-spline surface example">
|
|
51
|
+
<p><strong>Freeform Surfaces</strong> — design complex optical elements with advanced B-spline representations for maximum flexibility.</p>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
* **Differentiable Ray Tracing**: Full automatic differentiation support through optical systems
|
|
55
|
+
* **Constraint Optimization**: Advanced optimization with PyTorch and SciPy integration
|
|
56
|
+
* **Illumination Design**: Algorithms for computing lens surfaces to achieve desired illumination profiles
|
|
57
|
+
* **GPU Acceleration**: CUDA support for high-performance computations
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
1. **Create a new Enviroment** via conda:
|
|
62
|
+
```bash
|
|
63
|
+
conda create -n dit python==3.12
|
|
64
|
+
```
|
|
65
|
+
activate enviroment via
|
|
66
|
+
```bash
|
|
67
|
+
conda activate dit
|
|
68
|
+
```
|
|
69
|
+
install pip
|
|
70
|
+
```bash
|
|
71
|
+
conda install pip
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
2. **Install PyTorch**
|
|
76
|
+
|
|
77
|
+
Check your cuda version with
|
|
78
|
+
```bash
|
|
79
|
+
nvcc --version
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Diffinytrace only has been tested with 2.10.0+cu130. Make sure to install the appropriate version of PyTorch for your system. You can find the installation instructions on the [PyTorch website](https://pytorch.org/get-started/locally/). DiffinyTrace should work for both cpu and cuda versions.
|
|
83
|
+
|
|
84
|
+
3. **Install DiffinyTrace**
|
|
85
|
+
Install all other dependencies and the library itself via:
|
|
86
|
+
```bash
|
|
87
|
+
pip install diffinytrace
|
|
88
|
+
```
|
|
89
|
+
or directly in the folder via
|
|
90
|
+
```bash
|
|
91
|
+
pip install -r requirements.txt
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## Basic Usage Example
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
import diffinytrace as dit
|
|
99
|
+
import torch
|
|
100
|
+
NBK7 = dit.materials["NBK7"]
|
|
101
|
+
|
|
102
|
+
wave_len = 1.024
|
|
103
|
+
light_transform = dit.transforms.Offset(torch.tensor([0.0,0.0,0.0]))
|
|
104
|
+
source = dit.source.CollimatedMonochromatic(light_transform,8.0,wave_len)
|
|
105
|
+
|
|
106
|
+
plane_surface = dit.Plane()
|
|
107
|
+
surface2 = dit.Aspheric(-1/50.)
|
|
108
|
+
transf1 = dit.transforms.Distance(10.0,parent_transform=source)
|
|
109
|
+
lens1 = dit.Lens(transf1,5.,plane_surface,surface2,NBK7,13.0)
|
|
110
|
+
transf2 = dit.transforms.Distance(15.0,parent_transform=lens1)
|
|
111
|
+
detector = dit.Detector(transf2,plane_surface,8.0)
|
|
112
|
+
system = dit.SequentialOpticalSystem({"source":source, "lens":lens1, "detector":detector})
|
|
113
|
+
|
|
114
|
+
x,weights = source.sample(10)
|
|
115
|
+
O,D,wave_len,_,meta_data = system(x,["source","lens","detector"])
|
|
116
|
+
dit.plotting.system2D.plot(system,meta_data)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Documentation
|
|
120
|
+
|
|
121
|
+
For comprehensive documentation, tutorials, and API reference, visit the [full documentation](https://diffinytrace.readthedocs.io/en/latest/index.html).
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
DiffinyTrace is licensed under the MIT License. See the repository for full license details.
|
|
@@ -31,8 +31,8 @@ diffinytrace/plotting/wavelength.py,sha256=ZmZMw1ay2wc7NyAo4Z_9jNVIuwaGmfHw2jCHh
|
|
|
31
31
|
diffinytrace/utils/__init__.py,sha256=BevGtOt6JSKgBExvpqaKLIk39ebFdzFqAJgL_DBUXxo,211
|
|
32
32
|
diffinytrace/utils/autograd.py,sha256=VDnbXJfe-uIY5Mbc_bIljZFWcKIZfk6jXamT-8CZKWM,4435
|
|
33
33
|
diffinytrace/utils/irradiance_importer.py,sha256=FvaTK0uRi2KnEZc6CcD0Tdh03I8Wum7XjdbMGeIZQlQ,5000
|
|
34
|
-
diffinytrace-2.
|
|
35
|
-
diffinytrace-2.
|
|
36
|
-
diffinytrace-2.
|
|
37
|
-
diffinytrace-2.
|
|
38
|
-
diffinytrace-2.
|
|
34
|
+
diffinytrace-2.2.dist-info/licenses/LICENSE,sha256=zcS2z4c_EPqi2EDV5ZpOv4FC4flqC7kYw4qOKtWHKjY,1091
|
|
35
|
+
diffinytrace-2.2.dist-info/METADATA,sha256=3Pci_t_US6VLknJ_id4_9IYy0F2FGLkz5fXfN_VZnno,4501
|
|
36
|
+
diffinytrace-2.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
37
|
+
diffinytrace-2.2.dist-info/top_level.txt,sha256=fK-f6Fho578N7Hz-tgLor5IEiUVOqrmLI07lp6s-iyg,13
|
|
38
|
+
diffinytrace-2.2.dist-info/RECORD,,
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: diffinytrace
|
|
3
|
-
Version: 2.1
|
|
4
|
-
Author: Martin Pflaum
|
|
5
|
-
Author-email: contact@martinpflaum.com
|
|
6
|
-
Requires-Python: ==3.12
|
|
7
|
-
License-File: LICENSE
|
|
8
|
-
Requires-Dist: colour-science==0.4.7
|
|
9
|
-
Requires-Dist: matplotlib==3.10.8
|
|
10
|
-
Requires-Dist: numpy==2.3.5
|
|
11
|
-
Requires-Dist: pandas==3.0.1
|
|
12
|
-
Requires-Dist: Pillow==12.0.0
|
|
13
|
-
Requires-Dist: plotly==6.6.0
|
|
14
|
-
Requires-Dist: pvlib==0.15.0
|
|
15
|
-
Requires-Dist: scikit_learn==1.8.0
|
|
16
|
-
Requires-Dist: scipy==1.17.1
|
|
17
|
-
Requires-Dist: tqdm==4.67.3
|
|
18
|
-
Requires-Dist: nbformat==5.1.3
|
|
19
|
-
Requires-Dist: ipykernel==7.2.0
|
|
20
|
-
Requires-Dist: cadquery==2.7.0
|
|
21
|
-
Requires-Dist: torchmetrics==1.9.0
|
|
22
|
-
Dynamic: author
|
|
23
|
-
Dynamic: author-email
|
|
24
|
-
Dynamic: license-file
|
|
25
|
-
Dynamic: requires-dist
|
|
26
|
-
Dynamic: requires-python
|
|
File without changes
|
|
File without changes
|
|
File without changes
|