TkOptiX - Tkinter based GUI

Mouse and keys actions

You can manipulate camera, objects and lights from Tkinter GUI:

  • camera is selected by default, double-click an object/light to select it, double click again to select a primitive within the object, double-click empty area to or double-right-click select camera

With camera selected:

  • rotate eye around the target: hold and drag left mouse button

  • rotate target around the eye (pan/tilt): hold and drag right mouse button

  • zoom out/in (change field of view): hold shift + left mouse button and drag up/down

  • move eye backward/forward (dolly): hold shift + right mouse button and drag up/down

  • change focus distance in depth of field cameras: hold ctrl + left mouse button and drag up/down

  • change aperture radius in depth of field cameras: hold ctrl + right mouse button and drag up/down

  • focus at an object: hold ctrl + double-click left mouse button

  • select an object: double-click left mouse button

With a light or an object / primitive selected:

  • rotate around camera XY (right, up) coordinates: hold and drag left mouse button

  • rotate around camera XZ (right, forward) coordinates: hold ctrl and drag left mouse button

  • move in camera XY (right, up) coordinates: hold shift and drag left mouse button

  • move in camera XZ (right, forward) coordinates: hold and drag right mouse button

  • move in the normal direction (parallelogram light only): shift + right mouse button and drag up/down

  • scale up/down: hold ctrl + shift + left mouse button and drag up/down

  • select camera: double-click left mouse button in empty area or double-right-click anywhere

API reference

TkOptiX.get_rt_size() → Tuple[int, int][source]

Get size of ray-tracing output image.

Get fixed dimensions of the output image or None if the image is fit to the GUI window size.

Returns

out – Output image size or None if set auto-fit mode.

Return type

tuple (int, int)

TkOptiX.set_rt_size(size: Tuple[int, int]) → None[source]

Set fixed / free size of ray-tracing output image.

Set fixed dimensions of the output image or allow automatic fit to the GUI window size. Fixed size image updates are slower, but allow ray tracing of any size. Default mode is fit to the GUI window size.

Parameters

size (tuple (int, int)) – Output image size or None to set auto-fit mode.

TkOptiX.show() → None[source]

Start raytracing thread and open the GUI window.

Convenience method to call plotoptix.NpOptiX.start().

Actions provided with on_initialization parameter of TkOptiX constructor are executed by this method on the main thread, before the ratracing thread is started and GUI window open.

TkOptiX.close() → None[source]

Stop the raytracing thread, release resources.

Raytracing cannot be restarted after this method is called.