[WIP] pressfit_headband.scad

This commit is contained in:
djerun 2024-11-21 21:21:55 +01:00
parent 4e965fb242
commit b393f5ebbc

View file

@ -2,22 +2,41 @@ include <globals.scad>
use <headband.scad> use <headband.scad>
RENDER_PLA = true;
RENDER_PETG = true;
module inserticle() { 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) { 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() { union() {
color("pink") { $a=48; rotate(i*a, [0, 0, 1]) {
rotate( $a, [0, 0, 1]) { translate([-size-3, 0, 0]) anchored_inserticle();
translate([-size-4, 0,]) rotate(90, [0, 1, 0]) inserticle(); // translate([-size-4, 0,]) rotate(90, [0, 1, 0]) inserticle();
translate([-size-3, 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);
rotate(-$a, [0, 0, 1]) { // translate([0, 0, INSERTICLE_Z/2+0.5])
translate([-size-4, 0,]) rotate(90, [0, 1, 0]) inserticle(); // cube([INSERTICLE_X/2, INSERTICLE_Y+2, 1], center=true);
translate([-size-3, 0,]) rotate(90, [0, 1, 0]) inserticle(); // }
} }
} }
}
}
}
module petg_parts(size, height, thickness, part, stretch_len, tip_len, tip_bend) {
headband( headband(
size=size, size=size,
height=height, height=height,
@ -27,7 +46,25 @@ module pressfit_headband(debug=DEBUG, size=SIZE, height=HEIGHT, thickness=THICKN
tip_len=tip_len, tip_len=tip_len,
tip_bend=tip_bend 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(); pressfit_headband();