-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathexample4.py
More file actions
31 lines (23 loc) · 1020 Bytes
/
example4.py
File metadata and controls
31 lines (23 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import env # noqa: F401
TITLE = "Lenses"
DESCRIPTION = """Explore different types of lens-shaped solids."""
def exampleCode():
from pytissueoptics.scene import (
PlanoConcaveLens,
PlanoConvexLens,
RefractiveMaterial,
SymmetricLens,
ThickLens,
Vector,
get3DViewer,
)
material = RefractiveMaterial(refractiveIndex=1.44)
lens1 = ThickLens(30, 60, diameter=25.4, thickness=4, material=material, position=Vector(0, 0, 0))
lens3 = SymmetricLens(f=60, diameter=25.4, thickness=4, material=material, position=Vector(0, 0, 10))
lens2 = PlanoConvexLens(f=-60, diameter=25.4, thickness=4, material=material, position=Vector(0, 0, 20))
lens4 = PlanoConcaveLens(f=60, diameter=25.4, thickness=4, material=material, position=Vector(0, 0, 30))
viewer = get3DViewer()
viewer.add(lens1, lens2, lens3, lens4, representation="surface", colormap="viridis", showNormals=False)
viewer.show()
if __name__ == "__main__":
exampleCode()