include include include include <../config/global.scad> include <../config/top.scad> module top_shape() { padding = top_padding; rounding = top_rounding; motherboard_size = top_motherboard_size; motherboard_holes_positions = top_motherboard_holes; motherboard_hole = top_motherboard_holes_diameters; module corner(move = [0, 0]) { translate(move) { circle(r = rounding); } } module base_shape() { width = motherboard_size.x + padding * 2; height = motherboard_size.y + padding * 2; hull() { for (count = square_vector(width, height, rounding)) { corner(count); } } } module motherboard_holes() { translate([0, padding]) { for (count = motherboard_holes_positions) { translate(count) { circle(d = motherboard_hole); } } } } difference() { base_shape(); motherboard_holes(); if (top_pattern) { pattern(motherboard_size.x, motherboard_size.y); } } } module top_object() { linear_extrude(center = true, height = plywood_thickness) { top_shape(); } }