]> www.fi.muni.cz Git - things.git/commitdiff
led-strip-end-round.scad printed version
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 21 Nov 2023 06:53:30 +0000 (07:53 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Mon, 29 Jan 2024 06:54:46 +0000 (07:54 +0100)
led-strip-end-round.scad

index a901a3f2c01a945c31d8b41b1ad3eec3dc422c3f..9dd4d5099297d548ff114aba4de8df9a7d64701d 100644 (file)
@@ -1,8 +1,11 @@
 include <yenyalib.scad>
 
 base_wall = 0.6;
+// base_wall = 0.45*3;
 inside_z = base_wall + 5;
+inside_wall = 0.45*3;
 
+/*
 base_w = 18;
 base_h1 = 7.5;
 base_h2 = 14;
@@ -13,39 +16,60 @@ inside_h = 3.9-0.2;
 
 inside_w1 = inside_w - 2;
 inside_h1 = 2;
+*/
 
-/*
 base_w = 23.5;
 base_h1 = 10;
 base_h2 = 11;
 
-inside_yoff = 1;
-inside_w = 21;
+inside_yoff = 1.3;
+inside_w = 20.9;
 inside_h = 1.8;
 
 inside_w1 = inside_w - 2;
 inside_h1 = 2;
+
+/*
+cable_w = 7;
+cable_h = 3 + inside_yoff;
 */
 
-// base
-union() {
-       intersection() {
-               let(r = (base_w^2)/(8*(base_h2-base_h1))
-                       + (base_h2-base_h1)/2)
-                       Ty(-r+base_h2)
-                       cylinder(r = r, h = base_wall, $fn = 256);
-               Tx(-base_w/2) cube([base_w, infty, base_wall]);
+module body() {
+       // base
+       union() {
+               intersection() {
+                       let(r = (base_w^2)/(8*(base_h2-base_h1))
+                               + (base_h2-base_h1)/2)
+                               Ty(-r+base_h2)
+                               cylinder(r = r, h = base_wall, $fn = 256);
+                       Tx(-base_w/2) cube([base_w, infty, base_wall]);
+               }
+               Tx(-base_w/2) cube([base_w, base_h1, base_wall]);
        }
-       Tx(-base_w/2) cube([base_w, base_h1, base_wall]);
-}
 
-// inside
-Tx(-inside_w/2) Ty(inside_yoff)
-       cube([inside_w, inside_h, inside_z]);
+       difference() {
+               union() {
+                       // inside
+                       Tx(-inside_w/2) Ty(inside_yoff)
+                               cube([inside_w, inside_h, inside_z]);
+
+                       // inside upper
+                       Tx(-inside_w1/2) Ty(inside_yoff+inside_h-eps)
+                               cube([inside_w1, inside_h1+eps, inside_z]);
+               }
+               translate([-inside_w1/2+inside_wall,
+                       inside_yoff+inside_wall, -eps])
+                       cube([inside_w1-2*inside_wall,
+                               inside_h + inside_h1, inside_z+2*eps]);
+       } 
+}
 
-// innside higher part
-if (inside_w1 > 0) {
-       Tx(-inside_w1/2) Ty(inside_yoff+inside_h-eps)
-               cube([inside_w1, inside_h1+eps, inside_z]);
+difference() {
+       body();
+       // cable hole
+       if (cable_w != undef) {
+               translate([-cable_w/2, -eps, -eps])
+                       cube([cable_w, cable_h+eps, inside_z+2*eps]);
+       }
 }