include <../config/strong_angler.scad> function strong_angler_size() = [ ( strong_angler_target_screws_margin * strong_angler_target_screws_count.x + strong_angler_target_screws_margin ), ( strong_angler_target_screws_margin * strong_angler_target_screws_count.y + strong_angler_target_screws_margin ), strong_angler_height ]; module strong_angler_target_cutoff(oversized = false) { diameter = strong_angler_target_screw_diameter; padding = strong_angler_target_screw_padding; margin = strong_angler_target_screws_margin; width = strong_angler_size().x; height = strong_angler_size().y; move_x = width / 2 - margin; move_y = height / 2 - margin; module hole(vector_x = 0, vector_y = 0) { translate([vector_x, vector_y]) { if (oversized) { circle(d = diameter + padding * 2); } else { circle(d = diameter); } } } for (count_x = [-move_x : margin : move_x]) { for (count_y = [-move_y : margin : move_y]) { hole(count_x, count_y); } } } module strong_angler_wall_cutoff(oversized = false) { diameter = strong_angler_wall_screw_diameter; padding = strong_angler_wall_screw_padding; if (oversized) { circle(d = diameter + padding * 2); } else { circle(d = diameter); } } module strong_angler_object() { width = strong_angler_size().x; depth = strong_angler_size().y; height = strong_angler_size().z; rounding = strong_angler_rounding; thickness = strong_angler_thickness; module corner(vector = [0, 0, 0]) { translate(vector) { sphere(r = rounding); } } module base_object() { move_x = width / 2 - rounding; move_y = depth / 2 - rounding; move_z = height / 2 - rounding; hull() { corner([move_x, move_y, move_z]); corner([-move_x, move_y, move_z]); corner([move_x, -move_y, move_z]); corner([-move_x, -move_y, move_z]); corner([move_x, move_y, -move_z]); corner([-move_x, move_y, -move_z]); } } module target_cutoff() { move_z = height / 2; move_top = move_z - thickness / 2; thickness_bottom = height - thickness; move_bottom = move_top - thickness / 2 - thickness_bottom / 2; translate([0, 0, move_top]) { linear_extrude(height = thickness, center = true) { strong_angler_target_cutoff(oversized = false); } } translate([0, 0, move_bottom]) { linear_extrude(height = thickness_bottom, center = true) { strong_angler_target_cutoff(oversized = true); } } } module wall_cutoff() { move_y = depth / 2; move_top = move_y - thickness / 2; bottom_thickness = depth - thickness; move_bottom = move_top - bottom_thickness / 2 - thickness / 2; module hole(size = 0, oversized = false) { rotate([90, 0, 0]) { linear_extrude(height = size, center = true) { strong_angler_wall_cutoff(oversized); } } } translate([0, move_top, 0]) { hole(thickness, false); } translate([0, move_bottom, 0]) { hole(bottom_thickness, true); } } module final_object() { difference() { base_object(); target_cutoff(); wall_cutoff(); } } color("#404080") { render() { final_object(); } } }