01_user_documentation:06_graph:03_graphs:01_project_graph:09_additional_root
This is an old revision of the document!
Additional root
You can create any root you want :O
- customRoot.rgg
// import other compiled files (.rgg, .java, .xl) without subdirectory path. import parameters.*; module A(float len) extends Sphere(0.1) { {setShader(GREEN);} } module Base; protected void init () [ Axiom ==> Base A(parameters.length); ] public void run () [ A(x) ==> F(x) [RU(30) RH(90) A(x*0.8)] [RU(-30) RH(90) A(x*0.8)]; ] /** * This function creates a clone of all Nodes below Base (so all of the plant) and adds it to the new root "test" * **/ public void toto() { Node b = cloneSubgraph(first((*Base*))); graph().setRoot("test",b); }
01_user_documentation/06_graph/03_graphs/01_project_graph/09_additional_root.1774286263.txt.gz ยท Last modified: 2026/03/23 18:17 by Tim
