50 lines
No EOL
1.2 KiB
OpenSCAD
50 lines
No EOL
1.2 KiB
OpenSCAD
$fn = 100;
|
|
fs = 1; // roughly the size of straight party of curves
|
|
w1 = 1; // cookie cutter, thicker side
|
|
w2 = 1; // cookie cutter, thinner side
|
|
h = 1; // cookie cutter height
|
|
mh = 2; // thickness of connection to window
|
|
sw = 18; // size of window
|
|
dt = 2; // dough thickness at the window carve, '0' for cut
|
|
|
|
function fn(a, b) = round(sqrt(pow(a[0]-b[0],2) + (pow(a[1]-b[1], 2)))/fs);
|
|
|
|
module shape() cylinder(h, w1/2, w2/2, $fn=12);
|
|
|
|
function b_pts(pts, n, idx) =
|
|
len(pts)>2 ?
|
|
b_pts([for(i=[0:len(pts)-2])pts[i]], n, idx) * n*idx
|
|
+ b_pts([for(i=[1:len(pts)-1])pts[i]], n, idx) * (1-n*idx)
|
|
: pts[0] * n*idx
|
|
+ pts[1] * (1-n*idx);
|
|
|
|
module b_curve(pts)
|
|
let (idx=fn(pts[0], pts[len(pts)-1]), n = 1/idx){
|
|
for (i= [0:idx-1])
|
|
hull(){
|
|
translate(b_pts(pts, n, i)) shape();
|
|
translate(b_pts(pts, n, i+1)) shape();
|
|
};}
|
|
|
|
module spike() {
|
|
polygon([[0, 0], [10, 0], [5, 50]]);
|
|
|
|
}
|
|
|
|
// spike();
|
|
|
|
blade = 8;
|
|
|
|
module fan() {
|
|
for (i = [0 : blade]){
|
|
rotate( i * 360/blade, [0, 0, 1])
|
|
b_curve([[0, 0], [20, 30], [10, 45], [0, 37]]);
|
|
}
|
|
|
|
cylinder(h, d = 35);
|
|
}
|
|
|
|
difference() {
|
|
fan();
|
|
cylinder(h, d = 5);
|
|
}; |