eradiate.scenes.biosphere.AbstractTree
eradiate.scenes.biosphere.AbstractTree#
- class eradiate.scenes.biosphere.AbstractTree(id='abstract_tree', leaf_cloud=None, trunk_height=<Quantity(1.0, 'meter')>, trunk_radius=<Quantity(0.1, 'meter')>, trunk_reflectance=0.5, leaf_cloud_extra_offset=_Nothing.NOTHING)[source]#
Bases:
eradiate.scenes.biosphere._tree.Tree
A container class for abstract trees in discrete canopies. Holds a
LeafCloud
and the parameters characterizing a cylindrical trunk. The entire tree is described in local coordinates and can be placed in the scene usingInstancedCanopyElement
.The trunk starts at [0, 0, -0.1] and extends to [0, 0, trunk_height]. The trunk extends below
z=0
to avoid intersection issues at the intersection of the trunk and the ground the tree is usually placed on.The leaf cloud will by default be offset such that its local coordinate origin coincides with the upper end of the trunk. If this is not desired, e.g. the leaf cloud is centered around its coordinate origin and the trunk should not extend into it, the parameter
leaf_cloud_extra_offset
can be used to shift the leaf cloud in addition to the trunk’s extent.- Parameters
id (
str
, optional, default:"abstract_tree"
) – User-defined object identifier.leaf_cloud (
LeafCloud
ordict
, optional) – Instanced leaf cloud. Can be specified as a dictionary, which will be interpreted bybiosphere_factory
. If the latter case, the"type"
parameter, if omitted, will implicitly be set to"leaf_cloud"
.trunk_height (
quantity
orfloat
, default:1.0 m
) – Trunk height. Unit-enabled field (default: ucc[“length”]).trunk_radius (
quantity
orfloat
, optional, default:0.1 m
) – Trunk radius. Unit-enabled field (default: ucc[“length”]).trunk_reflectance (
Spectrum
ordict
, optional, default:0.5
) – Reflectance spectrum of the trunk. Must be a reflectance spectrum (dimensionless).leaf_cloud_extra_offset (
quantity
or array-like, optional, default:[0
,0
,0]
) – Additional offset for the leaf cloud. 3-vector. Unit-enabled field (default: ucc[“length”])
- Fields
- kernel_bsdfs(ctx)[source]#
Return BSDF plugin specifications.
- Parameters
ctx (
KernelDictContext
) – A context data structure containing parameters relevant for kernel dictionary generation.- Returns
dict
– Return a dictionary suitable for merge with aKernelDict
containing all the BSDFs attached to the shapes in the abstract tree.
- 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
dict
– A dictionary suitable for merge with aKernelDict
containing all the shapes in the abstract tree.