1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 23:06:43 +02:00

add fern_leaf

This commit is contained in:
Justin Lin
2020-04-15 14:01:22 +08:00
parent e2b1dcddd8
commit 4416a1276f

View File

@@ -1,7 +1,7 @@
use <experimental/lsystem3.scad>;
use <hull_polyline3d.scad>;
for(line = tree()) {
for(line = fern_leaf()) {
hull_polyline3d(
[line[0], line[1]],
thickness = 0.25,
@@ -28,4 +28,15 @@ function hilbert_curve(n = 3, angle = 90, leng = 1, heading = 0, start = [0, 0,
["D", "|CFB-F+B|FA&F∧A&&FB-F+B|FC//"]
]
)
lsystem3(axiom, rules, n, angle, leng, heading, start);
lsystem3(axiom, rules, n, angle, leng, heading, start);
function fern_leaf(n = 8, angle = 4, leng = 1, heading = 0, start = [0, 0, 0]) =
let(
axiom = "EEEA",
rules = [
["A", "[++++++++++++++EC]B^+B[--------------ED]B+BA"],
["C", "[---------EE][+++++++++EE]B&&+C"],
["D", "[---------EE][+++++++++EE]B&&-D"]
]
)
lsystem3(axiom, rules, n, angle, leng, heading, start, forward_chars = "ABCDE");