-
Notifications
You must be signed in to change notification settings - Fork 1
/
fomu_jig.jscad
122 lines (112 loc) · 5.12 KB
/
fomu_jig.jscad
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// title : FOMU Jig
// author : Udi Finkelstein
// license : MIT License
// revision : 0.1
// This is a test Jig to hold 1mm pogo pins for programming a Fomu board
// You can prepare the pins in advance, solder all the wires, then insert them on the slots.
// Once pins are in, insert the sleeve so that the triangle is on the sleeve open side,
// And the pogo pins are held in place by the sleeve.
//
// You can now put the Fomu board on top
let r=(1 + 0.10)/2; // pogo pin radius plus some FDM process slack
let z=8; // height of main jig box
let base=2; // sleeve base thickness
let bumps = 5; // height of tirngle and semicircle locating the board
let z_bumps=z+bumps; // total height
let mx=2; // extra margin on each side for sleeve
let my=2; // extra margin on one side for sleeve
let x=10+2*mx; // board width plus extra margins
let y=13; // board depth plus extra margin
let extra_x=0.2; // extra X clearance for FDM process margins
let extra_y=0; // extra Y clearance for FDM process margins
let extra_z=0.2; // extra Z clearance for FDM process margins
let sleeve_z = base+z+bumps+extra_z;
let handle_y = 5;
let handle_x_extra = 5;
let corner=3;
let x_distance=1; // X hole row distance from the edge
let y_distance = 1.25; // Y hole row distance from the edge
let pins = false; // change this to see how pins would appear in the holes
let for_print = true; // change to false to see how the 2 modules interlock
let board_z = 3; // depth of board cavity
function getParameterDefinitions() {
return [
{ name: 'pins', type: 'checkbox', checked:false, initial: false, caption: 'Show pogo pins instead of holes?' },
{ name: 'for_print', type: 'checkbox', checked:true, initial: true, caption: 'Show parts for print (if false, show how they connect)' },
];
}
function block () {
return cube({size: [x, y, z], center: false});
}
function block_with_pins () {
var pins_obj = union(
y_slot(8.7),
y_slot(5.25),
y_slot(3.50),
y_slot(1.65),
x_slot(3.30),
x_slot(5.30),
x_slot(8.20)
)
return mirror([0, 1, 0],
params.pins ? union (block(), pins_obj)
: difference(block(), pins_obj)
);
}
function jig () {
return union(
block_with_pins(),
// handle
cube({size: [x+2*handle_x_extra, handle_y, z], center: false}).translate([-handle_x_extra, -(y+handle_y), 0]),
// half circle notch in board
cylinder({r:1.5/2, h:z_bumps, center:false}).translate([mx, -11, 0]),
// cube holding semi circle
cube({size:[mx, y-8.20-r, z_bumps], center:[false, false, false]}).translate([0, -y, 0]),
// corner triangle
linear_extrude({height:bumps}, mirror([0, 1, 0], polygon([[x-mx,y], [x-mx-corner,y], [x-mx, y-corner]])))
.translate([0, 0, z]),
// cube holding triangle
cube({size:[mx, y-8.20-r, z_bumps], center:[false, false, false]}).translate([x-mx, -y, 0])
);
}
function sleeve () {
return difference(
// Outer cube
cube({size: [x+2*mx, y+my, sleeve_z], center: false}),
// Subtract inner space from top to bottom
cube({size: [x-2*mx+extra_x/2-(x_distance-r), y-(my-extra_y)-(y_distance-r), sleeve_z], center: false}).translate([2*mx+(x_distance-r), 0, 0]),
// Subtract board cavity
cube({size: [x-2*mx+extra_x/2, y-(my-extra_y)-(y_distance-r), board_z], center: false}).translate([2*mx, 0, sleeve_z-board_z]),
// Subtract wider slot that holds the pins in place
cube({size: [x+extra_x, y+extra_y, (z+extra_z)], center: false}).translate([mx-extra_x/2, 0, base]),
// subtract diagonal1
linear_extrude({height:sleeve_z-base}, polygon([[mx,mx], [mx,0], [0, 0]])).translate([0, 0, base]),
// subtract diagonal2
linear_extrude({height:sleeve_z-base}, polygon([[x+2*mx,0], [x+mx,mx], [x+mx, 0]])).translate([0, 0, base]),
// Subtract outer cut for PCB fixture pins
cube({size: [x+extra_x, y-8.20-my-r, sleeve_z], center: false}).translate([mx-extra_x/2, 0, base+z])
)
.union(cube({size: [x+2*handle_x_extra, handle_y, sleeve_z], center: false}).translate([mx-handle_x_extra, y+my, 0]))
.translate([-mx, 0, 0]);
}
function y_slot (dx, dy=y_distance) {
return union(
cylinder({r:r, h:3*z, center: false}).translate([dx+mx, dy, -z]),
cube({size:[2*r, dy ,z], center:[true, false, false]}).translate([dx+mx, 0, 0])
);
}
function x_slot (dy=2, dx=x_distance) {
return union(
cylinder({r:r, h:3*z, center: false}).translate([dx+mx, dy, -z]),
cube({size:[dx+mx, 2*r, z], center:[false, true, false]}).translate([0, dy, 0])
);
}
function main() {
var sleeve2 = sleeve().translate([0, -y, -base]);
sleeve2 = params.for_print ? sleeve2.rotateX(-90).translate([0, -20-y, 2*my+handle_y-base]) : sleeve2.translate([0, 0, -base]);
return union(
jig(), sleeve2 //.rotateZ(180).translate([15, -15, z-base])
// sleeve().translate([0, 0, -z]).translate([0, -20, z-base])
// sleeve().translate([0, 0, -z]).rotateX(90).translate([0, -30, y+my])
);
}