3D visualization
Public API
PlantViz.export_scene
— Methodexport_scene(;scene, filename, kwargs...)
Export a screenshot of the current visualization (stored as scene
as output of a call to render
) as a PNG file store in the path given by filename
(including .png
extension). Keyword arguments will be passed along to the corresponding save
method from Makie (see VPL documentation for details).
PlantViz.render!
— Methodrender!(grid::GridCloner; alpha = 0.2)
Add a mesh representing the bounding boxes of the grid cloner to a 3D scene, where alpha
represents the transparency of each box.
PlantViz.render!
— Methodrender!(source::Source{G, A, nw}; n = 20, alpha = 0.2, point = false,
scale = 0.2)
Add a mesh representing the light source to a 3D scene (if point = false
) or a series of points representing the center of the light sources (if point = true
). When point = false
, for each type of light source a triangular mesh will be created, where n
is the number of triangles (see documentation of geometric primitives for details) and alpha
is the transparency to be used for each triangle. When point = true
, only the center of the light source is rendered along with the normal vector at that point (representative of the direction at which rays are generated). In the current version, point = true
is only possible for directional light sources.
PlantViz.render
— Methodrender(mesh::Mesh; normals::Bool = false, wireframe::Bool = false, kwargs...)
Render a Mesh
object. This will create a new visualization (see Documentation for details). normals = true
will draw arrows in the direction of the normal vector for each triangle in the mesh, wireframe = true
will draw the edges of each triangle with black lines. Keyword arguments are passed to Makie.mesh()
. The actual color of each triangle depends on the illumination of the scene but it is possible to turn this off by passing shading = false
. This will use the exact colors specified in the Scene
object.
Private
Private functions, types or constants from PlantViz
. These are not exported, so you need to prefix the function name with PlantViz.
to access them. Also bear in mind that these are not part of the public API, so they may change without notice.