From 1f6be4fedd86d3b033821f762ccf2a3c4d282d3f Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Wed, 1 Nov 2023 07:18:24 +0100 Subject: [PATCH] vesak na aktovku --- vesak-filip-aktovka.scad | 183 +++++++++++++++++++++++++-------------- 1 file changed, 120 insertions(+), 63 deletions(-) diff --git a/vesak-filip-aktovka.scad b/vesak-filip-aktovka.scad index 2d8ae6c..9f14eaa 100644 --- a/vesak-filip-aktovka.scad +++ b/vesak-filip-aktovka.scad @@ -3,79 +3,136 @@ include ; eps = 0.01; infty = 200; -wall = 10; -width = 20; - -top_h = wall * 1.5; -top_hole_w = 40 + 1; -top_back_h = wall*1.5; - -beam_h = 10; - -bottom_hole_w = 15; -bottom_hole_r = 1.2*width; -bottom_h = 40; - -front_h = 20; - -module valcova_usec(r, w, h) { - intersection() { - tx(-sqrt(r^2 - (h/2)^2)) tz(h/2) rx(-90) - cylinder(r = r, h = w); - cube([r, w, h]); +wall = 8; + +inner_w = 82; +outer_w = inner_w + 2*30; +inner_w_round_r = 2; +body_h = 30; +bottom_w = 70; +top_w = bottom_w + 3*wall; +bottom_h = 60; + +module top_part() { + difference() { + round_with() { + rounding(); + hull() { + Mx() + Tx(outer_w/2 - 4*wall) + Sx(2) + cylinder(r = 2*wall, h = body_h); + } + } + translate([-outer_w/2-eps, -2*wall-eps, -eps]) + cube([outer_w + 2*eps, 2*wall-inner_w_round_r, + body_h + 2*eps]); + Mx() translate([inner_w/2 + inner_w_round_r, + -inner_w_round_r, -eps]) hull() { + cylinder(r = inner_w_round_r, h = body_h + 2*eps); + cube([inner_w/2, inner_w_round_r, body_h + 2*eps]); + } } } -module vesak() { - // top front - intersection() { - sx(top_h/wall) cylinder(r = wall, h = width); - cube(infty); - } - - // top back - ty(-top_hole_w) - intersection() { - sx(top_back_h/wall) cylinder(r = wall, h = width); - translate([-infty, -infty, 0]) cube(infty); - } - - // top - intersection() { - sx(top_h/(top_hole_w+wall)) - cylinder(r = top_hole_w + wall, h = width); - ty(-infty) cube(infty); +hole_d = 35; +hole_l = 1.25*hole_d; +hole_xoff = 0.2*(bottom_w-hole_d); +hole_yoff = bottom_h - 0.2*hole_d; +hole_top_yoff = 7; +hole_top_l = 20; +hook_top_rx = 8; +hook_top_ry = 12; +module bottom_part() { + difference() { + hull() { + Tx(-inner_w/2) Ty(-inner_w_round_r) + cube([inner_w, wall/2, body_h]); + Ty(-bottom_h) cylinder(r = bottom_w/2, h = body_h); + } + // main hole + difference() { + hull() { + translate([hole_xoff, -hole_yoff, -eps]) + cylinder(r = hole_d/2, h = body_h+2*eps); + translate([hole_xoff, + -hole_yoff-hole_d+hole_l, -eps]) + cylinder(r = hole_d/2, h = body_h+2*eps); + } + // rounded hook inner bottom + translate([-inner_w/2, -hole_yoff-hole_d/2, body_h/2]) + Sy(0.7) + Ry(90) + cylinder(r = 0.55*body_h, h = inner_w); + } + // cut to the top + hull() { + translate([inner_w/2+inner_w_round_r, + -hole_top_l-hole_top_yoff, -eps]) + cube([eps, hole_top_l, body_h+2*eps]); + translate([hole_xoff, -hole_yoff-hole_d+hole_l, -eps]) + intersection() { + cylinder(r = hole_d/2, h = body_h+2*eps); + translate([-infty, 0, -infty/2]) + cube(infty); + } + } + // rounded hook end + difference() { + translate([hole_xoff, -hole_yoff, -eps]) + cube([inner_w/2, hole_l-hole_d/2, body_h+2*eps]); + translate([hole_xoff + hole_d/2 + hook_top_rx - 2*eps, + -hole_yoff, -2*eps]) + Sy(hook_top_ry/hook_top_rx) + cylinder(r = hook_top_rx, h = body_h + 4*eps); + } } +} - // beam - tx(-beam_h) cube([beam_h, wall, width]); - - // bottom - tx(-beam_h) - intersection() { - sy((bottom_hole_w+2*wall)/bottom_h) cylinder(r = bottom_h, h = width); - tx(-infty) cube(infty); - } +module rounding() { + Mz() cylinder(r1 = 3, r2 = 0, h = 4.5, $fn = 8); +} + - // hook front - translate([-beam_h, bottom_hole_w+wall, 0]) - cube([front_h, wall, width]); +$fn = 128; +top_part(); - // hook rounded top - translate([front_h-beam_h, bottom_hole_w+wall, 0]) - valcova_usec(bottom_hole_r, wall, width); +Mx() Tx(outer_w/2-3) Ty(3) + cylinder(r = 15, h = 0.4); - // hook rounded bottom - translate([-beam_h, wall, 0]) - valcova_usec(bottom_hole_r, bottom_hole_w, width); +round_with() { + rounding(); + bottom_part(); } -$fn = 128; -round_with() { - union() { - for (z = [-1, 1]) sz(z) cylinder(r1 = 1, r2 = 0, h = 2, $fn = 32); + +/* +// rotate_extrude(angle=360, convexity=10) { + +outer_d = 1.1*body_h; +inner_d = body_h - 1.7*wall; +inner_scale = 1.5; +hole_depth = 0.01*bottom_h; +difference() { + difference() { + union() { + Ty(outer_d/2-eps) square([body_h, bottom_h - outer_d/2 + eps]); + intersection() { + square(body_h); + Tx(body_h/2) Ty(outer_d/2) + circle(r = outer_d/2); + } + } + hull() { + Tx(body_h) Ty(bottom_h-hole_depth) + square([eps, hole_depth]); + Tx(wall + inner_d/2) Ty(wall + inner_scale*inner_d/2) + Sy(inner_scale) + circle(r = inner_d/2); + Tx(wall + inner_d/2) Ty(wall + inner_d/2) + circle(r = inner_d/2); + } } - vesak(); } +*/ -// round_edges(1) vesak(); -- 2.43.5