aboutsummaryrefslogtreecommitdiff
path: root/enclosure/enclosure.scad
blob: e2603766ce2205d03befbc341b70ce15ba9864c5 (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
/*
  a box divided on layers, 4 long screws at the corners to keep it
  together, alignment pins between layers
 
  * top, big hole for the screen and small holes for air
 
  * board, holds the board and the switch / button / usb / sd holes on
    the sides; the co2 sensor probably goes here as well
 
  * bottom, for battery and pm sensor
 */
 
DISPLAY_WIN_X=51;
DISPLAY_WIN_Y=26;
DISPLAY_OFF_X=16;
DISPLAY_OFF_Y=7;
 
//PITCH=0.254; don't really care
BOARD_X=66.5;
BOARD_Y=36.8;
BOARD_PIN_D=1.9;
BOARD_PIN_OFF_X=2.5; BOARD_PIN_DIST_X=61;
BOARD_PIN_OFF_Y=2.5; BOARD_PIN_DIST_Y=32.5;
 
BOARD_OFF_X=3;
BOARD_OFF_Y=3;
 
TOP_LAYER_Z=10;
 
TOTAL_X=100;
TOTAL_Y=40;
TOTAL_Z=30;
 
module top() {
  difference() {
    cube([TOTAL_XTOTAL_YTOP_LAYER_Z]);
    translate([BOARD_OFF_XBOARD_OFF_Y0]) union() {
      translate([DISPLAY_OFF_XDISPLAY_OFF_Y-1])
        cube([DISPLAY_WIN_XDISPLAY_WIN_YTOP_LAYER_Z*2]);
 
      // alignment pins
      translate([BOARD_PIN_OFF_XBOARD_PIN_OFF_Y-1])
        cylinder(d=BOARD_PIN_D,h=TOP_LAYER_Z/2);
      translate([BOARD_PIN_OFF_X+BOARD_PIN_DIST_XBOARD_PIN_OFF_Y-1])
        cylinder(d=BOARD_PIN_D,h=TOP_LAYER_Z/2);
      translate([BOARD_PIN_OFF_XBOARD_PIN_OFF_Y+BOARD_PIN_DIST_Y-1])
        cylinder(d=BOARD_PIN_D,h=TOP_LAYER_Z/2);
      translate([BOARD_PIN_OFF_X+BOARD_PIN_DIST_XBOARD_PIN_OFF_Y+BOARD_PIN_DIST_Y-1])
        cylinder(d=BOARD_PIN_D,h=TOP_LAYER_Z/2);
    }
  }
}
 
top();