// -------- Parameters --------
total_width = 150; // mm
total_height = 200; // mm
thickness = 1.2; // mm, dikte van je plaat
frame_width = 1.5; // mm, breedte van de buitenrand (versterking)
// Gaatjes-rooster parameters
cell_size = 5.0; // Roosterafstand (groter: open rooster; kleiner: meer gaten)
hole_size = 4.0; // Vierkant gat
// Berekende aantallen:
cols = floor((total_width - 2*frame_width) / cell_size);
rows = floor((total_height - 2*frame_width) / cell_size);
// Berekende daadwerkelijke mesh-maat (voor mooi centreren)
mesh_width = cols * cell_size;
mesh_height = rows * cell_size;
mesh_x0 = frame_width + (total_width - 2*frame_width - mesh_width) / 2;
mesh_y0 = frame_width + (total_height - 2*frame_width - mesh_height) / 2;
difference() {
// 1. Massieve plaat (met omlopend kader)
cube([total_width, total_height, thickness]);
// 2. Gaatjes aanbrengen binnen het roostergebied
for (i = [0 : cols-1])
for (j = [0 : rows-1])
translate([
mesh_x0 + i*cell_size + (cell_size-hole_size)/2,
mesh_y0 + j*cell_size + (cell_size-hole_size)/2,
0
])
cube([hole_size, hole_size, thickness+0.1]);
}