include ; use ; use ; use ; $fn=30; HEIGHT=18; EAR_SKEW=0.6; EAR_SCALE=1.4; EAR_BEND_FACTOR=0.04; EAR_STRETCH_FACTOR=1.2; EAR_ANGLE=42; WITH_RAKE=true; DETAILS=true; module catear_headband_esp(debug=DEBUG, size=SIZE, height=HEIGHT, thickness=THICKNESS, part=PART, stretch_len=STRETCH_LEN, tip_len=TIP_LEN, tip_bend=TIP_BEND, ear_scale=EAR_SCALE, ear_bend_factor=EAR_BEND_FACTOR, ear_stretch_factor=EAR_STRETCH_FACTOR, ear_angle=EAR_ANGLE, chamfer=CHAMFER, chamfer_shape=CHAMFER_SHAPE, with_rake=WITH_RAKE, details=DETAILS, $fn=$fn, ear_skew=EAR_SKEW) { $a=size/2*ear_scale; $delta=2*(acos($a/(size*2))-90); ear_offset=size*sin(90-$delta/2); union() { rotate( ear_angle, [0, 0, 1]) { translate([-ear_offset, 0, 0]) catear_v3( debug=debug, height=height, thickness=thickness, side_len=size/2*ear_scale, bend_factor=ear_bend_factor, stretch_factor=ear_stretch_factor, chamfer=chamfer, chamfer_shape=chamfer_shape, details=details, $fn=$fn, skew=ear_skew ); } scale([1, -1, 1]) rotate(ear_angle, [0, 0, 1]) { translate([-ear_offset, 0, 0]) catear_v3( debug=false, height=height, thickness=thickness, side_len=size/2*ear_scale, bend_factor=ear_bend_factor, stretch_factor=ear_stretch_factor, chamfer=chamfer, chamfer_shape=chamfer_shape, details=details, $fn=$fn, skew=ear_skew ); } headband( size=size, height=height, thickness=thickness, part=part, stretch_len=stretch_len, tip_len=tip_len, tip_bend=tip_bend, with_rake=with_rake, details=false, $fn=$fn ); }; } translate([0, 0, 6]) rotate(-90) difference() { translate([0, 0, HEIGHT/2-6]) catear_headband_esp(chamfer=0, with_rake=false); translate([-5, -5, 0]) cube([110, 110, HEIGHT]); rotate(90) translate([-5, -5, 0]) cube([110, 110, HEIGHT]); rotate(180) translate([-5, -5, 0]) cube([110, 110, HEIGHT]); translate([0, -60, HEIGHT/2]) rotate(35) cube([70, 70, HEIGHT], center=true); rotate(-90+180*PART, [0, 0, 1]) translate([0, -SIZE, HEIGHT-6]) color("orange") rotate([90, 0, 0]) cylinder(r=HEIGHT-6, h=2*THICKNESS, center=true); }