include <../config/shelf.scad> module shelf_angle() { module base_shape() { move_x = shelf_angle_depth / 2 - shelf_rounding; move_y = shelf_angle_height / 2 - shelf_rounding; module base() { hull() { translate([-move_x, move_y]) { circle(r = shelf_rounding); } translate([-move_x, -move_y]) { circle(r = shelf_rounding); } } hull() { translate([-move_x, shelf_rounding]) { square(shelf_rounding * 2, center = true); } translate([move_x, shelf_rounding]) { circle(r = shelf_rounding); } translate([-move_x, -shelf_rounding]) { square(shelf_rounding * 2, center = true); } translate([move_x, -shelf_rounding]) { circle(r = shelf_rounding); } } } module reverse_corner(size = 10, rotation = 0) { module base() { difference() { square(size * 2, center = true); circle(r = size); } } module mask() { translate([0, size / 2]) { square([size * 2, size], center = true); } translate([size / 2, -size / 2]) { square(size, center = true); } } render() { rotate(90 * rotation) { translate([size / 2, size / 2]) { difference() { base(); mask(); } } } } } module indentation() { width = shelf_angle_depth - shelf_angle_thickness; height = shelf_thickness; translate([shelf_angle_thickness / 2, 0]) { square([width, height], center = true); } } render() { difference() { base(); indentation(); } } base_size = min(shelf_angle_height / 2, shelf_angle_depth); size = base_size - shelf_rounding * 2; corner_move_x = size / 2 - shelf_angle_depth / 2 + shelf_rounding * 2; corner_move_y = size / 2 - shelf_angle_height / 2; translate([corner_move_x, -corner_move_y]) { reverse_corner(size, 0); } } base_shape(); }