Skip to content

Commit

Permalink
Updates to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanDS committed Nov 22, 2014
1 parent dd53720 commit 02cedbd
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 23 deletions.
10 changes: 7 additions & 3 deletions ex1.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Demonstration of angles of incidence.
"""

import Optivis

bench = Optivis.Bench()
Expand All @@ -12,8 +16,8 @@
bench.addComponent(m2)
bench.addComponent(m3)

bench.addLink(Optivis.BenchObjects.Link(l1.outputNodes[0], m1.inputNodes[0], 100))
bench.addLink(Optivis.BenchObjects.Link(m1.outputNodes[0], m2.inputNodes[0], 100))
bench.addLink(Optivis.BenchObjects.Link(m2.outputNodes[0], m3.inputNodes[0], 150))
bench.addLink(Optivis.BenchObjects.Link(l1.getOutputNode('out'), m1.getInputNode('fr'), 100))
bench.addLink(Optivis.BenchObjects.Link(m1.getOutputNode('fr'), m2.getInputNode('fr'), 100))
bench.addLink(Optivis.BenchObjects.Link(m2.getOutputNode('fr'), m3.getInputNode('fr'), 150))

bench.draw()
14 changes: 9 additions & 5 deletions ex2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Demonstration of beam splitter's inputs and outputs.
"""

import Optivis

bench = Optivis.Bench(azimuth=180)
Expand All @@ -14,10 +18,10 @@
bench.addComponent(m2)
bench.addComponent(m3)

bench.addLink(Optivis.BenchObjects.Link(l1.outputNodes[0], bs1.inputNodes[0], 100))
bench.addLink(Optivis.BenchObjects.Link(bs1.outputNodes[2], m1.inputNodes[0], 50))
bench.addLink(Optivis.BenchObjects.Link(m1.outputNodes[0], m2.inputNodes[0], 50))
bench.addLink(Optivis.BenchObjects.Link(m2.outputNodes[0], m3.inputNodes[0], 61.5))
bench.addLink(Optivis.BenchObjects.Link(m3.outputNodes[0], bs1.inputNodes[2], 38.5))
bench.addLink(Optivis.BenchObjects.Link(l1.getOutputNode('out'), bs1.getInputNode('frA'), 100))
bench.addLink(Optivis.BenchObjects.Link(bs1.getOutputNode('bkA'), m1.getInputNode('fr'), 50))
bench.addLink(Optivis.BenchObjects.Link(m1.getOutputNode('fr'), m2.getInputNode('fr'), 50))
bench.addLink(Optivis.BenchObjects.Link(m2.getOutputNode('fr'), m3.getInputNode('fr'), 58))
bench.addLink(Optivis.BenchObjects.Link(m3.getOutputNode('fr'), bs1.getInputNode('frA'), 42.5))

bench.draw()
30 changes: 15 additions & 15 deletions ex3.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
"""
Beam splitter test
Demonstration of funky angles of incidence.
"""

import Optivis

bench = Optivis.Bench(azimuth=180)
bench = Optivis.Bench(azimuth=180, startMarker=False, endMarker=False)

l1 = Optivis.BenchObjects.Laser(name="L1")
bs1 = Optivis.BenchObjects.BeamSplitter(name="BS", aoi=-45)
m1 = Optivis.BenchObjects.CavityMirror(name="M1")
bs1 = Optivis.BenchObjects.BeamSplitter(name="BS", aoi=-22.5)
m2 = Optivis.BenchObjects.CavityMirror(name="M2")
m3 = Optivis.BenchObjects.CavityMirror(name="M3")
m4 = Optivis.BenchObjects.CavityMirror(name="M4")
m3 = Optivis.BenchObjects.CavityMirror(name="M3", aoi=33.75)
m4 = Optivis.BenchObjects.CavityMirror(name="M4", aoi=-33.75)

bench.addComponent(l1)
bench.addComponent(bs1)
bench.addComponent(m1)
#bench.addComponent(m2)
#bench.addComponent(m3)
#bench.addComponent(m4)
bench.addComponent(m2)
bench.addComponent(m3)
bench.addComponent(m4)

bench.addLink(Optivis.BenchObjects.Link(l1.getOutputNode('out'), bs1.getInputNode('frA'), 100))
bench.addLink(Optivis.BenchObjects.Link(bs1.getOutputNode('bkB'), m1.getInputNode('fr'), 25))
bench.addLink(Optivis.BenchObjects.Link(m1.getOutputNode('fr'), bs1.getInputNode('bkA'), 25, colour="blue"))
#bench.addLink(Optivis.BenchObjects.Link(bs1.getOutputNode('frB'), m2.getInputNode('fr'), 50))
#bench.addLink(Optivis.BenchObjects.Link(bs1.getOutputNode('bkA'), m3.getInputNode('fr'), 75))
#bench.addLink(Optivis.BenchObjects.Link(bs1.getOutputNode('bkB'), m4.getInputNode('fr'), 100))
bench.addLink(Optivis.BenchObjects.Link(l1.getOutputNode('out'), m1.getInputNode('bk'), 50))
bench.addLink(Optivis.BenchObjects.Link(m1.getOutputNode('fr'), bs1.getInputNode('frA'), 50))
bench.addLink(Optivis.BenchObjects.Link(bs1.getOutputNode('frA'), m2.getInputNode('fr'), 50))
bench.addLink(Optivis.BenchObjects.Link(bs1.getOutputNode('bkA'), m3.getInputNode('fr'), 50))
bench.addLink(Optivis.BenchObjects.Link(bs1.getOutputNode('bkB'), m4.getInputNode('fr'), 50))
bench.addLink(Optivis.BenchObjects.Link(m3.getOutputNode('fr'), m4.getInputNode('fr'), 38.27))

bench.draw()
bench.draw()

0 comments on commit 02cedbd

Please sign in to comment.