pin_stemlen = 1.5;
pin_headwidth = 3.0;
pin_headheight = 1.0;
-pin_xslop = 0.25;
+pin_slot_xslop = 0.25;
-pin_yadj_range = [ -0.5, +0.5 ];
+pin_yadj_range = [ -0.75, +0.5 ];
+pin_yslop = 0.25;
+
+pin_pin_xslop = 0.00;
+pin_pin_yadj_range = pin_yadj_range + [ 0.00, 0.00 ];
+
+pin_height = 5;
// computed
pin_stemlen/2 + yadj + (pin_headwidth - pin_stemwidth)/2 ])
square([ tw, th ]);
translate([ -sw/2,
- pin_stemlen/2 ])
+ pin_stemlen/2 + yadj ])
square([ sw, th ]);
}
}
-module PinStemProfile(xslop) {
+module PinStemProfile(xslop, yadj) {
+ sl = pin_stemlen + pin_headheight/2 + max(yadj * 2, 0);
square(center=true,
[ pin_stemwidth + xslop*2,
- pin_stemlen + pin_headheight/2 ]);
+ sl ]);
}
module PinExtrudePortion(zi,zrange){
linear_extrude(height=0.1)
children(0);
}
-
+
module PinExtrude(zrange,
- xslop=[0,0], yadj=[0,0], lenadj=[0,0], len1adj=[0,0]){
- for (ml= [[0, lenadj], [1, len1adj]]) {
- mirror([0,ml[0]]){
+ xslop=0,
+ yadjs=[[0,0], [0,0]], // [top[], bottom[]]
+ lenadjs=[0,0]){ // in each case: zrange[0],zrange[1]
+ for (topboti=[0,1]) {
+ mirror([0,topboti,0]){
hull(){
for (zi=[0,1])
PinExtrudePortion(zi,zrange)
- HalfPinHeadProfile(xslop[zi], yadj[zi], ml[1][zi]);
+ HalfPinHeadProfile(xslop, yadjs[topboti][zi], lenadjs[zi]);
}
}
}
hull(){
for (zi=[0,1])
PinExtrudePortion(zi,zrange)
- PinStemProfile(xslop[zi]);
+ PinStemProfile(xslop, max(yadjs[zi][0], yadjs[zi][1]));
}
}
+module PinCutout(){
+ PinExtrude([-10,10],
+ xslop= pin_slot_xslop,
+ yadjs = [ [0,0],
+ [1,1] * -pin_stemlen/2 ],
+ // bigger gap in -ve y direction
+ lenadjs = [1,1] * (pin_yslop + pin_yadj_range[1]) );
+}
+
+module Pin(){
+ PinExtrude([-0.5, 0.5] * pin_height,
+ xslop = pin_pin_xslop,
+ yadjs = [pin_pin_yadj_range, pin_pin_yadj_range],
+ lenadjs = [1,1] * pin_yadj_range[1]
+ );
+}
+
module PinDemo(){
for (i=[0,1]) {
hull(){
//MainBody();
//%PinDemo();
-PinExtrude([-2,10]);
+//PinExtrude([-2,10]);
+//PinCutout();
+Pin();
+%PinCutout();