eradiate.scenes.shapes.RectangleShape#

class eradiate.scenes.shapes.RectangleShape(id='shape', bsdf=None, edges=_Nothing.NOTHING, center=_Nothing.NOTHING, normal=_Nothing.NOTHING, up=_Nothing.NOTHING)[source]#

Bases: eradiate.scenes.shapes._core.Shape

Rectangle shape [rectangle].

This shape represents a rectangle parametrised by the length of its edges, the coordinates of its central point, a normal vector and an orientation vector.

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

  • bsdf (BSDF or dict, optional) – BSDF attached to the shape. If a dictionary is passed, it is interpreted by bsdf_factory.convert(). If unset, no BSDF will be specified during the kernel dictionary generation: the kernel’s default will be used.

  • edges (quantity or array-like, optional, default: [1, 1]) – Length of the rectangle’s edges. Unit-enabled field (default: ucc["length"]).

  • center (quantity or array-like, optional, default: [0, 0, 0]) – Cartesian coordinates of the rectangle’s central point. Unit-enabled field (default: ucc["length"]).

  • normal (array-like, optional, default: [0, 0, 1]) – Normal vector of the plane containing the rectangle. Defaults to the +Z direction.

  • up (array-like, optional, default: [0, 1, 0]) – Orientation vector defining the rotation of the rectangle around the normal vector. Defaults to the +Y direction.

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

  • bsdf (BSDF or None) – BSDF attached to the shape.

  • edges (quantity) – Length of the rectangle’s edges.

  • center (quantity) – Cartesian coordinates of the rectangle’s central point.

  • normal (array) – Normal vector of the plane containing the rectangle.

  • up (array) – Orientation vector defining the rotation of the rectangle around the normal vector.

kernel_dict(ctx)[source]#

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.

classmethod surface(altitude=<Quantity(0.0, 'kilometer')>, width=<Quantity(1.0, 'kilometer')>, bsdf=None)[source]#

This class method constructor provides a simplified parametrisation of the rectangle shape better suited for the definition of the surface when configuring the one-dimensional model.

The resulting rectangle shape is a square with edge length equal to width, centred at [0, 0, altitude], with normal vector +Z.

Parameters
  • altitude (quantity or array-like, optional, default: 0 km) – Surface altitude. If a unitless value is passed, it is interpreted as ucc["length"].

  • width (quantity or float, optional, default: 1 km) – Edge length. If a unitless value is passed, it is interpreted as ucc["length"].

  • bsdf (BSDF or dict, optional, default: None) – A BSDF specification, forwarded to the main constructor.

Returns

RectangleShape – A rectangle shape which can be used as the surface in a plane parallel geometry.