-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPictureFrame.scad
143 lines (122 loc) · 3.06 KB
/
PictureFrame.scad
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// 8.5 x 11 paper holder
/* [Frame Dimensions] */
// Assembled or plated or individual parts?
part = 0; //[0:Preview, 1:Plate, 2:Center, 3:Left arm, 4:Right arm]
in = 25.4*1; // inch in mm, for conversions. *1 to hide in Customizer.
// Thickness of holder in mm
thick = 2;
// Paper width in inches or mm (use one)
widthInches = 8.5;
widthMM = 0;
// Paper height in inches or mm (use one)
heightInches = 11;
heightMM = 0;
// Paper thickness in inches or mm (use one)
thicknessInches = .123;
thicknessMM = 0;
// Arm width in inches or mm (use one)
armInches = .5;
armMM = 0;
band = armInches*in+armMM;
x=widthInches*in+widthMM;
y=heightInches*in+heightMM;
z=thicknessInches*in+thicknessMM;
r = x/y;
angle=atan(r);
xi = x-band/2;
yi=y-band/2;
xi=x;
yi=y;
diag = sqrt(xi*xi+yi*yi);
// Radius of center screw in mm
sr = 3;
// Gap for spacing between parts (tune for your printer)
gap=0.4;
spacing = 1.1*band;
module arm() {
intersection() {
rotate([0,0,angle]) cube([band,2*y,z+3*thick], center=true);
difference() {
cube([x+2*thick,y+2*thick,z+2*thick],center=true);
cube([x,y,z], center=true);
translate([0,0,z/2]) cube([x-2,y-2,z+thick], center=true);
translate([0,0,-(z/2+thick)-.1]) cylinder(r1=sr, r2=sr+thick, h=thick+.2);
}
}
}
module X () {
arm();
mirror([1,0,0]) arm();
}
module plug(r, h) {
//echo(r,h);
cylinder(r1=r, r2=r+h, h=h, center=true);
}
module centerCut() {
translate([0,0,-z/2-thick/2]) {
rotate([0,0,90-angle]) {
cube([2*band,band/3,thick+1], center=true);
translate([band,0,0]) plug(band/5,thick+1);
translate([-band,0,0]) plug(band/5,thick+1);
}
rotate([0,0,90+angle]) {
cube([2*band,band/3,thick+1], center=true);
translate([band,0,0]) plug(band/5,thick+1);
translate([-band,0,0]) plug(band/5,thick+1);
}
plug(band/2,thick+1);
}
}
module centerHole() {
translate([0,0,-z/2-thick/2]) {
rotate([0,0,90-angle]) {
cube([2*band+2*gap,band/3+2*gap,thick+1], center=true);
translate([band,0,0]) plug(band/5+gap,thick+1);
translate([-band,0,0]) plug(band/5+gap,thick+1);
}
rotate([0,0,90+angle]) {
cube([2*band+2*gap,band/3+2*gap,thick+1], center=true);
translate([band,0,0]) plug(band/5+gap,thick+1);
translate([-band,0,0]) plug(band/5+gap,thick+1);
}
plug(band/2+gap,thick+1);
}
cube([x,gap,band], center=true);
cube([gap,y,band], center=true);;
}
module center() {
intersection () {
X();
centerCut();
}
}
module anArm() {
intersection() {
difference() {
X();
centerHole();
}
translate([0,0,-band/2]) cube([x,y,band]);
}
}
module plate() {
translate([-spacing/2,-band/2,0]) rotate([0,0,90]) center();
rotate([0,0,angle]) anArm();
translate([spacing,0,0]) rotate([0,0,angle]) anArm();
translate([-spacing,0,0]) mirror([1,0,0]) rotate([0,0,angle]) anArm();
translate([-2*spacing,0,0]) mirror([1,0,0]) rotate([0,0,angle]) anArm();
}
module preview() {
center();
difference() {
X();
centerHole();
}
}
translate([0,0,z/2+thick]) {
if (part==0) preview();
if (part==1) plate();
if (part==2) center();
if (part==3) anArm();
if (part==4) mirror([1,0,0]) anArm();
}