aboutsummaryrefslogtreecommitdiff
path: root/3d-print/qrd-holder.scad
blob: 52a47552a46b1ecd5c20dcb8d060f6d862fd5b3a (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
use <LEGO.scad/LEGO.scad>;
 
 
module qrd1114() {
     /*
       4 holes, 0.4mm diameter, rectangle
 
       o-o  3.3
       | |
       o-o
 
       3
 
       the holes' diameter is larger because:
 
       - my printer can't reliably print holes smaller than 1 (which
         ends up being about .4 anyway)
 
       - there's a "end bump" on the stems of the sensor, and I need
         those to go through the hole as well
     */
 
     width=3;
     height=3.3;
     diam=1.2;
     radius=diam/2;
 
     module via() {
          translate([0,0,-5]) cylinder(h=10,r=radius,center=false,$fn=12);
     }
 
     place(0.5,0.5) {
          for (x=[-0.5,0.5],y=[-0.5,0.5]) {
               translate([x*width,y*height]) via();
          }
     }
}
 
length=29;
width=2;
 
sensors=[
      0,  1.5,  2.5,  3.5,  5,
      6,  7.5,  8.5,  9.510.511.513,
     1415.516.517.519,
     2021.522.523.524.525.527,
     28,
];
 
difference() {
     uncenter(width,length) block(
          type="baseplate",
          width=width,
          length=length,
          roadway_width=1,
          roadway_length=60,
          roadway_x=0,
          // my printer makes the studs slightly small
          stud_rescale=0.49/0.48
     );
     for (x=sensors) {
          place(0,x) qrd1114();
     }
}