From 04f39c05145f4a0d5f1dc6a77f3618c9745cbc88 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 16 Apr 2020 08:28:41 +0800 Subject: [PATCH] add spring --- examples/lsystem3_collection.scad | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/lsystem3_collection.scad b/examples/lsystem3_collection.scad index b2b3c127..6137722a 100644 --- a/examples/lsystem3_collection.scad +++ b/examples/lsystem3_collection.scad @@ -1,7 +1,7 @@ use ; use ; -for(line = vine()) { +for(line = spring()) { hull_polyline3d( [line[0], line[1]], thickness = 0.25, @@ -48,4 +48,13 @@ function vine(n = 3, angle = 18, leng = 1, heading = 0, start = [0, 0, 0]) = ["F", "/F[++F]-\F[--F]+//F"] ] ) + lsystem3(axiom, rules, n, angle, leng, heading, start); + +function spring(n = 8, angle = 12, leng = 1, heading = 0, start = [0, 0, 0]) = + let( + axiom = "F", + rules = [ + ["F", "F-^F"] + ] + ) lsystem3(axiom, rules, n, angle, leng, heading, start); \ No newline at end of file