Skip to content

Commit cd531ef

Browse files
committed
Update website to new geometry API
1 parent 6e47f84 commit cd531ef

4 files changed

Lines changed: 13 additions & 15 deletions

File tree

docs/src/howto/GridCloner.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ We create a simple plant placeholder defined by a stem and a single long leaf:
6262
```julia
6363
struct Plant <: Node end
6464
function VirtualPlantLab.feed!(turtle::Turtle, plant::Plant, data)
65-
HollowCylinder!(turtle, move = true, color = RGB(0.63, 0.63, 0.63), length = 2.0,
65+
HollowCylinder!(turtle, move = true, colors = RGB(0.63, 0.63, 0.63), length = 2.0,
6666
width = 0.25, height = 0.25)
6767
rh!(turtle, rand()*360.0)
6868
ra!(turtle, rand()*90.0)
69-
Rectangle!(turtle, color = RGB(0.0, 1.0, 0.0), length = 3.0, width = 0.2)
69+
Rectangle!(turtle, colors = RGB(0.0, 1.0, 0.0), length = 3.0, width = 0.2)
7070
return nothing
7171
end
7272
axiom(origin) = T(origin) + Plant()
@@ -96,7 +96,7 @@ tile to help identify them in the visualization:
9696
plant_scene = Scene(vec(plants));
9797
soil_scene = Scene()
9898
for tile in tiles
99-
add!(soil_scene, mesh = tile, color = RGB(rand(), rand(), rand()))
99+
add!(soil_scene, mesh = tile, colors = RGB(rand(), rand(), rand()))
100100
end
101101
scene = Scene([plant_scene, soil_scene]);
102102
render(scene)

docs/src/howto/Message.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Let's illustrate how to use messages with a simple example. We will modify the T
1717
to allow for visualizing. Below is all the code for the tree model excluding the `feed!`
1818
methods
1919

20-
````julia
20+
```julia
2121
using VirtualPlantLab
2222
using ColorTypes
2323
import GLMakie
@@ -102,7 +102,7 @@ function simulate(tree, query, nsteps)
102102
end
103103
return new_tree
104104
end
105-
````
105+
```
106106

107107
There are three types of nodes that require geometry: `Leaf`, `Internode`, and `BudNode`,
108108
though 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
112112
when we don't generate internodes we still need to modify the state of the turtle to ensure
113113
the correct positioning of the leaves.
114114

115-
````julia
115+
```julia
116116
# Insertion angle for the bud nodes
117117
function 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
134134
end
@@ -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
148148
end
149-
````
149+
```
150150

151151
We can now generate a simulation:
152152

153-
````julia
153+
```julia
154154
newtree = simulate(tree, getInternode, 15)
155-
````
155+
```
156156

157157
For a visualization of both leaves and internodes we can actually leave the message empty
158158
given how the code above is structured:
159159

160-
````julia
160+
```julia
161161
scene = Scene(newtree);
162162
render(scene, axes = false)
163-
````
163+
```
164164

165165
For only leaves:
166166

docs/src/tutorials/from_tree_forest/growthforest.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,4 +463,3 @@ get_LAI(forest)
463463
---
464464

465465
*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*
466-

docs/src/tutorials/more_rules_queries/relationalqueries.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,4 +333,3 @@ A12 = apply(graph, Q12)
333333
---
334334

335335
*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*
336-

0 commit comments

Comments
 (0)