include <moebius-core.scad>
+// settings etc.
+
+pin_stemwidth = 1.5;
+pin_stemlen = 1.5;
+pin_headwidth = 3.0;
+pin_headheight = 1.0;
+pin_xslop = 0.25;
+
+pin_yadj_range = [ -0.5, +0.5 ];
+
+// computed
+
sliceat = moebiuscore_sliceat * moebiuscore_nomsize;
module MainBody(){
}
}
+module HalfPinHeadProfile(xslop, yadj, lenadj) {
+ sw = pin_stemwidth + xslop*2;
+ tw = pin_headwidth + xslop*2;
+ th = pin_headheight + lenadj - yadj;
+ hull(){
+ translate([ -tw/2,
+ pin_stemlen/2 + yadj + (pin_headwidth - pin_stemwidth)/2 ])
+ square([ tw, th ]);
+ translate([ -sw/2,
+ pin_stemlen/2 ])
+ square([ sw, th ]);
+ }
+}
+
+module PinStemProfile(xslop) {
+ square(center=true,
+ [ pin_stemwidth + xslop*2,
+ pin_stemlen + pin_headheight/2 ]);
+}
+
+module PinExtrudePortion(zi,zrange){
+ translate([0,0,zrange[zi]])
+ mirror([0,0,zi])
+ 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]]){
+ hull(){
+ for (zi=[0,1])
+ PinExtrudePortion(zi,zrange)
+ HalfPinHeadProfile(xslop[zi], yadj[zi], ml[1][zi]);
+ }
+ }
+ }
+ hull(){
+ for (zi=[0,1])
+ PinExtrudePortion(zi,zrange)
+ PinStemProfile(xslop[zi]);
+ }
+}
+
module PinDemo(){
for (i=[0,1]) {
hull(){
}
}
-MainBody();
-%PinDemo();
+//MainBody();
+//%PinDemo();
+PinExtrude([-2,10]);