@@ -17,7 +17,7 @@ Let's illustrate how to use messages with a simple example. We will modify the T
1717to allow for visualizing. Below is all the code for the tree model excluding the ` feed! `
1818methods
1919
20- ```` julia
20+ ``` julia
2121using VirtualPlantLab
2222using ColorTypes
2323import GLMakie
@@ -102,7 +102,7 @@ function simulate(tree, query, nsteps)
102102 end
103103 return new_tree
104104end
105- ````
105+ ```
106106
107107There are three types of nodes that require geometry: ` Leaf ` , ` Internode ` , and ` BudNode ` ,
108108though the latter only adds the insertion angle for the branches. In the example below we
@@ -112,7 +112,7 @@ more meaningful we make the leaves bigger than in the original example). Note ho
112112when we don't generate internodes we still need to modify the state of the turtle to ensure
113113the correct positioning of the leaves.
114114
115- ```` julia
115+ ``` julia
116116# Insertion angle for the bud nodes
117117function VirtualPlantLab. feed! (turtle:: Turtle , b:: TreeTypes.BudNode , vars)
118118 # Rotate turtle around the arm for insertion angle
@@ -128,7 +128,7 @@ function VirtualPlantLab.feed!(turtle::Turtle, i::TreeTypes.Internode, vars)
128128 f! (turtle, i. length)
129129 else
130130 HollowCylinder! (turtle, length = i. length, height = i. length/ 15 , width = i. length/ 15 ,
131- move = true , color = RGB (0.5 ,0.4 ,0.0 ))
131+ move = true , colors = RGB (0.5 ,0.4 ,0.0 ))
132132 end
133133 return nothing
134134end
@@ -141,26 +141,26 @@ function VirtualPlantLab.feed!(turtle::Turtle, l::TreeTypes.Leaf, vars)
141141 ra! (turtle, - vars. leaf_angle)
142142 # Generate the leaf
143143 Ellipse! (turtle, length = l. length, width = l. width, move = false ,
144- color = RGB (0.2 ,0.6 ,0.2 ))
144+ colors = RGB (0.2 ,0.6 ,0.2 ))
145145 # Rotate turtle back to original direction
146146 ra! (turtle, vars. leaf_angle)
147147 return nothing
148148end
149- ````
149+ ```
150150
151151We can now generate a simulation:
152152
153- ```` julia
153+ ``` julia
154154newtree = simulate (tree, getInternode, 15 )
155- ````
155+ ```
156156
157157For a visualization of both leaves and internodes we can actually leave the message empty
158158given how the code above is structured:
159159
160- ```` julia
160+ ``` julia
161161scene = Scene (newtree);
162162render (scene, axes = false )
163- ````
163+ ```
164164
165165For only leaves:
166166
0 commit comments