eradiate.scenes.surface.CentralPatchSurface#
- class eradiate.scenes.surface.CentralPatchSurface(id='surface', shape=None, bsdf=NOTHING, patch_edges=None, patch_bsdf=NOTHING)[source]#
Bases:
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
andbackground_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 thecentral_patch
surface, while thewidth
of thebackground_surface
must be set toAUTO
and the total width of the surface is set by thewidth
of the main surface object. Note that thewidth
of a surface defaults toAUTO
, which means, omitting the parameter in thebackground_surface
will yield the correct behaviour.If the
central_patch
width is set toAUTO
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"
) – Identifier of the current scene element.shape (
RectangleShape
ordict
, 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. anExperiment
instance owning the surface object); however, if it is still unset upon kernel dictionary generation, the call tokernel_dict()
will raise.bsdf (
BSDF
ordict
, 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
ordict
, optional, default:BlackBSDF()
) – The reflection model attached to the central patch.
- Fields:
- traverse(callback)[source]#
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()[source]#
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
] orNone
– A dictionary mapping parameter paths, consisting of dot-separated strings, to a corresponding update protocol.
See also
- 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 themitsuba.load_dict()
function, orInitParameter
instances which must be rendered.
See also