include <../config/platform.scad> include <../config/thread.scad> include include function platform_full_support_depth() = platform_support_depth + thread_height + platform_thickness; module platform_mount_object() { rounding = corner_radius; holes_width = platform_width - rounding * 2 - thread_screw * 2 - platform_side_thickness * 2; holes_height = platform_height - rounding * 2 - thread_screw * 2 - platform_side_thickness; module base_shape() { move_x = platform_width / 2 - rounding; move_y = platform_height / 2 - rounding; hull() { corner(move_x, move_y); corner(-move_x, move_y); corner(move_x, -move_y); corner(-move_x, -move_y); } } base_thickness = platform_thickness + thread_height; module base_object() { linear_extrude(height = base_thickness, center = true) { base_shape(); } } module bottom_object() { center = base_thickness / 2 - thread_height / 2; render() { difference() { base_object(); translate([0, 0, center]) { rotate([180, 0, 0]) { width = holes_width; height = holes_height; thickness = platform_thickness; wall_thread_object(width, height, thickness); } } } } } module side_shape() { module cutout_shape() { move_x = platform_width / 2 - platform_side_thickness - rounding; move_top_y = platform_height / 2 - platform_side_thickness - rounding; move_bottom_y = -platform_height / 2 + rounding; hull() { corner(move_x, move_top_y); corner(-move_x, move_top_y); corner(move_x, move_bottom_y, false); corner(-move_x, move_bottom_y, false); } } module bottom_cutout_shape() { bottom = rounding / 2 - platform_height / 2; translate([0, bottom]) { square([platform_width, rounding], center = true); } } render() { difference() { base_shape(); cutout_shape(); bottom_cutout_shape(); } } } module side_object() { thickness = platform_support_depth; linear_extrude(height = thickness, center = true) { side_shape(); } } bottom_center = thread_height / 2 + platform_thickness / 2 - platform_full_support_depth() / 2; side_center = platform_support_depth / 2 + thread_height + platform_thickness - platform_full_support_depth() / 2; translate([0, 0, bottom_center]) { bottom_object(); } translate([0, 0, side_center]) { side_object(); } }