From: Jan "Yenya" Kasprzak Date: Wed, 6 Mar 2019 08:40:54 +0000 (+0100) Subject: pencil box/stand X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=2c9ee5585f49edcaf13ba0f89fb7cbff986afe21;p=things.git pencil box/stand --- diff --git a/pencil_stand.scad b/pencil_stand.scad new file mode 100644 index 0000000..5eeb71e --- /dev/null +++ b/pencil_stand.scad @@ -0,0 +1,86 @@ +eps = 0.01; +infty = 200; + +thin_wall = 0.5; +wall = 1.5; + +body_d = 60; +body_h = 80; + + +front_hex_r = body_d/8; +rear_hex_r = body_d/5; +rear_hex_xoff = -5; + +module hex_wall() { + +difference() { + cube([body_h, body_d, 2]); + for (y = [0:12]) + for (x = [0:7]) { + translate([(2+2*sin(30))*y*front_hex_r, front_hex_r*sin(60)*(1+2*x), -eps]) + cylinder(r1 = front_hex_r-2, r2 = front_hex_r, 2+2*eps, $fn = 6); + translate([(2+2*sin(30))*y*front_hex_r+(1+sin(30))*front_hex_r, front_hex_r*sin(60)*(2*x), -eps]) + cylinder(r1 = front_hex_r-2, r2 = front_hex_r, 2+2*eps, $fn = 6); + } +} + +scale([1, 1, -1]) +difference() { + cube([80, 60, 2]); + translate([rear_hex_xoff, 0, 0]) + for (y = [0:12]) + for (x = [0:7]) { + translate([(2+2*sin(30))*y*rear_hex_r, rear_hex_r*sin(60)*(1+2*x), -eps]) + cylinder(r1 = rear_hex_r-2, r2 = rear_hex_r, 2+2*eps, $fn = 6); + translate([(2+2*sin(30))*y*rear_hex_r+(1+sin(30))*rear_hex_r, rear_hex_r*sin(60)*(2*x), -eps]) + cylinder(r1 = rear_hex_r-2, r2 = rear_hex_r, 2+2*eps, $fn = 6); + } +} +} + + +rotate([0, -90, 0]) hex_wall(); +translate([body_d, body_d, 0]) scale([-1, -1, 1]) rotate([0, -90, 0]) hex_wall(); +rotate([0, -90, -90]) scale([1, 1, -1]) hex_wall(); +translate([body_d, body_d, 0]) rotate([0, -90, -90]) scale([1, -1, 1]) hex_wall(); + +cube([body_d, body_d, 2]); + +module corner() { + translate([-2, -2, 0]) cube([4, 4, body_h]); +} + +corner(); +translate([body_d, 0, 0]) corner(); +translate([0, body_d, 0]) corner(); +translate([body_d, body_d, 0]) corner(); + +module upper() { + intersection() { + rotate([0, 90, 0]) + cylinder(r = 2, h = body_d, $fn = 4); + translate([-eps, -2, -2-eps]) cube([body_d, 4, 2+eps]); + } +} +translate([0, 0, body_h]) upper(); +translate([0, body_d, body_h]) upper(); +translate([0, body_d, body_h]) rotate([0, 0, -90]) upper(); +translate([body_d, body_d, body_h]) rotate([0, 0, -90]) upper(); + +scale([1, 1, -1]) { +translate([0, 0, 0]) upper(); +translate([0, body_d, 0]) upper(); +translate([0, body_d, 0]) rotate([0, 0, -90]) upper(); +translate([body_d, body_d, 0]) rotate([0, 0, -90]) upper(); +} + +module mid_wall() { + translate([-thin_wall/2, 0, 0]) cube([thin_wall, body_d, body_h]); +} + +mid_wall(); +rotate([0, 0, -90]) mid_wall(); +translate([body_d, 0, 0]) mid_wall(); +translate([0, body_d, 0]) rotate([0, 0, -90]) mid_wall(); +