Groovy¶
Some usefull functions on an ArchiTree¶
NodesList (scale=-1, order=-1, type=-1)
NodesListC (closure)
Complex (node, scale=-1)
Components (node, scale=-1)
Successor (node, inAxis= false)
Predecessor (node, inAxis= false)
Branches (node, closure =null)
Bearer (node, order =-1)
Ancestors (node, closure =null)
Descendants (node, Closure closure =null)
Order (node)
Scale (node)
Position (node, scale = -1, fromBottom = true)
Table (data,columnsLabel)
LineChart (data, labels)
Example 1 : UC Length extraction on the trunk¶
//get the list of nodes for scale = 4 , type name = "UC" and ramification order = 1 (that is the trunk) nodes = NodesList(4,1,"UC") //collect the position in scale 2, the Length attribute and the Diameter attribute for each trunk UC res = nodes.collect({node -> res = [Position(node,2), Length(node), Diameter(node) ]}) //display the result in a table, where first column name is "Position", second column name is "Length" ... Table(res,["Position","Length","Diameter"]) //display the result in a chart, where abscissa name is "Position", first series is "Length" and second series is "Diameter" LineChart(res,["Position","Length", "Diameter"])