aboutsummaryrefslogtreecommitdiff
path: root/tabletop_tablet_stand_base.scad
blob: 6383ffdef654a6313a7d99d867417a2a72dc8d6c (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
thickness = 12;
legWidth = 20;
legWallThickness = 2;
rearLegLength = 30;
frontLegLength = 90;
frontLegCenterRotationDegrees = 55;
legLift = 2;

nutInsetHeight = 4;
nutInsetDiameter = 15;
threadDiameter = 7;

module leg(width, length, thickness) {
  difference() {
    translate([-width/2, 0, 0])
      cube([width, length, thickness]);
    
    translate([-width/2+legWallThickness, 0, legWallThickness])
      cube([width - 2*legWallThickness, length, thickness - legWallThickness]);
  }

  translate([0, length, 0])
    cylinder(r = width/2, h = thickness + legLift);
  
  cylinder(r = width/2, h = thickness);
}

difference() {
  union() {
    // rear leg
    rotate([0, 0, 180])
      leg(legWidth, rearLegLength, thickness);

    // right leg
    rotate([0, 0, -frontLegCenterRotationDegrees])
      leg(legWidth, frontLegLength, thickness);

    // leftleg
    rotate([0, 0, +frontLegCenterRotationDegrees])
      leg(legWidth, frontLegLength, thickness);
  }

  // thread hole
  cylinder(r = threadDiameter/2, h = thickness);

  // nut inset
  translate([0, 0, thickness - nutInsetHeight])
    cylinder(r = nutInsetDiameter/2, h = nutInsetHeight);
}