chiark / gitweb /
rpi-mount: provide z max
[reprap-play.git] / rpi-mount.scad
1 // -*- C -*-
2
3 include <utils.scad>
4
5 pi_board_gap = 0.5;
6 pi_board_support_z = 2;
7 pi_board_support_wall = 2;
8
9 pi_sz   = [ 66.0, 30.5 ] + pi_board_gap * [1,1];
10
11 pi_nom_sz = [ 65, 30 ];
12 pi_nom_centres_in = 3.5;
13 pi_solder_side_gap = 1.5 * 2;
14 pi_screw_hole_dia  = 2.3;
15 pi_screw_hole_wall = 2.3;
16
17 pi_sz_z_incl_ribbon = 18.0;
18
19 pi_mount_z_min = 1.75;
20 pi_mount_z_def = 2.50;
21
22 // calculated, output
23
24 function pi_ribbon_top_z(pi_mount_z= pi_mount_z_def)
25   = pi_mount_z + pi_sz_z_incl_ribbon;
26
27 module PiMount(pi_mount_z= pi_mount_z_def){
28   sxy = pi_nom_sz/2 - [1,1] * pi_nom_centres_in;
29   for (mx=[0,1]) mirror([mx,0,0]) for (my=[0,1]) mirror([0,my,0]) {
30     difference(){
31       union(){
32         linextr(-0.1, pi_mount_z + pi_board_support_z, convexity=1)
33           rectfromto( pi_nom_sz/2 - 2 * [1,1] * pi_nom_centres_in,
34                       pi_sz/2 + [1,1] * pi_board_support_wall);
35         linextr(-0.1, pi_mount_z - pi_solder_side_gap, convexity=1)
36           translate(sxy)
37           square(center=true, pi_screw_hole_dia + pi_screw_hole_wall*2);
38       }
39       linextr(pi_mount_z, pi_mount_z + 5, convexity=1)
40         rectfromto(-[10,10], pi_sz/2);
41       translate( sxy )
42         linextr(-1, pi_mount_z + 10, convexity=1)
43         circle(r= pi_screw_hole_dia/2);
44     }
45   }
46 }