From 2918b52e24d6e047790630bd9e6eda344f2dd975 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 2 Aug 2020 16:53:00 +0200 Subject: [PATCH] Add windshields to side table. --- side_table.scad | 125 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 123 insertions(+), 2 deletions(-) diff --git a/side_table.scad b/side_table.scad index 94d6622..fd6f8e9 100644 --- a/side_table.scad +++ b/side_table.scad @@ -24,9 +24,15 @@ * - A rasp * - A file (optional) * - Sandpaper + * + * For the windshields: + * - Another kind of lath + * - Magnets from cigarette paper packaging or bolts */ +/* clang-format off */ include; +/* clang-format on */ $fs = 0.1; @@ -41,7 +47,7 @@ leg_width = 4.0; /* x */ leg_depth = 4.0; /* y */ leg_height = table_height - tabletop_height; /* z */ -module basic_side_table() +module side_table() { echo("Leg height", leg_height); @@ -108,4 +114,119 @@ module basic_side_table() } } -basic_side_table(); +module windbreaks() +{ + thickness = 1; /* x */ + height = 4; /* z */ + gap = 4; /* z */ + margin = leg_width / 4; /* Between edge of tabletop and windbreaks. */ + + module magnets(length, h = 0.12, d = 0.5) + { + middle = thickness / 2; + for (y = [thickness * 2, length / 2, length - (thickness * 2)]) + translate([middle, y, 0]) + { + cylinder(h = h, d = d); + } + } + + module windbreak(length) + { + difference() + { + color("SandyBrown") + { + cube([thickness, length, height]); + } + magnets(length = length); + } + } + + module triangle(points, height) + { + linear_extrude(height) + { + polygon(points); + } + } + + module side() + { + translate([0, 0, 0]) + { + length = table_depth - (margin * 2); + + difference() + { + windbreak(length); + translate([0, length - thickness, 0]) + { + triangle(points = [[thickness, 0], [0, thickness], + [thickness, thickness]], + height = 4); + } + } + } + } + + module top() + { + translate([margin, table_depth - thickness - margin, 0]) + { + length = table_width - (margin * 2); + + rotate([0, 0, -90]) + { + color("Tan") + { + difference() + { + windbreak(length); + triangle(points = + [ + [0, 0], [thickness, thickness], + [thickness, 0] + ], + height = 4); + translate([0, length - thickness, 0]) + { + triangle(points = [[thickness, 0], [0, thickness], + [thickness, thickness]], + height = 4); + } + } + } + } + } + } + + translate([0, margin, table_height + gap]) + { + translate([0, 0, gap == 0 ? 0 : height / 2]) + { + top(); + } + + /* Left */ + translate([margin, 0, 0]) + { + side(); + } + + /* Right */ + translate([table_width - margin, 0, 0]) + { + mirror([1, 0, 0]) + { + side(); + } + } + } +} + +side_table(); +render() +{ + windbreaks(); +}