misc API#
Practical functionality to process rsml-formated mtg
- openalea.rsml.misc.hausdorff_distance(polyline1, polyline2)[source]#
Compute the hausdorff distance from polyline1 to polyline2
- Inputs:
- polyline1:
a (k,n1) array for the n1 points of the 1st polyline in k-dimension
- polyline2:
a (k,n2) array for the n2 points of the 2nd polyline in k-dimension
- Output:
- The hausdorff distance:
max( D(polyline1,polyline2), D(polyline2,polyline1) )
- where
D(p1,p2) = max_(i in p1) |p1[i] - closest-projection-on-p2|
- openalea.rsml.misc.root_order(g, tree=None)[source]#
return a dictionary of the (numeric) axe order
- The order is select as:
the value of the ‘order’ property, if present
otherwise, 1 for axe with no parent or the parent order +1
tree is the optional list of root id in g. If not given, it is computed
- openalea.rsml.misc.root_tree(g, suborder=None)[source]#
return the list of root axes in topological order
If suborder is given, it should be a dictionary of (root-id,value) which is used to sort sibling root w.r.t. their respective value.
- openalea.rsml.misc.root_vertices(g)[source]#
return the list of mtg vertices that represent root axes
Download the source file ../../src/openalea/rsml/misc.py.