From e289eef2bfa94c08268a61ad111a02cbd88680e9 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Wed, 15 Apr 2020 07:27:11 +0800 Subject: [PATCH] change M to f --- examples/lsystem_collection.scad | 6 +++--- src/experimental/_impl/_lsystem2_impl.scad | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/lsystem_collection.scad b/examples/lsystem_collection.scad index 316da672..ac7c0473 100644 --- a/examples/lsystem_collection.scad +++ b/examples/lsystem_collection.scad @@ -1,7 +1,7 @@ use ; use ; -for(line = plant()) { +for(line = island_curve()) { line2d( line[0], line[1], @@ -176,8 +176,8 @@ function island_curve(n = 2, angle = 90, leng = 1, heading = 0, start = [0, 0]) let( axiom = "F-F-F-F", rules = [ - ["F", "F-M+FF-F-FF-FM-FF+M-FF+F+FF+FM+FFF"], - ["M", "MMMMMM"] + ["F", "F-f+FF-F-FF-Ff-FF+f-FF+F+FF+Ff+FFF"], + ["f", "ffffff"] ] ) lsystem2(axiom, rules, n, angle, leng, heading, start); diff --git a/src/experimental/_impl/_lsystem2_impl.scad b/src/experimental/_impl/_lsystem2_impl.scad index a008fc47..c1d4111a 100644 --- a/src/experimental/_impl/_lsystem2_impl.scad +++ b/src/experimental/_impl/_lsystem2_impl.scad @@ -50,8 +50,7 @@ function _next_t1(t1, t2, code, stack) = function _next_t2(t, code, angle, leng) = is_undef(code) || code == "[" || code == "]" ? t : - code == "F" ? turtle2d("forward", t, leng) : - code == "M" ? turtle2d("forward", t, leng) : + code == "F" || code == "f" ? turtle2d("forward", t, leng) : code == "+" ? turtle2d("turn", t, angle) : code == "-" ? turtle2d("turn", t, -angle) : t;