Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle circularly linked components gracefully #15

Open
SeanDS opened this issue Feb 16, 2015 · 0 comments
Open

Handle circularly linked components gracefully #15

SeanDS opened this issue Feb 16, 2015 · 0 comments
Assignees
Labels

Comments

@SeanDS
Copy link
Owner

SeanDS commented Feb 16, 2015

Components linked together by two or more different paths cause problems for the layout engine. For example, a beam splitter linked to itself via three 45 degree mirrors.

Currently, Optivis just draws a straight line between the relevant nodes if it encounters this problem. This is usually not what the user wants. Right now, it is left to the user to tune their link lengths and component angles of incidence so that Optivis' straight line still works, e.g.

scene

However, if a component that is doubly-linked is also itself linked to other components, then you get nasty layout problems:

scene

Since the second beam splitter (the one that appears to be at the wrong angle) is linked to the top right mirror before it is linked to the main beam splitter (the one attached to the laser), it is clamped into position. When Optivis tries to link the second beam splitter to the first, it discovers that both components are already constrained, so it draws a straight line and warns the user.

In this instance it might be better to ignore the user-defined angle of incidence on the second beam splitter, and instead set it to a value which would properly obey the law of reflection. This would then involve propagating the rotation of the second beam splitter back to M5.

It gets even more complicated if M5 is already linked to, for example, the top right mirror. Then Optivis would possibly have to also ignore the angle of incidence on M5.

Food for thought.

Code:

import optivis.scene as scene
import optivis.bench.links as links
import optivis.bench.components as components
import optivis.view.canvas as canvas

scene = scene.Scene(title="Double Links")

l1 = components.Laser(name="L1")
bs1 = components.BeamSplitter(name="BS1", aoi=22.5)
m2 = components.CavityMirror(name="M2", aoi=-23)
bs2 = components.BeamSplitter(name="BS2", aoi=10)
m4 = components.CavityMirror(name="M4")
m5 = components.SteeringMirror(name="M5")

scene.reference = l1

scene.link(bs2.getOutputNode('bkA'), m5.getInputNode('fr'), 100)
scene.link(l1.getOutputNode('out'), bs1.getInputNode('bkA'), 50)
scene.link(bs1.getOutputNode('frB'), m2.getInputNode('fr'), 50)
scene.link(bs1.getOutputNode('frA'), bs2.getInputNode('frA'), 50)
scene.link(bs1.getOutputNode('bkA'), m4.getInputNode('fr'), 50)
scene.link(m2.getOutputNode('fr'), bs2.getInputNode('frB'), 35)

gui = canvas.Simple(scene=scene)
gui.show()
@SeanDS SeanDS added the bug label Feb 16, 2015
@SeanDS SeanDS self-assigned this Feb 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant