From 5bb67462329e6236bb9b650becc534ebc462a405 Mon Sep 17 00:00:00 2001 From: popovspiridon99 Date: Wed, 18 Mar 2026 14:27:10 +0900 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?/=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base.scad | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 base.scad diff --git a/base.scad b/base.scad new file mode 100644 index 0000000..ce6e38c --- /dev/null +++ b/base.scad @@ -0,0 +1,140 @@ +base_length = 230; +base_width = 110; +base_height = 10; + +floor_depth = 2; + +wall_width = 2; +glass_down = 5; +glass_recess = 2; +leg_offset = 2; +leg = 5; + +module pit() { + translate([0,0,floor_depth]) cube([base_length, + base_width, + base_height],true); +} + +function base_offset() = (leg+leg_offset+glass_recess+wall_width)*2; + +module base_platform() { + cube([ + base_length+base_offset(), + base_width+base_offset(), + base_height+floor_depth], true); +} + +module base() { + difference(){ + base_platform(); + + translate([0,0,(base_height+floor_depth)/2-glass_down/2]) + cube([ + base_length+(wall_width+glass_recess)*2, + base_width+(wall_width+glass_recess)*2, + glass_down],true); + } + + cube([base_length+(wall_width*2), + base_width+(wall_width*2), + base_height+floor_depth],true); +} + +module carve_cave() { + difference() { + base(); + pit(); +} +} + +module triangle_braces() { + translate([base_length/2+leg_offset+glass_recess+wall_width, 0, -base_height/2 -floor_depth/2]) +rotate([90,0,0]) +linear_extrude(height = base_width+(leg+leg_offset+glass_recess+wall_width)*2, center = true) polygon(points=[[leg,0],[leg,base_height + floor_depth],[0,base_height + floor_depth]]); + +translate([-(base_length/2+leg_offset+glass_recess+wall_width)-leg, 0, -base_height/2 -floor_depth/2]) +rotate([90,0,0]) +linear_extrude(height = base_width+(leg+leg_offset+glass_recess+wall_width)*2, center = true) polygon(points=[[0,0],[leg,base_height + floor_depth],[0,base_height + floor_depth]]); + + translate([0, -(base_width/2+leg+leg_offset+glass_recess+wall_width), -base_height/2 -floor_depth/2]) +rotate([90,0,90]) +linear_extrude(height = base_length+(leg+leg_offset+glass_recess+wall_width)*2, center = true) polygon(points=[[0,0],[leg,base_height + floor_depth],[0,base_height + floor_depth]]); + +translate([0, (base_width/2+leg_offset+glass_recess+wall_width), -base_height/2 -floor_depth/2]) +rotate([90,0,90]) +linear_extrude(height = base_length+(leg+leg_offset+glass_recess+wall_width)*2, center = true) polygon(points=[[leg,0],[leg,base_height + floor_depth],[0,base_height + floor_depth]]); +} + +module curved_braces() { + translate([base_length/2+leg_offset+glass_recess+wall_width, 0, -base_height/2 -floor_depth/2]) +rotate([90,0,0]) +linear_extrude(height = base_width+(leg+leg_offset+glass_recess+wall_width)*2, center = true) polygon(points=curvedRightTriangle([leg,base_height + floor_depth],[leg,0],[0,base_height + floor_depth], 10, 0.2)[1]); + + + +translate([-(base_length/2+leg_offset+glass_recess+wall_width)-leg, 0, -base_height/2 -floor_depth/2]) +rotate([90,0,0]) +linear_extrude(height = base_width+(leg+leg_offset+glass_recess+wall_width)*2, center = true) polygon(points=curvedRightTriangle([0,base_height + floor_depth],[0,0],[leg,base_height + floor_depth], 10, 0.2)[1]); + + + + translate([0, -(base_width/2+leg+leg_offset+glass_recess+wall_width), -base_height/2 -floor_depth/2]) +rotate([90,0,90]) +linear_extrude(height = base_length+(leg+leg_offset+glass_recess+wall_width)*2, center = true) polygon(points=curvedRightTriangle([0,base_height + floor_depth],[leg,base_height + floor_depth],[0,0], 10, 0.2)[1]); + + + +translate([0, (base_width/2+leg_offset+glass_recess+wall_width), -base_height/2 -floor_depth/2]) +rotate([90,0,90]) +linear_extrude(height = base_length+(leg+leg_offset+glass_recess+wall_width)*2, center = true) polygon(points=curvedRightTriangle([leg,base_height + floor_depth],[leg,0],[0,base_height + floor_depth], 10, 0.2)[1]); +} + +difference() { + carve_cave(); + //triangle_braces(); + curved_braces(); +} + + +// --- Vector helpers --- +function v_add(a, b) = [a[0] + b[0], a[1] + b[1]]; +function v_sub(a, b) = [a[0] - b[0], a[1] - b[1]]; +function v_mul(v, s) = [v[0] * s, v[1] * s]; + +// Linear interpolation +function lerp(a, b, t) = + [ a[0] + (b[0] - a[0]) * t, + a[1] + (b[1] - a[1]) * t ]; + +// Single curved point on hypotenuse +function curved_point(A, O, H, t, scale) = + let( + P = lerp(O, H, t), + curveFactor = -4 * t * (1 - t), + toA = v_sub(A, P), + offset = v_mul(toA, scale * curveFactor) + ) + v_add(P, offset); + +// Main function +function curvedRightTriangle(A, O, H, count=20, scale=0.3) = + let( + hypotenuse = concat( + [O], + [ for (i = [1 : count-1]) + let(t = i / count) + curved_point(A, O, H, t, scale) + ], + [H] + ), + triangle = concat([A, O], hypotenuse, [A]) + ) + [hypotenuse, triangle]; + + + + + + +