chiark / gitweb /
rpi-mount: Adjust z
[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_mount_z_min = 1.75;
18 pi_mount_z_def = 2.50;
19
20 module PiMount(pi_mount_z= pi_mount_z_def){
21   sxy = pi_nom_sz/2 - [1,1] * pi_nom_centres_in;
22   for (mx=[0,1]) mirror([mx,0,0]) for (my=[0,1]) mirror([0,my,0]) {
23     difference(){
24       union(){
25         linextr(-0.1, pi_mount_z + pi_board_support_z, convexity=1)
26           rectfromto( pi_nom_sz/2 - 2 * [1,1] * pi_nom_centres_in,
27                       pi_sz/2 + [1,1] * pi_board_support_wall);
28         linextr(-0.1, pi_mount_z - pi_solder_side_gap, convexity=1)
29           translate(sxy)
30           square(center=true, pi_screw_hole_dia + pi_screw_hole_wall*2);
31       }
32       linextr(pi_mount_z, pi_mount_z + 5, convexity=1)
33         rectfromto(-[10,10], pi_sz/2);
34       translate( sxy )
35         linextr(-1, pi_mount_z + 10, convexity=1)
36         circle(r= pi_screw_hole_dia/2);
37     }
38   }
39 }