eradiate.scenes.illumination.SpotIllumination#

class eradiate.scenes.illumination.SpotIllumination(id='illumination', origin=_Nothing.NOTHING, target=_Nothing.NOTHING, up=_Nothing.NOTHING, beam_width=<Quantity(10.0, 'degree')>, intensity=1.0, beam_profile=None)[source]#

Bases: Illumination

Spot illumination scene element [spot].

Eradiate ships a beam texture that implements a gaussian beam profile with three standard deviations included in the total beam width. This texture is named gaussian_3sigma.bmp and can be used by retrieving the path to the file using eradiate.data.data_store.fetch().

Parameters:
  • id (str, optional, default: "illumination") – Identifier of the current scene element.

  • origin (array-like, default: [1, 1, 1] m) – A 3-vector specifying the position of the spot.

    Unit-enabled field (default: ucc[‘length’]).

  • target (array-like, default: [0, 0, 0] m) – Point location targeted by the spot.

    Unit-enabled field (default: ucc[‘length’]).

  • up (array-like, default: [0, 0, 1]) – A 3-vector specifying the up direction of the spot. This vector must be different from the spots’s pointing direction, which is given by target - origin.

  • beam_width (quantity or float, default: 10°) – Spot light beam width.

    Unit-enabled field (default: degree).

  • intensity (Spectrum or dict or float, default: 1.0 ucc[intensity]) – Emitted power in the plane orthogonal to the illumination direction. Must be an intensity spectrum (in W/sr/nm or compatible unit). Can be initialised with a dictionary processed by SpectrumFactory.convert().

  • beam_profile (path-like) – Path to the file describing the beam profile. Must be a valid bitmap image file.

Fields:
  • id (str or None) – Identifier of the current scene element.

  • origin (quantity) – A 3-vector specifying the position of the spot.

  • target (quantity) – Point location targeted by the spot.

  • up (array) – A 3-vector specifying the up direction of the spot.

  • beam_width (quantity) – Spot light beam width.

  • intensity (Spectrum) – Emitted power in the plane orthogonal to the illumination direction.

  • beam_profile (Path) – Path to the file describing the beam profile.

classmethod from_size_at_target(target, direction, spot_radius, beam_width, **kwargs)[source]#

Create a SpotIllumination which illuminates a region of a specified size around the target point.

The illuminated area is a circle defined by the spot radius around the target point in the plane orthogonal to the spot direction. The spot origin is inferred from the spot radius and a beam width value (in angle units): the spot origin will be positioned closer to the target point as the beam width increases and further from the target point as the beam width decreases.

Parameters:
  • target (array-like) – Target point for the spot. Unitless values are converted to ucc['length'].

  • direction (array-like) – Pointing direction for the spot, towards target.

  • spot_radius (float or quantity) – Radius of the desired spot at the target position. Unitless values are converted to ucc['length'].

  • beam_width (float or quantity) – Divergence angle of the spot. Unitless values are converted to ucc['angle'].

  • **kwargs – Remaining keyword arguments are forwarded to the SpotIllumination constructor.

Returns:

SpotIllumination

traverse(callback)#

Traverse this scene element and collect kernel dictionary template and parameter update map contributions.

Parameters:

callback (SceneTraversal) – Callback data structure storing the collected data.

update()#

Enforce internal state consistency. This method should be called when fields are modified. It is automatically called as a post-init step.

property objects#

Map of child objects associated with this scene element.

Returns:

dict – A dictionary mapping object names to a corresponding object to be inserted in the Eradiate scene graph.

property params#
Returns:

dict[str, UpdateParameter] or None – A dictionary mapping parameter paths, consisting of dot-separated strings, to a corresponding update protocol.

property template#

Kernel dictionary template contents associated with this scene element.

Returns:

dict – A flat dictionary mapping dot-separated strings describing the path of an item in the nested scene dictionary to values. Values may be objects which can be directly used by the mitsuba.load_dict() function, or InitParameter instances which must be rendered.