mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-30 09:49:59 +02:00
add fern
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use <experimental/lsystem2.scad>;
|
||||
use <line2d.scad>;
|
||||
|
||||
for(line = tree()) {
|
||||
for(line = fern()) {
|
||||
line2d(
|
||||
line[0],
|
||||
line[1],
|
||||
@@ -11,6 +11,17 @@ for(line = tree()) {
|
||||
);
|
||||
}
|
||||
|
||||
function fern(n = 8, angle = 4, leng = 1, heading = 0, start = [0, 0]) =
|
||||
let(
|
||||
axiom = "EEEA",
|
||||
rules = [
|
||||
["A", "[++++++++++++++EC]B+B[--------------ED]B+BA"],
|
||||
["C", "[---------EE][+++++++++EE]B+C"],
|
||||
["D", "[---------EE][+++++++++EE]B-D"]
|
||||
]
|
||||
)
|
||||
lsystem2(axiom, rules, n, angle, leng, heading, start, forward_chars = "ABCDE");
|
||||
|
||||
function tree(n = 2, angle = 36, leng = 1, heading = 0, start = [0, 0]) =
|
||||
let(
|
||||
axiom = "F",
|
||||
|
Reference in New Issue
Block a user