changeset 1:d17ae0060cba

added chamfer to bottom of body and lid
author ark
date 2026-10-16 23:26 +0200
parents 38eca1c6d879
children e8b0aed6e3d8
files img/box_92x92x92.png img/hinged_box_w92d92h92b85_lw40lh20.png main.scad
diffstat 3 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
Binary file img/box_92x92x92.png has changed
Binary file img/hinged_box_w92d92h92b85_lw40lh20.png has changed
--- a/main.scad	Fri Oct 16 22:59:22 2026 +0200
+++ b/main.scad	Fri Oct 16 23:26:25 2026 +0200
@@ -6,7 +6,7 @@
 // part to show or export
 part = "all"; // [all, body, lid, latch]
 // cut away the -y half in preview
-preview_cut = true;
+preview_cut = false;
 // show a paper stack mockup in the assembly view
 preview_paper = false;
 // show the filament pins and latch bar in the assembly view
@@ -39,6 +39,8 @@
 lip_layers = 4; // [1:1:20]
 // floor and lid top thickness in layers
 floor_layers = 6; // [2:1:20]
+// chamfer height in layers at the build plate edges of body and lid. each layer steps in by one layer height
+chamfer_layers = 3; // [0:1:10]
 
 /* [hinge] */
 // diameter of the filament used as hinge pin
@@ -78,6 +80,7 @@
 skirt_t = (wall_lines - lip_lines)*lw;
 lip_h = lip_layers*lh;
 floor_t = floor_layers*lh;
+chamfer_h = chamfer_layers*lh;
 out_x = inner_depth + 2*wall_t;
 out_y = inner_width + 2*wall_t;
 edge_r = min(edge_radius, min(out_x, out_y)/2 - epsilon);
@@ -135,6 +138,7 @@
 assert(seam_z + knuckle_r + knuckle_u <= top_z, "lid too low for the hinge knuckles");
 assert(latch_z + knuckle_r + knuckle_u <= top_z, "lid too low for the latch knuckles");
 assert(lid_h > floor_t + lip_h + lh, "lid too low for the lip");
+assert(chamfer_h <= floor_t, "chamfer higher than the floor");
 
 // lid sweep over a centred paper stack: radius of the lowest lid ceiling
 // point over the paper minus radius of the paper's front top corner
@@ -145,6 +149,7 @@
 echo("wall thickness", wall_t, "mm", wall_lines, "extrusions");
 echo("lip thickness", wall_t - skirt_t - cl, "mm, height", lip_h, "mm");
 echo("outer size", out_x, out_y, top_z, "mm");
+echo("chamfer", chamfer_h, "mm", chamfer_layers, "layers");
 echo("body height", seam_z, "mm, lid height", lid_h, "mm");
 echo("pin hole", pin_d, "mm, knuckle diameter", 2*knuckle_r, "mm");
 echo("hinge knuckle length", knuckle_l, "mm");
@@ -158,6 +163,14 @@
     offset(r=r) square([out_x - 2*d - 2*r, out_y - 2*d - 2*r], center=true);
 }
 
+// outer box shape of height h, the bottom edge chamfered in steps of one
+// layer, each step inset by one layer height
+module _block(h) {
+    for (i = [0:1:chamfer_layers - 1])
+        translate([0, 0, i*lh]) linear_extrude(lh + epsilon) _outline((chamfer_layers - i)*lh);
+    translate([0, 0, chamfer_h]) linear_extrude(h - chamfer_h) _outline(0);
+}
+
 // extrude a 2d profile drawn in x/z between y0 and y1
 module _yslab(y0, y1) {
     translate([0, y1, 0]) rotate([90, 0, 0]) linear_extrude(y1 - y0) children();
@@ -203,7 +216,7 @@
 
     difference() {
         union() {
-            linear_extrude(seam_z) _outline(0);
+            _block(seam_z);
             translate([0, 0, seam_z - epsilon])
                 linear_extrude(lip_h + epsilon)
                 difference() {
@@ -236,7 +249,7 @@
 
     difference() {
         union() {
-            translate([0, 0, seam_z]) linear_extrude(lid_h) _outline(0);
+            translate([0, 0, top_z]) mirror([0, 0, 1]) _block(lid_h);
             for (i = [1:2:hinge_knuckles - 1])
                 _back() _yslab(_knuckle_y0(i), _knuckle_y0(i) + knuckle_l)
                     _knuckle(seam_z, seam_z + cl);