// -*- C -*- include // settings etc. pin_stemwidth = 1.5; pin_stemlen = 1.5; pin_headwidth = 3.0; pin_headheight = 1.0; pin_slot_xslop = 0.25; 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 sliceat = moebiuscore_sliceat * moebiuscore_nomsize; module MainBody(){ intersection(){ MoebiusCore(); translate([0,0, 200-sliceat]) cube(center=true, 400); } } 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 + yadj ]) square([ sw, th ]); } } module PinStemProfile(xslop, yadj) { sl = pin_stemlen + pin_headheight/2 + max(yadj * 2, 0); square(center=true, [ pin_stemwidth + xslop*2, sl ]); } 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, 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, yadjs[topboti][zi], lenadjs[zi]); } } } hull(){ for (zi=[0,1]) PinExtrudePortion(zi,zrange) 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 PlacePins(){ for (i=[0,1]) { translate( moebius_pin_locns[i] * moebiuscore_nomsize ) { multmatrix(moebius_pin_matrix[i]) children(0); } } } module PinDemo(){ PlacePins() cube([1,4,9]); } MainBody(); %PinDemo(); //PinExtrude([-2,10]); //PinCutout(); //Pin(); //%PinCutout();