mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-20 05:21:38 +02:00
add gosper_star
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
use <experimental/lsystem2.scad>;
|
use <experimental/lsystem2.scad>;
|
||||||
use <line2d.scad>;
|
use <line2d.scad>;
|
||||||
|
|
||||||
for(line = weed()) {
|
for(line = gosper_star()) {
|
||||||
line2d(
|
line2d(
|
||||||
line[0],
|
line[0],
|
||||||
line[1],
|
line[1],
|
||||||
@@ -153,6 +153,16 @@ function gosper_curve(n = 4, angle = 60, leng = 1, heading = 0, start = [0, 0])
|
|||||||
)
|
)
|
||||||
lsystem2(rule, n, angle, leng, heading, start, "AB");
|
lsystem2(rule, n, angle, leng, heading, start, "AB");
|
||||||
|
|
||||||
|
function gosper_star(n = 3, angle = 60, leng = 1, heading = 0, start = [0, 0]) =
|
||||||
|
let(
|
||||||
|
rule = [
|
||||||
|
["S", "X-X-X-X-X-X"],
|
||||||
|
["X", "FX+YF++YF-FX--FXFX-YF+"],
|
||||||
|
["Y", "-FX+YFYF++YF+FX--FX-FY"]
|
||||||
|
]
|
||||||
|
)
|
||||||
|
lsystem2(rule, n, angle, leng, heading, start);
|
||||||
|
|
||||||
function levy_c_curve(n = 8, angle = 45, leng = 1, heading = 0, start = [0, 0]) =
|
function levy_c_curve(n = 8, angle = 45, leng = 1, heading = 0, start = [0, 0]) =
|
||||||
let(
|
let(
|
||||||
rule = [
|
rule = [
|
||||||
|
Reference in New Issue
Block a user