eradiate.scenes.shapes.CuboidShape¶
- class eradiate.scenes.shapes.CuboidShape(id='shape', bsdf=None, to_world=None, center=NOTHING, edges=NOTHING)[source]¶
Bases:
ShapeNodeCuboid shape [
cuboid].This shape represents an axis-aligned cuboid parametrized by the length of its edges and the coordinates of its central point.
- Parameters:
id (
str, optional, default:"shape") – Identifier of the current scene element.bsdf (
BSDForRefordict, optional) – BSDF attached to the shape. If a dictionary is passed, it is interpreted bybsdf_factory.convert(). If unset, no BSDF will be specified during the kernel dictionary generation: the kernel’s default will be used. If aBSDFinstance (or a corresponding dictionary specification) is passed, its id member is automatically overridden.to_world (
mitsuba.ScalarTransform4for array-like, optional) – Transform to scale, shift and rotate the shape.center (
quantityor array-like, optional, default:[0,0,0]) – Coordinates of the centre of the cube. Unit-enabled field (default:ucc['length']).edges (
quantityor array-like, default:[1,1,1]) – Lengths of the edges of the cuboid. Unit-enabled field (default:ucc['length]).
- Fields:
Notes
If the to_world parameter is set, the center and edges parameters will be ignored. The transform will be applied to a cube reaching from [-1, -1, -1] to [1, 1, 1].
- classmethod atmosphere(top=<Quantity(100.0, 'kilometer')>, bottom=<Quantity(0.0, 'kilometer')>, bottom_offset=None, width=<Quantity(100.0, 'kilometer')>, bsdf=None)[source]¶
This class method constructor provides a simplified parametrization of the cuboid shape better suited for the definition of the atmosphere when configuring the one-dimensional model with a plane parallel geometry.
- Parameters:
top (
quantity, optional, default:100 km) – Top of atmosphere altitude. If a unitless value is passed, it is interpreted as ucc[‘length’].bottom (
quantity, optional, default:0 km) – Ground altitude. If a unitless value is passed, it is interpreted asucc['length'].bottom_offset (
quantity, optional) – Additional offset by which the cuboid with be extended to avoid an exact match of its bottom face and the shape representing the surface. If left unset, defaults to a negative offset of 1 % of the atmosphere’s height, i.e. \(- 0.01 \times (\mathtt{top} - \mathtt{bottom})\). If a unitless value is passed, it is interpreted asucc['length'].width (
quantity, optional, default:100 km) – Length of the horizontal edges of the cuboid. If a unitless value is passed, it is interpreted asucc['length'].bsdf (
BSDFordict, optional, default:None) – A BSDF specification, forwarded to the main constructor.
- Returns:
CuboidShape– A cuboid shape which can be used as the atmosphere in a plane parallel geometry.
- contains(p, strict=False)[source]¶
Test whether a point lies within the cuboid.
- Parameters:
p (
quantityor array-like) – An array of shape (3,) (resp. (N, 3)) representing one (resp. N) points. If a unitless value is passed, it is interpreted asucc['length'].strict (
bool) – IfTrue, comparison is done using strict inequalities (<, >).
- Returns:
result (array of
boolorbool) –Trueiffpin within the cuboid.
- 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 bbox¶
Shape bounding box. Default implementation raises a
NotImplementedError.- Type:
- 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,SceneParameter] 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, orDictParameterinstances which must be rendered.
See also