mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-06 12:19:47 +00:00
commit
4aea5d2144
2 changed files with 3 additions and 49 deletions
|
@ -34,7 +34,7 @@ xdistribute(50) {
|
||||||
[ x, y+s1], [ x, y]
|
[ x, y+s1], [ x, y]
|
||||||
];
|
];
|
||||||
recolor("#99f")
|
recolor("#99f")
|
||||||
path_sweep(regular_ngon(n=3,d=10,spin=90), bezpath_points(sbez));
|
path_sweep(regular_ngon(n=3,d=10,spin=90), bezpath_curve(sbez));
|
||||||
|
|
||||||
recolor("#0bf")
|
recolor("#0bf")
|
||||||
translate([-15,-35,0])
|
translate([-15,-35,0])
|
||||||
|
@ -44,10 +44,10 @@ xdistribute(50) {
|
||||||
xdistribute(24) {
|
xdistribute(24) {
|
||||||
screw("M12,70", head="hex", anchor="origin", orient=BACK)
|
screw("M12,70", head="hex", anchor="origin", orient=BACK)
|
||||||
attach(BOT,CENTER)
|
attach(BOT,CENTER)
|
||||||
nut("M12", thickness=10, diameter=20, details=true);
|
nut("M12", thickness=10, diameter=20);
|
||||||
screw("M12,70", head="hex", anchor="origin", orient=BACK)
|
screw("M12,70", head="hex", anchor="origin", orient=BACK)
|
||||||
attach(BOT,CENTER)
|
attach(BOT,CENTER)
|
||||||
nut("M12", thickness=10, diameter=20, details=true);
|
nut("M12", thickness=10, diameter=20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,46 +0,0 @@
|
||||||
include <BOSL2/std.scad>
|
|
||||||
|
|
||||||
module leaf(s) {
|
|
||||||
path = [
|
|
||||||
[0,0], [1.5,-1],
|
|
||||||
[2,1], [0,3], [-2,1],
|
|
||||||
[-1.5,-1], [0,0]
|
|
||||||
];
|
|
||||||
xrot(90)
|
|
||||||
linear_extrude(height=0.02)
|
|
||||||
bezier_polygon(path*s/2);
|
|
||||||
}
|
|
||||||
|
|
||||||
module branches(minsize, s1, s2){
|
|
||||||
if(s2>minsize) {
|
|
||||||
attach(TOP)
|
|
||||||
zrot(gaussian_rands(1,90,20)[0])
|
|
||||||
zrot_copies(n=floor(log_rands(2,5,4)[0]))
|
|
||||||
zrot(gaussian_rands(1,0,5))
|
|
||||||
yrot(gaussian_rands(1,30,10)) {
|
|
||||||
sc = gaussian_rands(1,0.7,0.05)[0];
|
|
||||||
cylinder(d1=s2, d2=s2*sc, l=s1)
|
|
||||||
branches(minsize, s1*sc, s2*sc);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
recolor("springgreen")
|
|
||||||
attach(TOP) zrot(90)
|
|
||||||
leaf(gaussian_rands(1,100,5)[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module tree(h, d, minsize) {
|
|
||||||
sc = gaussian_rands(1,0.7,0.05)[0];
|
|
||||||
recolor("lightgray") {
|
|
||||||
echo(d=d,sc=sc);
|
|
||||||
cylinder(d1=d, d2=d*sc, l=h) {
|
|
||||||
branches(minsize, h, d*sc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tree(d=300, h=1500, minsize=10);
|
|
||||||
|
|
||||||
|
|
||||||
// vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|
|
Loading…
Reference in a new issue