From 88f9dd650210fe1681b0000fc7f46cabfaaf53ba Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Fri, 10 Dec 2021 08:05:57 +0100 Subject: [PATCH] Vykrajovatko --- vykrajovatko-ctverec.scad | 71 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 vykrajovatko-ctverec.scad diff --git a/vykrajovatko-ctverec.scad b/vykrajovatko-ctverec.scad new file mode 100644 index 0000000..ac5ef15 --- /dev/null +++ b/vykrajovatko-ctverec.scad @@ -0,0 +1,71 @@ +draft = 0; +eps = 0.01; +infty = 100; + +kuzel_def = [ + [ 6.5, 0 ], + [ 6.5, 1.5 ], + [ 3.5, 4 ], + [ 2.5, 6 ], + [ 1.5, 13.0 ], + [ 0.5, 15.0 ], +]; + +module kuzel() { + for (i = [0 : len(kuzel_def)-2]) { + translate([0, 0, kuzel_def[i][1]]) + cylinder(r1 = kuzel_def[i][0], + r2 = kuzel_def[i+1][0], + h = kuzel_def[i+1][1] + eps - kuzel_def[i][1]); + } +}; + +kuzel2_def = [ + [ 1.5, 0 ], + [ 1.5, 13.0 ], + [ 0.5, 15.0 ], +]; + +module kuzel2() { + for (i = [0 : len(kuzel2_def)-2]) { + translate([0, 0, kuzel2_def[i][1]]) + cylinder(r1 = kuzel2_def[i][0], + r2 = kuzel2_def[i+1][0], + h = kuzel2_def[i+1][1] + eps - kuzel2_def[i][1]); + } +}; + +module shape(h) +{ + linear_extrude(height=h) + polygon([[-15, -15], [-15, 15], [15, 15], [15, -15]]); +}; + +for (x = [0, 45]) translate([x, 0, 0]) +difference(){ + minkowski(){ + shape(eps); + if (draft == 1) { + kuzel($fn = 6); + } else { + kuzel($fn = 32); + } + } + translate([0,0,-infty/2]) shape(infty); +}; + +difference(){ + union() { + minkowski(){ + cylinder(r = 7, h = eps, $fn = 128); + if (draft == 1) { + kuzel2($fn = 6); + } else { + kuzel2($fn = 32); + } + } + for (a = [0, 90]) rotate([0, 0, a]) + translate([-15, -1, 0]) cube([30, 2, 7]); + } + translate([0,0,-infty/2]) cylinder(r = 7, h = infty); +}; -- 2.43.5