-
Notifications
You must be signed in to change notification settings - Fork 0
/
BacklashTester3.scad
52 lines (44 loc) · 1.2 KB
/
BacklashTester3.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
pad = 0.05; // Padding to maintain manifold
baset=0.5;
wallh=2.5;
walll=15;
wallt=0.7;
margin=1;
basex=walll+margin*2;
basey=20;
module refwall(h=2,l=5,t=0.7) {
linear_extrude(h)
polygon([[0,0],[l,0],[l,t],[0,t]]);
}
module testwall(h=2,l=5,t=0.7) {
x1=0; // origin
x2=x1+l; // far end
x3=x2-l/4; // quarter way back
x4=x3-l/4; // half back
x5=x4-l/4; // three quarters back
y1=0; // origin
y2=y1+t; // wall thickness
y3=y2+t*1.5; // extra for the "bump"
linear_extrude(h)
polygon([[x1,y1],[x2,y1],[x2,y2],[x3,y2],[x4,y3],[x5,y2],[x1,y2]]);
}
// base
color("paleGreen")
linear_extrude(baset)
polygon([[0,0],[basex,0],[basex,basey],[0,basey]],convexity=2);
// Test walls
color("lightPink",1)
for (n=[0:1]) {
offset= n==1 ? 12 + wallt*2 : basey - wallt*2 - 12;
translate([margin,offset,baset-pad])
scale([1,pow(-1,n),1])
testwall(h=wallh,l=walll,h=wallh);
}
// Reference walls
color("thistle")
for (n=[0:1]) {
translate([margin,n*(basey-wallt),baset-pad])
refwall(h=wallh,l=walll,t=wallt);
}
// Origin marker
cube([margin+pad,margin,baset+wallh-pad]);