Commit 4040ab27 authored by Ryan Morelock's avatar Ryan Morelock
Browse files

Change view orientation for viewer.py

parent c7d3303e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -14,4 +14,15 @@ def view_structure(structure, color_map):
    view.addUnitCell()

    view.zoomTo()

    # now rotate so we look *down* a or b instead of the default c
    if look.lower() == 'a':
        # default view is along +z (the “c” axis).
        # To look along +x (the “a” axis), rotate –90° around the Y axis:
        view.rotate(-90, 'y')
    elif look.lower() == 'b':
        # to look along +y (the “b” axis), rotate +90° around the X axis:
        view.rotate(-90, 'x')
    # else 'c' or anything else: keep the default

    return view.show()