MTG Tutorial - PlantFrame#
PlantFrame is a method to compute the geometry of each organ of a Plant Architecture. Geometrical data is associated to some vertices of the architecture (aka MTG). But often, geometrical information is missing on some vertex. Constraints have to be solved to compute missing values.
The stages of the PlantFrame are:
insert a scale at the axis level.
project all the constraints at the finer scale.
apply different Knowledge Sources (i.e. KS) on the MTG to compute the values at some nodes.
solve the constraints.
visualise the geometry using a 3D Turtle.
Introduction#
Let’s import all we need for the tutorial.
[1]:
from openalea.widgets.plantgl import *
Data Reconstruction#
We need to load some datasets from MTG
[2]:
from openalea.mtg import *
from openalea.mtg.data import data_dir as data
First, we load the digitized Walnut noylum2.mtg
[3]:
g = MTG(data/'noylum2.mtg')
Then, a file containing a set of default geometric parameters is loaded to build a DressingData (walnut.drf)
[4]:
drf = data/'walnut.drf'
dressing_data = dresser.dressing_data_from_file(drf)
dressing_data = plantframe.DressingData(DiameterUnit=10)
Visualisation of a digitized Tree#
Geometric parameters are missing. How to compute them? Use the PlantFrame, a geometric solver working on multiscale tree structure.
Create the solver and solve the problem
[5]:
pf = plantframe.PlantFrame(g,
TopDiameter='TopDia',
DressingData = dressing_data)
Visualise the plant in 3D
[6]:
scene = pf.plot(gc=False, display=False)
[7]:
PlantGL(scene)
[7]: