continuous API#

Conversion from discrete to continuous mtg, and vice versa.

In practice, here continuous mtg means the mtg equivalent to rsml.

openalea.rsml.continuous.continuous_to_discrete(g)[source]#

Convert mtg g from continuous to discrete form in-place

Does the reverse of discrete_to_continuous:
  • Add a sequence of segments to all axes from their geometry attribute

openalea.rsml.continuous.discrete_to_continuous(g, position='position')[source]#

Convert the “discrete mtg” g to continuous form in-place

Discrete mtg g is expected to:
  • have the 3 scales: Plant (1), Axe (2), Segment (3)

  • have a position defined for all segmeent vertices The argument position defines how to retrieve its value:

    • it can be the name of the mtg property the position is stored in

    • or a function(g,vid) that returns the position of vertex vid

  • An axe components is one sequence of successors (edge_type=’<’)

The given mtg is then converted to continuous form:
  • the vertices at higher scale (i.e. the segments) are removed and their position are added in a list which is stored in the ‘geometry’ property of their complex.

  • branch axes which are connected to their parent at the segment scale (ie. the 1st segment has its parent on the parent axe) will have their ‘parent_node’ property set to the index of the respective node in the parent geometry. The position of the parent node is added at the beginning of the branch

openalea.rsml.continuous.toporder(g, scale)[source]#

Return the list of g vertices at scale scale in topological order

Download the source file ../../src/openalea/rsml/continuous.py.