diff --git a/pressfit_headband.scad b/pressfit_headband.scad index 93cc684..2d0fe17 100644 --- a/pressfit_headband.scad +++ b/pressfit_headband.scad @@ -2,32 +2,69 @@ include use +RENDER_PLA = true; +RENDER_PETG = true; + module inserticle() { - cube([INSERTICLE_X, INSERTICLE_Y, INSERTICLE_Z], center=true); + cube([INSERTICLE_X, INSERTICLE_Y, INSERTICLE_Z], center=true); } -module pressfit_headband(debug=DEBUG, size=SIZE, height=HEIGHT, thickness=THICKNESS, part=PART, stretch_len=STRETCH_LEN, tip_len=TIP_LEN, tip_bend=TIP_BEND) { - union() { - color("pink") { $a=48; - rotate( $a, [0, 0, 1]) { - translate([-size-4, 0,]) rotate(90, [0, 1, 0]) inserticle(); - translate([-size-3, 0,]) rotate(90, [0, 1, 0]) inserticle(); - } - rotate(-$a, [0, 0, 1]) { - translate([-size-4, 0,]) rotate(90, [0, 1, 0]) inserticle(); - translate([-size-3, 0,]) rotate(90, [0, 1, 0]) inserticle(); - } +module anchored_inserticle() { + translate([-1, 0, 0]) rotate(90, [0, 1, 0]) inserticle(); + rotate(90, [0, 1, 0]) { + cube([INSERTICLE_X-2*CHAMFER, INSERTICLE_Y, INSERTICLE_Z], center=true); + translate([0, 0, INSERTICLE_Z/2+0.5]) + cube([INSERTICLE_X/2, INSERTICLE_Y+2, 1], center=true); + } +} + +module pla_parts(size, a) { + color("pink") { + for (i=[-1, 1]) { + union() { + rotate(i*a, [0, 0, 1]) { + translate([-size-3, 0, 0]) anchored_inserticle(); +// translate([-size-4, 0,]) rotate(90, [0, 1, 0]) inserticle(); +// translate([-size-3, 0,]) rotate(90, [0, 1, 0]) { +// cube([INSERTICLE_X-2*CHAMFER, INSERTICLE_Y, INSERTICLE_Z], center=true); +// translate([0, 0, INSERTICLE_Z/2+0.5]) +// cube([INSERTICLE_X/2, INSERTICLE_Y+2, 1], center=true); +// } } - headband( - size=size, - height=height, - thickness=thickness, - part=part, - stretch_len=stretch_len, - tip_len=tip_len, - tip_bend=tip_bend - ); - }; + } + } + } +} + +module petg_parts(size, height, thickness, part, stretch_len, tip_len, tip_bend) { + headband( + size=size, + height=height, + thickness=thickness, + part=part, + stretch_len=stretch_len, + tip_len=tip_len, + tip_bend=tip_bend + ); +} + +module pressfit_headband(debug=DEBUG, size=SIZE, height=HEIGHT, thickness=THICKNESS, part=PART, stretch_len=STRETCH_LEN, tip_len=TIP_LEN, tip_bend=TIP_BEND, a=48) { + if (RENDER_PLA && RENDER_PETG) { + union() { + petg_parts(size, height, thickness, part, stretch_len, tip_len, tip_bend); + pla_parts(size, a); + } + } else { + if (RENDER_PETG) { + difference() { + petg_parts(size, height, thickness, part, stretch_len, tip_len, tip_bend); + pla_parts(size, a); + } + } + if (RENDER_PLA) { + pla_parts(size, a); + } + } } pressfit_headband();