eradiate.scenes.surface.CentralPatchSurface#

class eradiate.scenes.surface.CentralPatchSurface(id='surface', shape=None, bsdf=NOTHING, patch_edges=None, patch_bsdf=NOTHING)[source]#

Bases: eradiate.scenes.surface._core.Surface

Central patch surface [central_patch].

This surface consists of a rectangular patch, described by its field parameter, with a composite reflection model composed of a background uniform component, and a central patch.

This class creates a square surface to which two BSDFs will be attached.

The two constituent surfaces central_patch and background_surface define the properties of the two sections of this surface.

The size of the central surface is controlled by setting the width parameter of the central_patch surface, while the width of the background_surface must be set to AUTO and the total width of the surface is set by the width of the main surface object. Note that the width of a surface defaults to AUTO, which means, omitting the parameter in the background_surface will yield the correct behaviour.

If the central_patch width is set to AUTO as well it defaults to one third of the overall surface size, unless a contextual constraint (e.g. to match the size of an atmosphere or canopy) is applied.

Parameters
  • id (str, optional, default: "surface") – User-defined object identifier.

  • shape (RectangleShape or dict, optional, default: None) – Shape describing the surface. This parameter may be left unset for situations in which setting its value is delegated to another component (e.g. an Experiment instance owning the surface object); however, if it is still unset upon kernel dictionary generation, the call to kernel_dict() will raise.

  • bsdf (BSDF or dict, optional, default: LambertianBSDF()) – The reflection model attached to the surface.

  • patch_edges (quantity or array-like, optional) – Length of the central patch’s edges. If unset, the central patch edges will be 1/3 of the surface’s edges. Unit-enabled field (default: ucc["length"]).

  • patch_bsdf (BSDF or dict, optional, default: BlackBSDF()) – The reflection model attached to the central patch.

Fields
  • id (str or None) – User-defined object identifier.

  • shape (RectangleShape or None) – Shape describing the surface.

  • bsdf (BSDF) – The reflection model attached to the surface.

  • patch_edges (quantity or None) – Length of the central patch’s edges.

  • patch_bsdf (BSDF) – The reflection model attached to the central patch.

kernel_bsdfs(ctx)[source]#

Return BSDF plugin specifications.

Parameters

ctx (KernelDictContext) – A context data structure containing parameters relevant for kernel dictionary generation.

Returns

KernelDict – A kernel dictionary containing all the BSDFs attached to the surface.

kernel_dict(ctx)#

Return a dictionary suitable for kernel scene configuration.

Parameters

ctx (KernelDictContext) – A context data structure containing parameters relevant for kernel dictionary generation.

Returns

KernelDict – Kernel dictionary which can be loaded as a Mitsuba object.

kernel_shapes(ctx)[source]#

Return shape plugin specifications.

Parameters

ctx (KernelDictContext) – A context data structure containing parameters relevant for kernel dictionary generation.

Returns

KernelDict – A kernel dictionary containing all the shapes attached to the surface.