|
14 | 14 | # You should have received a copy of the GNU General Public License |
15 | 15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. |
16 | 16 |
|
| 17 | +# ruff: noqa: F401 |
| 18 | + |
| 19 | +###### |
17 | 20 | # Core |
18 | | -from torchlensmaker.core.physics import * |
19 | | -from torchlensmaker.core.outline import * |
20 | | -from torchlensmaker.surfaces.sphere_r import * |
21 | | -from torchlensmaker.core.sag_functions import * |
22 | | -from torchlensmaker.core.transforms import * |
| 21 | +###### |
| 22 | + |
| 23 | +from torchlensmaker.core.physics import reflection, refraction |
| 24 | +from torchlensmaker.core.transforms import ( |
| 25 | + TransformBase, |
| 26 | + LinearTransform, |
| 27 | + ComposeTransform, |
| 28 | + TranslateTransform, |
| 29 | + IdentityTransform, |
| 30 | +) |
23 | 31 | from torchlensmaker.core.intersect import * |
24 | 32 | from torchlensmaker.core.full_forward import * |
25 | 33 | from torchlensmaker.core.collision_detection import * |
26 | 34 | from torchlensmaker.core.parameter import * |
27 | 35 | from torchlensmaker.core.geometry import * |
| 36 | +from torchlensmaker.core.sag_functions import ( |
| 37 | + Spherical, |
| 38 | + Parabolic, |
| 39 | + Aspheric, |
| 40 | + XYPolynomial, |
| 41 | + Conical, |
| 42 | + SagSum, |
| 43 | + SagFunction, |
| 44 | +) |
| 45 | +# from torchlensmaker.core.outline import * |
28 | 46 |
|
| 47 | +########## |
29 | 48 | # Surfaces |
30 | | -from torchlensmaker.surfaces.conics import * |
31 | | -from torchlensmaker.surfaces.sphere_r import * |
32 | | -from torchlensmaker.surfaces.implicit_surface import * |
33 | | -from torchlensmaker.surfaces.local_surface import * |
34 | | -from torchlensmaker.surfaces.plane import * |
35 | | -from torchlensmaker.surfaces.implicit_cylinder import * |
36 | | - |
37 | | -# Optics |
| 49 | +########## |
| 50 | + |
| 51 | +from torchlensmaker.surfaces.sphere_r import SphereR |
| 52 | +from torchlensmaker.surfaces.conics import Sphere, Parabola, Conic, Asphere |
| 53 | +from torchlensmaker.surfaces.implicit_surface import ImplicitSurface |
| 54 | +from torchlensmaker.surfaces.local_surface import LocalSurface |
| 55 | +from torchlensmaker.surfaces.plane import Plane, CircularPlane, SquarePlane |
| 56 | +from torchlensmaker.surfaces.implicit_cylinder import ImplicitCylinder |
| 57 | +from torchlensmaker.surfaces.sag_surface import SagSurface |
| 58 | + |
| 59 | +################## |
| 60 | +# Optical elements |
| 61 | +################## |
| 62 | + |
38 | 63 | from torchlensmaker.elements.sequential import Sequential |
39 | | -from torchlensmaker.elements.utils import * |
40 | | -from torchlensmaker.elements.kinematics import * |
41 | | -from torchlensmaker.elements.optical_surfaces import * |
42 | | -from torchlensmaker.elements.light_sources import * |
43 | | - |
44 | | -from torchlensmaker.optical_data import * |
45 | | -from torchlensmaker.lenses import * |
46 | | -from torchlensmaker.materials import * |
| 64 | +from torchlensmaker.elements.utils import MixedDim |
| 65 | +from torchlensmaker.elements.kinematics import ( |
| 66 | + SubChain, |
| 67 | + AbsoluteTransform, |
| 68 | + RelativeTransform, |
| 69 | + Gap, |
| 70 | + Rotate3D, |
| 71 | + Rotate2D, |
| 72 | + Translate2D, |
| 73 | + Translate3D, |
| 74 | + Rotate, |
| 75 | + Translate, |
| 76 | +) |
| 77 | +from torchlensmaker.elements.optical_surfaces import ( |
| 78 | + CollisionSurface, |
| 79 | + ReflectiveSurface, |
| 80 | + RefractiveSurface, |
| 81 | + Aperture, |
| 82 | + FocalPoint, |
| 83 | + ImagePlane, |
| 84 | + linear_magnification, |
| 85 | +) |
| 86 | +from torchlensmaker.elements.light_sources import ( |
| 87 | + LightSourceBase, |
| 88 | + RaySource, |
| 89 | + PointSourceAtInfinity, |
| 90 | + PointSource, |
| 91 | + ObjectAtInfinity, |
| 92 | + Object, |
| 93 | + Wavelength, |
| 94 | +) |
| 95 | + |
| 96 | +# Top level stuff - to be reorganized |
| 97 | +from torchlensmaker.optical_data import OpticalData, default_input |
| 98 | +from torchlensmaker.lenses import LensBase, BiLens, Lens, PlanoLens |
| 99 | +from torchlensmaker.materials import ( |
| 100 | + MaterialModel, |
| 101 | + NonDispersiveMaterial, |
| 102 | + CauchyMaterial, |
| 103 | + SellmeierMaterial, |
| 104 | +) |
| 105 | + |
| 106 | +########## |
| 107 | +# Sampling |
| 108 | +########## |
| 109 | + |
47 | 110 | from torchlensmaker.sampling import * |
48 | 111 |
|
| 112 | +############## |
49 | 113 | # Optimization |
50 | | -from torchlensmaker.optimize import * |
| 114 | +############## |
| 115 | + |
| 116 | +import torch.optim as optim |
| 117 | +from torchlensmaker.optimize import ( |
| 118 | + optimize, |
| 119 | + OptimizationRecord, |
| 120 | + plot_optimization_record, |
| 121 | +) |
51 | 122 |
|
| 123 | +######## |
52 | 124 | # Viewer |
| 125 | +######## |
| 126 | + |
53 | 127 | import torchlensmaker.viewer.tlmviewer as viewer |
54 | 128 | from torchlensmaker.viewer.render_sequence import * |
55 | 129 |
|
56 | | - |
| 130 | +########## |
57 | 131 | # Analysis |
| 132 | +########## |
| 133 | + |
58 | 134 | from torchlensmaker.analysis.plot_magnification import plot_magnification |
59 | 135 | from torchlensmaker.analysis.plot_material_model import plot_material_models |
60 | 136 | from torchlensmaker.analysis.spot_diagram import spot_diagram |
61 | 137 |
|
| 138 | +################## |
62 | 139 | # Export build123d |
| 140 | +################## |
| 141 | + |
63 | 142 | import torchlensmaker.export_build123d as export |
64 | 143 | from torchlensmaker.export_build123d import show_part |
0 commit comments