/* * Alik's adjustable frame fan mount for RepRap. * * License: BSD. */ module round_square(width, length, height, round_radius) { hull() { for (i = [0, 1]) { for (j = [0, 1]) { translate([round_radius + i * (width - 2 * round_radius), round_radius +j * (length - 2 * round_radius), 0]) cylinder(r=round_radius, h = height); } } } } module round_gap(length, radius, height) { hull() { cylinder(r=radius, h = height); translate([length, 0, 0]) cylinder(r=radius, h = height); } } module nut_trap_form(nut_radius, height) { cylinder(r = nut_radius + 0.1, height, $fn=6); } module part_fan_holder_mount(screw_hole_diam, total_width, height, thickness, frame_height, screw_head_radius) { width = total_width * 0.5; base_width = width / 2; difference() { union() { rotate([90, 0, 0]) linear_extrude(height = thickness) polygon([[0, 0], [base_width, height], [base_width + width, height], [base_width * 2 + width, 0]]); } translate([total_width / 2, -thickness - 1, height - screw_head_radius]) rotate([-90, 0, 0]) cylinder(r = screw_hole_diam / 2, h = thickness + 2); } } module fan_holder(fan_size, hole_diam, nut_size, height) { nut_radius = nut_size /cos(180 / 6) / 2; nut_trap_radius = nut_radius * 1.2; nut_trap_height = 2; // mm min_frame_thickness = 3; // mm screw_head_radius = nut_trap_radius; holder_total_width = fan_size * 0.4; holder_height = screw_head_radius * 2 + height + 1; holder_thickness = min_frame_thickness + 1; round_radius = fan_size / 10; difference() { union() { // Frame difference() { // Fan frame holder union() { round_square(fan_size, fan_size, height, round_radius); // Holder translate([fan_size / 2 - holder_total_width / 2, min_frame_thickness - 0.1, 0]) part_fan_holder_mount(hole_diam, holder_total_width, holder_height, holder_thickness, height, screw_head_radius); } // Fan hole translate([fan_size / 2, fan_size / 2, -1]) cylinder(r=fan_size / 2 - min_frame_thickness, height + 2); } // Nut traps for (i = [0, 1]) { for (j = [0, 1]) { translate([fan_size / 10 + i * (fan_size - 2 * (fan_size / 10)), fan_size / 10 +j * (fan_size - 2 * (fan_size / 10)), 0]) { difference() { cylinder(r=nut_radius + 1, h = height + nut_trap_height); translate([0, 0, height]) nut_trap_form(nut_radius, nut_trap_height + 1); } } } } } // Holes for (i = [0, 1]) { for (j = [0, 1]) { translate([fan_size / 10 + i * (fan_size - 2 * (fan_size / 10)), fan_size / 10 + j * (fan_size - 2 * (fan_size / 10)), -1]) cylinder(r = hole_diam / 2, h = height + 2 ); } } } } module fan_arm(width, length, thickness, mount_screw_diameter, fan_screw_diameter, fan_nut_size) { inner_gap_radius = mount_screw_diameter / 2; inner_gap_length = length - (width - inner_gap_radius) - thickness; fan_nut_radius = fan_nut_size /cos(180 / 6) / 2; fan_nut_trap_radius = fan_nut_radius * 1.2; holder_height = fan_nut_trap_radius * 2; union() { // Arm difference() { round_square(width, length, thickness, width * 0.1); translate([width / 2, (length - inner_gap_length - thickness) / 2, -1]) rotate([0, 0, 90]) round_gap(inner_gap_length, inner_gap_radius, thickness + 2); } // Holder translate([0, length, thickness - 0.01]) part_fan_holder_mount(fan_screw_diameter, width, holder_height, thickness, thickness, fan_nut_trap_radius); translate([0, length - thickness, 0]) cube([width, thickness, thickness]); } } module frame_clamp(width, length, rod_diameter, hole_diam, nut_size) { thickness = 3; nut_radius = nut_size /cos(180 / 6) / 2; nut_trap_radius = nut_radius * 1.2; clamps_x = -nut_trap_radius * 2 - rod_diameter / 2; gap_size = rod_diameter * 0.8; nut_trap_height = (rod_diameter - gap_size) / 2; // mm g = gap_size / 2; r = rod_diameter / 2; angle = asin(g / r); h = r - (g / tan(angle)); difference() { union() { difference() { // Cylinder cylinder(r = rod_diameter / 2 + thickness, width); // Rod hole translate([0, 0, -1]) cylinder(r = rod_diameter / 2, width + 2); // Gap translate([-rod_diameter / 2 - thickness, -gap_size / 2, -1]) cube([thickness * 2, gap_size, width + 2]); } // Clamps for (i = [gap_size / 2, -gap_size / 2 - thickness]) { translate([clamps_x, i, width / 2 - (width) / 2]) cube([nut_trap_radius *2 + h, thickness, width]); } } // Screw hole translate([-rod_diameter / 2 - nut_trap_radius, rod_diameter / 2 + thickness, width / 2]) rotate([90, 0, 0]) cylinder(r = hole_diam / 2, h = rod_diameter + thickness * 2); } // Nut traps translate([-rod_diameter / 2 - nut_trap_radius, -gap_size / 2 - thickness, width / 2]) rotate([90, 0, 0]) difference() { union() { cylinder(r = nut_trap_radius, h = nut_trap_height); translate([0, -nut_trap_radius, 0]) cube([nut_trap_radius * 2, nut_trap_radius * 2, nut_trap_height]); } translate([0, 0, -1]) nut_trap_form(nut_radius, nut_trap_height + 2); } } module frame_holder(width, length, thickness, hole_diam, nut_size, clamp_width, clamp_length, rod_diameter, clamp_hole_diam, clamp_nut_size) { nut_radius = nut_size /cos(180 / 6) / 2; nut_trap_radius = nut_radius * 1.2; nut_trap_height = 3; // mm union() { difference() { cube([width, length, thickness]); translate([width / 2, length - nut_trap_radius, -1]) cylinder(r = hole_diam / 2, h = thickness + 2); } // Nut trap difference() { translate([width / 2, length - nut_trap_radius, thickness]) cylinder(r = nut_trap_radius, h = nut_trap_height); translate([width / 2, length - nut_trap_radius, thickness - 1]) nut_trap_form(nut_radius, nut_trap_height + 2); } // Clamps for (i = [0, width - clamp_width]) { translate([i, rod_diameter / 2 + 3, thickness + rod_diameter / 2 + 0.5]) rotate([0, 90, 0]) frame_clamp(clamp_width, clamp_length, rod_diameter, clamp_hole_diam, clamp_nut_size); } } } $fn = 100; /* * Part 1: Fan holder. */ fan_size = 50; // 50x50 mm fan_screw_hole_diameter = 3.5; // M3 screw fan_nut_size = 5.5; // M3 nut fan_mount_thickness = 3; fan_holder(fan_size, fan_screw_hole_diameter, fan_nut_size, fan_mount_thickness); /* * Part 2: Fan arm. */ arm_width = 15; arm_length = 50; arm_thickness = 5; arm_frame_screw_diameter = 4.5; // M4 arm_fan_screw_diameter = fan_screw_hole_diameter; arm_fan_nut_size = fan_nut_size; translate([fan_size / 2 - arm_width / 2, -arm_length - 5, 0]) fan_arm(arm_width, arm_length, arm_thickness, arm_frame_screw_diameter, arm_fan_screw_diameter, arm_fan_nut_size); /* * Part 3: Frame moun. */ threaded_rod_diameter = 8 + 0.2; mount_clamp_width = 15; mount_clamp_length = threaded_rod_diameter + 2 * 3; mount_clamp_hole_diam = 3.5; // M3 mount_clamp_nut_size = 5.5; // M3 mount_width = mount_clamp_width * 3; mount_length = mount_clamp_length + arm_frame_screw_diameter * 2; mount_thickness = 5; mount_nut_size = 7; // M4 translate([fan_size / 2 - mount_width / 2, -mount_length - arm_length - 10, 0]) frame_holder(mount_width, mount_length, mount_thickness, arm_frame_screw_diameter, mount_nut_size, mount_clamp_width, mount_clamp_length, threaded_rod_diameter, mount_clamp_hole_diam, mount_clamp_nut_size);