]> gitweb.factorcode.org Git - factor.git/commitdiff
Add L-system.models.tree-5
authorEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Sun, 11 Jan 2009 17:02:48 +0000 (11:02 -0600)
committerEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Sun, 11 Jan 2009 17:02:48 +0000 (11:02 -0600)
extra/L-system/models/tree-5/tree-5.factor [new file with mode: 0644]

diff --git a/extra/L-system/models/tree-5/tree-5.factor b/extra/L-system/models/tree-5/tree-5.factor
new file mode 100644 (file)
index 0000000..2647698
--- /dev/null
@@ -0,0 +1,37 @@
+
+USING: accessors ui L-system ;
+
+IN: L-system.models.tree-5
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+: tree-5 ( <L-system> -- <L-system> )
+
+  L-parser-dialect >>commands
+
+  [ 5 >>angle ] >>turtle-values
+
+  "c(4)FFS" >>axiom
+
+  {
+    { "S" "FFR>(60)R>(60)R>(60)R>(60)R>(60)R>(30)S" }
+    { "R" "[Ba]" }
+    { "a" "$tF[Cx]Fb" }
+    { "b" "$tF[Dy]Fa" }
+    { "B" "&B" }
+    { "C" "+C" }
+    { "D" "-D" }
+
+    { "x" "a" }
+    { "y" "b" }
+
+    { "F" "'(1.25)F'(.8)" }
+  }
+    >>rules ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+: main ( -- ) [ L-system tree-5 "L-system" open-window ] with-ui ;
+
+MAIN: main
+  
\ No newline at end of file