chiark / gitweb /
brompton-computer-guard: make chunkier
[reprap-play.git] / belt-cut-jig-common.scad
1 // -*- C -*-
2
3 jig_max_len = 160; // print diagonally
4 //jig_max_len = 30;
5
6 registrationgroove_width = 0.8;
7 registrationgroove_depth = 1.2;
8
9 registrationprotrusion_poke = 3;
10 registrationprotrusion_slope = 0.75;
11
12 jig_overlap = 1;
13
14 jig_ends_extra = 2;
15
16 jig_iters = floor((jig_max_len - jig_ends_extra) / jig_interval);
17 //jig_iters=2;
18 echo(jig_iters);
19
20 module RegistrationGroove(l){
21   // runs along the +ve X axis for length l but at correct z pos
22   translate([0, 0, jig_main_zsz + 0.1]) {
23     rotate([90,0,90])
24       linear_extrude(height=l)
25       polygon([[-registrationgroove_width/2, 0],
26                [ +registrationgroove_width/2, 0],
27                [ 0, -registrationgroove_depth ]]);
28   }
29 }
30
31 module OneJig(){
32   difference(){
33     translate([-(jig_interval/2 + jig_overlap),
34                jig_min_y,
35                -strap_thick])
36       cube([jig_interval + 2,
37             jig_max_y - jig_min_y,
38             jig_main_zsz + strap_thick]);
39     OneJigCutout();
40     translate([-100, -strap_width/2, -10])
41       cube([200, strap_width, 10]);
42    translate([-100,0,0])
43      RegistrationGroove(200);
44    for (xfrac=[-1/4,0,+1/4])
45      translate([jig_interval * xfrac, -100, 0])
46        rotate([0,0,90])
47        RegistrationGroove(200);
48   }
49 }
50
51 module RegistrationProtrusion(){
52   // points towards the positive x axis
53   xsz = registrationprotrusion_poke;
54   ysz = registrationprotrusion_poke;
55   diag_sz = xsz * sqrt(2);
56   zsz = diag_sz / registrationprotrusion_slope;
57   hull(){
58     translate([0, 0, 0.1]){
59       linear_extrude(height=0.1)
60         polygon([[   0, -ysz ],
61                  [ xsz,    0 ],
62                  [   0,  ysz ]]);
63       translate([-0.1, 0, zsz ])
64         rotate([0,0,45])
65         cube(0.1);
66     }
67   }
68 }
69
70 module Jig(){
71   for(end=[0,1]){
72     for(yfrac=[-1/2, 0, 1/2]){
73       translate([ end
74                   ? jig_interval * (jig_iters - 0.5)
75                   : -jig_interval/2,
76                  yfrac * strap_width,
77                  0])
78         rotate([0,0, end ? 0 : 180])
79         translate([ jig_overlap, 0, 0 ])
80         RegistrationProtrusion();
81     }
82   }
83   for (i=[0:jig_iters-1]) {
84     translate([jig_interval * i, 0, 0])
85       OneJig();
86   }
87 }
88
89 module JigPrint(){
90   rotate([0,0,-45])
91     translate([0,0,jig_main_zsz])
92     rotate([180,0,0])
93     Jig();
94 }
95