Case and new encoders

This commit is contained in:
William Toohey
2016-11-12 01:36:04 +10:00
parent 35f8c52169
commit 5d59d75172
7 changed files with 4401 additions and 0 deletions
+932
View File
@@ -0,0 +1,932 @@
0
SECTION
2
HEADER
9
$ACADVER
1
AC1014
9
$HANDSEED
5
FFFF
9
$MEASUREMENT
70
1
0
ENDSEC
0
SECTION
2
TABLES
0
TABLE
2
VPORT
5
8
330
0
100
AcDbSymbolTable
70
4
0
VPORT
5
2E
330
8
100
AcDbSymbolTableRecord
100
AcDbViewportTableRecord
2
*ACTIVE
70
0
10
0.0
20
0.0
11
1.0
21
1.0
12
210.0
22
148.5
13
0.0
23
0.0
14
10.0
24
10.0
15
10.0
25
10.0
16
0.0
26
0.0
36
1.0
17
0.0
27
0.0
37
0.0
40
341.0
41
1.24
42
50.0
43
0.0
44
0.0
50
0.0
51
0.0
71
0
72
100
73
1
74
3
75
0
76
0
77
0
78
0
0
ENDTAB
0
TABLE
2
LTYPE
5
5
330
0
100
AcDbSymbolTable
70
1
0
LTYPE
5
14
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BYBLOCK
70
0
3
72
65
73
0
40
0.0
0
LTYPE
5
15
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BYLAYER
70
0
3
72
65
73
0
40
0.0
0
LTYPE
5
16
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
CONTINUOUS
70
0
3
Solid line
72
65
73
0
40
0.0
0
ENDTAB
0
TABLE
2
LAYER
5
2
100
AcDbSymbolTable
70
2
0
LAYER
5
50
100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
2
0
70
0
6
CONTINUOUS
0
LAYER
5
51
100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
2
KeepOutLayer
70
0
6
CONTINUOUS
0
ENDTAB
0
TABLE
2
STYLE
5
3
330
0
100
AcDbSymbolTable
70
1
0
STYLE
5
11
330
3
100
AcDbSymbolTableRecord
100
AcDbTextStyleTableRecord
2
STANDARD
70
0
40
0.0
41
1.0
50
0.0
71
0
42
2.5
3
txt
4
0
ENDTAB
0
TABLE
2
VIEW
5
6
330
0
100
AcDbSymbolTable
70
0
0
ENDTAB
0
TABLE
2
UCS
5
7
330
0
100
AcDbSymbolTable
70
0
0
ENDTAB
0
TABLE
2
APPID
5
9
330
0
100
AcDbSymbolTable
70
2
0
APPID
5
12
330
9
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
2
ACAD
70
0
0
ENDTAB
0
TABLE
2
DIMSTYLE
5
A
330
0
100
AcDbSymbolTable
70
1
0
DIMSTYLE
105
27
330
A
100
AcDbSymbolTableRecord
100
AcDbDimStyleTableRecord
2
ISO-25
70
0
3
4
5
6
7
40
1.0
41
2.5
42
0.625
43
3.75
44
1.25
45
0.0
46
0.0
47
0.0
48
0.0
140
2.5
141
2.5
142
0.0
143
0.03937007874016
144
1.0
145
0.0
146
1.0
147
0.625
71
0
72
0
73
0
74
0
75
0
76
0
77
1
78
8
170
0
171
3
172
1
173
0
174
0
175
0
176
0
177
0
178
0
270
2
271
2
272
2
273
2
274
3
340
11
275
0
280
0
281
0
282
0
283
0
284
8
285
0
286
0
287
3
288
0
0
ENDTAB
0
TABLE
2
BLOCK_RECORD
5
1
330
0
100
AcDbSymbolTable
70
1
0
BLOCK_RECORD
5
1F
330
1
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
2
*MODEL_SPACE
0
BLOCK_RECORD
5
1B
330
1
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
2
*PAPER_SPACE
0
ENDTAB
0
ENDSEC
0
SECTION
2
BLOCKS
0
BLOCK
5
20
330
1F
100
AcDbEntity
8
0
100
AcDbBlockBegin
2
*MODEL_SPACE
70
0
10
0.0
20
0.0
30
0.0
3
*MODEL_SPACE
1
0
ENDBLK
5
21
330
1F
100
AcDbEntity
8
0
100
AcDbBlockEnd
0
BLOCK
5
1C
330
1B
100
AcDbEntity
67
1
8
0
100
AcDbBlockBegin
2
*PAPER_SPACE
1
0
ENDBLK
5
1D
330
1B
100
AcDbEntity
67
1
8
0
100
AcDbBlockEnd
0
ENDSEC
0
SECTION
2
ENTITIES
0
LWPOLYLINE
5
100
100
AcDbEntity
8
KeepOutLayer
62
7
100
AcDbPolyline
90
1
70
1
10
-21.285892
20
10.161720
30
0.0
0
LWPOLYLINE
5
101
100
AcDbEntity
8
KeepOutLayer
62
7
100
AcDbPolyline
90
40
70
1
10
-74.993791
20
-51.498288
30
0.0
10
-40.000290
20
-86.485280
30
0.0
10
-0.000292
20
-86.485280
30
0.0
10
39.999708
20
-86.485280
30
0.0
10
74.993206
20
-51.498288
30
0.0
10
74.999133
20
2.932562
30
0.0
10
74.976014
20
3.653469
30
0.0
10
74.880969
20
4.356077
30
0.0
10
74.717527
20
5.036617
30
0.0
10
74.489218
20
5.691325
30
0.0
10
74.199572
20
6.316432
30
0.0
10
73.852119
20
6.908173
30
0.0
10
73.450388
20
7.462780
30
0.0
10
72.997909
20
7.976486
30
0.0
10
72.498211
20
8.445526
30
0.0
10
71.954826
20
8.866132
30
0.0
10
71.371281
20
9.234537
30
0.0
10
70.751107
20
9.546975
30
0.0
10
70.097834
20
9.799679
30
0.0
10
69.414991
20
9.988883
30
0.0
10
68.706108
20
10.110818
30
0.0
10
67.974715
20
10.161720
30
0.0
10
-0.000286
20
10.161720
30
0.0
10
-67.975292
20
10.161720
30
0.0
10
-68.706685
20
10.110818
30
0.0
10
-69.415568
20
9.988883
30
0.0
10
-70.098411
20
9.799679
30
0.0
10
-70.751684
20
9.546975
30
0.0
10
-71.371858
20
9.234537
30
0.0
10
-71.955403
20
8.866132
30
0.0
10
-72.498788
20
8.445526
30
0.0
10
-72.998486
20
7.976486
30
0.0
10
-73.450965
20
7.462780
30
0.0
10
-73.852696
20
6.908173
30
0.0
10
-74.200150
20
6.316432
30
0.0
10
-74.489796
20
5.691325
30
0.0
10
-74.718105
20
5.036617
30
0.0
10
-74.881547
20
4.356077
30
0.0
10
-74.976593
20
3.653469
30
0.0
10
-74.999712
20
2.932562
30
0.0
0
ENDSEC
0
SECTION
2
OBJECTS
0
DICTIONARY
5
C
330
0
100
AcDbDictionary
3
ACAD_GROUP
350
D
3
ACAD_MLINESTYLE
350
17
0
DICTIONARY
5
D
330
C
100
AcDbDictionary
0
DICTIONARY
5
1A
330
C
100
AcDbDictionary
0
DICTIONARY
5
17
330
C
100
AcDbDictionary
3
STANDARD
350
18
0
DICTIONARY
5
19
330
C
100
AcDbDictionary
0
ENDSEC
0
EOF
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+252
View File
@@ -0,0 +1,252 @@
$fn = 64;
switches = [[0,0],
[-42.862,-37.592],
[ 42.862,-37.592],
[-14.287,-37.592],
[ 14.287,-37.592],
[-28.5,-75.692],
[ 28.5,-75.692]];
bolts = [[-47.9, 8.05],
[ 47.9, 8.05],
[-72, -16.9],
[ 72, -16.9],
[-72, -49.9],
[ 72, -49.9],
[-45, -75.387],
[ 45, -75.387]];
// Not the encoders themselves, but the circle that surrounds them
encoders = [[-64,0.4],
[ 64,0.4]];
encoderRadius = 14.278;
// x, y, hole size
encoderHoles = [[71.4, 0.4, 3.2],
[69, -10.1, 1.6]];
usbWidth = 9;
usbPos = [-21.311, 10.16];
// bottom to top
plate_thickness = [3, 3, 1.6, 3, 1.6];
fudge = 0.2;
// So you get a little clear acrylic edge and it looks nice
wallOverlap = 1;
boltDiam = 3;
boltFudge = fudge;
boltSize = boltDiam + boltFudge;
boltExpand = boltDiam/2;
// bolt + half on either side
wallStrength = boltDiam * 2;
// 0 = full spec, 1 = half spec, 2 = plain square
holetype = 0;
module switch(holetype){
//Hole size, from Cherry MX data sheet
holesize=14;
//height of switch clasp cutouts
cutoutheight = 3;
//width of switch clasp cutouts
cutoutwidth = 1;
translate([-holesize/2, -holesize/2])
if (holetype == 0){
union(){
square([holesize,holesize]);
translate([-cutoutwidth,1])
square([holesize+2*cutoutwidth,cutoutheight]);
translate([-cutoutwidth,holesize-1-cutoutheight])
square([holesize+2*cutoutwidth,cutoutheight]);
}
} else if (holetype == 1){
union(){
square([holesize,holesize]);
translate([-cutoutwidth,1])
square([holesize+2*cutoutwidth,holesize-2]);
}
} else {
square([holesize,holesize]);
}
}
module switches() {
for(sw = switches) {
translate([sw[0], sw[1]])
switch(holetype);
}
}
module bolts() {
for(bolt = bolts) {
translate([bolt[0], bolt[1]])
circle(d = boltSize, center = true);
}
}
module bolts_expansion() {
offset(r = boltExpand)
bolts();
}
module encoders() {
for(enc = encoders) {
translate([enc[0], enc[1]])
circle(r=encoderRadius, center = true);
}
}
module encoderHoles() {
encoderHoles_half();
mirror([1,0,0])
encoderHoles_half();
}
module encoderHoles_half() {
for(enc = encoderHoles) {
translate([enc[0], enc[1]])
circle(d=enc[2], center = true);
}
}
// don't do the same thing twice
module usb_half() {
w = usbWidth / 2;
h = wallStrength + fudge;
curveWidth = h / 2;
// USB connector origin is at board edge
translate([0, -h, 0]) {
square([w, h]);
translate([w, curveWidth, 0])
difference() {
square(curveWidth);
translate([curveWidth, 0, 0])
circle(r=curveWidth);
}
}
}
module usb() {
usb_half();
mirror()
usb_half();
}
module board() {
import("BOARD_SHAPE.dxf");
}
module board_encoderhole() {
difference() {
board();
encoders();
}
}
module top_plate() {
difference() {
offset(delta = -wallOverlap)
difference() {
board();
encoders();
}
switches();
bolts();
}
}
module top_ring() {
difference() {
union() {
difference() {
board_encoderhole();
offset(delta = -wallStrength)
board_encoderhole();
// Room for FX/START
switches();
};
bolts_expansion();
}
bolts();
}
import("RING_TOP_SUPPORTS.dxf");
}
module pcb() {
difference() {
board();
bolts();
}
}
module bottom_ring() {
difference() {
union() {
difference() {
board();
offset(delta = -wallStrength)
board();
};
bolts_expansion();
}
bolts();
encoderHoles();
translate([usbPos[0], usbPos[1], 0])
usb();
}
import("RING_BOT_SUPPORTS.dxf");
}
module bottom_plate() {
difference() {
board();
bolts();
}
}
// This is kinda disgusting
module full_stack() {
/*color([1, 1, 1, 0.2])
linear_extrude(plate_thickness[0])
bottom_plate();*/
translate([0, 0, plate_thickness[0]]) {
color([1, 1, 1, 0.2])
linear_extrude(plate_thickness[1])
bottom_ring();
translate([0, 0, plate_thickness[1]]) {
color([1,1,1, 1])
linear_extrude(plate_thickness[2])
pcb();
translate([0, 0, plate_thickness[2]]) {
color([1, 1, 1, 0.2])
linear_extrude(plate_thickness[3])
top_ring();
translate([0, 0, plate_thickness[3]]) {
color([0,0,0, 0.5])
linear_extrude(plate_thickness[4])
top_plate();
}
}
}
}
}
//board();
full_stack();
//linear_extrude(plate_thickness[0])
// bottom_plate();
//linear_extrude(plate_thickness[1])
// bottom_ring();
//linear_extrude(plate_thickness[3])
// top_ring();
//linear_extrude(plate_thickness[4])
// top_plate();
+51
View File
@@ -0,0 +1,51 @@
Make visible only the layers you care for
File -> Save as -> DXF/DWG
Autocad 2007, DXF, Metric
Check "Export pads" "On dedicated hole layers"
Tracks "Export with rounded"
Primitives to export with zero line width "All"
Layers "Currently visible"
Open dxf in inkscape
>Manual scale
>Factor 1.0
x/y axis origin 0,0
Delete via layer
Select the pad which is the origin
Go to transform->move and see where it is in mm by unchecking Relative Move.
Select all objects and relative move -(pad position - pad size / 2) in mm
Do this for all layers
Select all and relative move -(pad stroke width / 2) IN PIXELS
Delete pad layer
For board shape:
Select the 2 curves, right click "Move to layer" keepout
Select all
Path->Combine
Go to node tool (below mouse, left toolbar)
Select all again
Click "Join selected nodes" in toolbar
Delete layer 0
For tracks:
Select all
Stroke style -> Width = the track width (use mm)
Cap: round
Path->Combine
Path->Stroke to path
Extensions->Modify Path->Flatten Beziers (flatness 0.1)
Save as -> Desktop cutting plotter dxf
Use LWPOLYLINE
Base unit mm
Visible layers only
Altium seems to like exporting for these offsets,
sometimes the decimals are different, check them.
-100.579
-112.896
Then do the 0.5px too
Binary file not shown.
Binary file not shown.