/* https://github.com/BelfrySCAD/BOSL2 */ include include // Radius of the hook ends loop_radius = 30; // Diameter of the hook hook_diameter = 15; // How many degrees should the hook ends bend hook_angle = 145; // [60:270] // Length of the straight part straight_length = 85; flatten_height = hook_diameter/20; $fn=80; difference() { /* Hook */ group() { /* Start cap */ rotate([0,-90,0]) rotate_extrude() intersection(){ circle(d=hook_diameter); square(hook_diameter); } /* Draw the hook */ turtle_cmds = ["arcrightto", loop_radius, hook_angle, "move", straight_length, "arcleftto", loop_radius, 0]; path = turtle(turtle_cmds, state=[0,0], full_state=false); path_sweep(circle(d = hook_diameter), path); /* End cap */ translate(path[len(path) - 1]) rotate([0,90,0]) rotate_extrude() intersection(){ circle(d=hook_diameter); square(hook_diameter); } } /* Flatten the hook with two cubes */ group(){ translate([-4*straight_length+2*loop_radius,-2*straight_length+loop_radius,(hook_diameter/2)-flatten_height]) cube([4*straight_length,2*straight_length,flatten_height]); translate([-4*straight_length+2*loop_radius,-2*straight_length+loop_radius,-(hook_diameter/2)]) cube([4*straight_length,2*straight_length,flatten_height]); } }