summaryrefslogtreecommitdiff
path: root/soap-box.scad
blob: 762ce1bf042aa23059c1f82b6a765315914452e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
wall_thickness_mm=3;
length_mm=120;
width_mm=70;
height_mm=30;
net_slack_pc=10;
net_thickness_mm=0.5;
peg_diam_mm=2;
slot_tolerance=0.05;
peg_hole_tolerance=0.5;
 
module notched_wall(x,y,z,side) {
  module notch() {
    translate ([-slot_tolerance,side*(y/2-slot_tolerance),-z/2])
      cube([z+slot_tolerance*2,y,z*2]);
  }
  difference() {
    cube ([x,y,z]);
    translate ([x/2,0,-z/2])
      scale ([(x-z*5)/2,y/2,1])
      cylinder(r=1,h=z*2$fs=0.1$fn=0);
    translate ([z,0,0]) notch();
    translate ([x-z*2,0,0]) notch();
  }
}
 
module wall_NS() {
  module peg_hole() {
    translate([0,0,-wall_thickness_mm/2])
      cylinder(
               d=(peg_diam_mm+peg_hole_tolerance),
               h=wall_thickness_mm*2,
               $fs=0.1$fn=0
               );
  }
  difference() {
    notched_wall(width_mm,height_mm,wall_thickness_mm,-1);
    translate([wall_thickness_mm*2.1+peg_diam_mm/2,height_mm-wall_thickness_mm,0]) peg_hole();
    translate([width_mm-wall_thickness_mm*2.1-peg_diam_mm/2,height_mm-wall_thickness_mm,0]) peg_hole();
  }
}
 
module wall_EW() {
  notched_wall(length_mm,height_mm,wall_thickness_mm,1);
}
 
module soap_net() {
  net_width_mm=(width_mm-wall_thickness_mm*4.2-peg_diam_mm)*(1+net_slack_pc/100);
  net_length_mm=length_mm-wall_thickness_mm*4.2;
 
  module peg() {
    intersection() {
      translate([0,0,peg_diam_mm*0.4])
        rotate([-90,0,0])
        cylinder(
                 d=peg_diam_mm,
                 h=length_mm-wall_thickness_mm*2,
                 $fs=0.1$fn=0
                 );
      translate([-peg_diam_mm,-length_mm*0.5,0])
        cube([peg_diam_mm*2,length_mm*2,peg_diam_mm*2]);
    }
  }
 
  union() {
    cube ([net_width_mm,net_length_mm,net_thickness_mm]);
    translate ([0,-wall_thickness_mm*1.5,0]) peg();
    translate ([net_width_mm,-wall_thickness_mm*1.5,0]) peg();
  }
}
 
wall_NS();
translate([0,height_mm*1.2,0]) wall_NS();
 
translate ([width_mm*1.2,0,0]) wall_EW();
translate ([width_mm*1.2,height_mm*1.2,0]) wall_EW();
 
translate ([wall_thickness_mm*2.5,height_mm*2.5 ,0]) soap_net();