chiark / gitweb /
scaffold-clamp-cleat: sort out toplevels
[reprap-play.git] / itx-aperture-grommet.scad
1 // -*- C -*-
2
3 include <utils.scad>
4 include <threads.scad>
5
6 ap_width = 21.30;
7 ap_height = 16.45;
8 tot_height = 22.74 + 1.0;
9 screw_ctr_to_tr = [ 7.89, 3.87 ];
10
11 tab_th = 2.5;
12 wall_th = 1;
13 wall_h = 2;
14
15 app_slop = 0.60; // total across both sides
16
17 // calculated
18
19 tab_h = tot_height - ap_height;
20
21 real_main_sz = [ ap_width, ap_height ] - app_slop * [ 1,1 ];
22 real_all_sz = real_main_sz + tab_h * [0,1];
23 real_inner_sz = real_main_sz - wall_th * [ 2,1 ];
24
25 screw_pos = real_all_sz - (screw_ctr_to_tr - 0.5 * app_slop * [1,1]);
26
27 module GapPlan() {
28   rectfromto([ wall_th, -1 ],
29              real_main_sz - wall_th * [1,1]);
30 }
31
32 module MainPlan() {
33   rectfromto([0,0],
34              real_main_sz);
35 }
36
37 module AllPlan() {
38   rectfromto([0,0], real_all_sz);
39 }
40
41 module Grommet(){ ////toplevel
42   difference(){
43     union(){
44       linextr(0, tab_th + wall_h) MainPlan();
45       linextr(0, tab_th) AllPlan();
46     }
47     linextr(-1, tab_th + wall_h + 1) GapPlan();
48     translate(concat(screw_pos, [-1]))
49       english_thread(diameter = 0.1380,
50                      threads_per_inch = 32,
51                      length = tab_th + 2,
52                      internal = true);
53   }
54 }
55
56 Grommet();