fresnel.interact#

Overview

SceneView

View a fresnel Scene in real time.

Details

Interactive Qt widgets.

class fresnel.interact.SceneView(scene, max_samples=2000)#

View a fresnel Scene in real time.

SceneView is a PySide2 widget that displays a Scene, rendering it with Path interactively. Use the mouse to rotate the camera view.

Parameters:
  • scene (Scene) – The scene to display.

  • max_samples (int) – Sample a total of max_samples.

  • Left click to pitch and yaw

  • Right click to roll and zoom

  • Middle click to pan

  • Hold ctrl to make small adjustments

Using in a standalone script

To use SceneView in a standalone script, import the fresnel.interact module, create a Scene, instantiate the SceneView, show it, and start the app event loop.

import fresnel, fresnel.interact
# build scene
view = fresnel.interact.SceneView(scene)
view.show()
fresnel.interact.app.exec_();

Using with Jupyter notebooks

To use SceneView in a Jupyter notebook, import PySide2.QtCore and activate Jupyter’s qt5 integration.

from PySide2 import QtCore
% gui qt

Import the fresnel.interact module, create a Scene, and instantiate the SceneView. Do not call the app event loop, Jupyter is already running the event loop in the background. When the SceneView object is the result of a cell, it will automatically show and activate focus.

import fresnel, fresnel.interact
# build Scene
fresnel.interact.SceneView(scene)

Note

The interactive window will open on the system that hosts Jupyter.

See also

Tutorials:

TIMEOUT = 100#

Timeout for delayed actions to take effect.

rendering#

alias of Camera

property scene#

The scene rendered in this view.

Type:

Scene