eradiate.scenes.measure.TargetRectangle¶
- class eradiate.scenes.measure.TargetRectangle(**kwargs)[source]¶
Bases:
TargetRectangle target specification.
This class defines a rectangular zone where ray targets will be sampled or ray origins will be projected. It supports several parametrizations:
bounds and altitude (
xmin,xmax,ymin,ymax,z): in that case, the rectangle is axis-aligned;centre position, edge lengths, normal vector and orientation (
xyz,size_x,size_y,n,up): in that case, the rectangle is scaled and positioned using a look-at transformation;geometric transform (
to_world): in that case, a geometric transformation can be passed directly.
- Parameters:
to_world (
mi.ScalarTransform4f) – If this parametrization is used,to_worldmust be supplied in kernel units.xmin, xmax, ymin, ymax, z, size_x, size_y (
floatorquantity) – Unit-enabled (default: ucc[‘length’]).zmay be omitted (if so, it defaults to 0).xyz (array-like or
quantity) – Unit-enabled (default: ucc[‘length’]).n, up (array-like)
- static convert(value)¶
Object converter method.
If
valueis a dictionary, this method usesnew()to instantiate aTargetchild class based on the"type"entry it contains.If
valueis a 3-vector, this method returns aTargetPointinstance.Otherwise, it returns
value.
- static new(target_type, *args, **kwargs)¶
Instantiate one of the supported child classes. This factory requires manual class registration. All position and keyword arguments are forwarded to the constructed type.
Currently supported classes:
point:TargetPointrectangle:TargetRectangle
- Parameters:
target_type (
{"point", "rectangle"}) – Identifier of one of the supported child classes.- Returns:
- property bbox¶
Bounding (in configuration units).
- property xmax¶
Deprecated since version 1.0.0.
Alias to
self.bbox.max[0](for compatibility).
- property xmin¶
Deprecated since version 1.0.0.
Alias to
self.bbox.min[0](for compatibility).
- property ymax¶
Deprecated since version 1.0.0.
Alias to
self.bbox.max[1](for compatibility).
- property ymin¶
Deprecated since version 1.0.0.
Alias to
self.bbox.min[1](for compatibility).
- property z¶
Deprecated since version 1.0.0.
Alias to
0.5 * (self.bbox.min[2] + self.bbox.max[2])(for compatibility).