From 1d854f43a2cff5d6882d6715e1f26b7b4785439e Mon Sep 17 00:00:00 2001 From: nomike Date: Sun, 15 Sep 2024 01:57:47 +0200 Subject: [PATCH 1/2] Make enhanced type 1/4 lid snaps less tight nnd make tightness configurable. --- Box_Template.scad | 1 + Ultimate_Box_Generator.scad | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Box_Template.scad b/Box_Template.scad index e145500..120707f 100644 --- a/Box_Template.scad +++ b/Box_Template.scad @@ -80,6 +80,7 @@ show_lid=true; // Whether or not to render the lid. To make open boxes with no l //has_coinslot=false; // Add slot in the top for dropping in components. //has_snap=true; // Add small ridges or snaps to lids to help keep them closed. //lid_type_1_enhanced_snaps=false; // Add enhanced snaps to lid types 1 and 4. +//lid_type_1_enhanced_snaps_pertrusion_factor = 0.63; // Shift the enhanced snaps to the left or right. Higher values make it more lose, lower values make it tighter but risk the side-walls of the box breaking off. You probably want this to be between 0.55 and 0.67. //coinslot_x=20; // Size in X direction //coinslot_y=2.5; // Size in Y direction //coinslot_corner_radius=0; // rounded coinslot corners if >0; best if less than half the shorter coinslot dimension diff --git a/Ultimate_Box_Generator.scad b/Ultimate_Box_Generator.scad index 3c104c6..b4a0172 100644 --- a/Ultimate_Box_Generator.scad +++ b/Ultimate_Box_Generator.scad @@ -70,6 +70,7 @@ has_thumbhole=true; // Add gripping locations for easy opening. has_coinslot=false; // Add slot in the top for dropping in components. has_snap=true; // Add small ridges or snaps to lids to help keep them closed. lid_type_1_enhanced_snaps=false; // Add enhanced snaps to lid types 1 and 4. +lid_type_1_enhanced_snaps_pertrusion_factor = 0.63; // Shift the enhanced snaps to the left or right. Higher values make it more lose, lower values make it tighter but risk the side-walls of the box breaking off. You probably want this to be between 0.55 and 0.67. coinslot_x=20; // Size in X direction coinslot_y=2.5; // Size in Y direction coinslot_corner_radius=0; // rounded coinslot corners if >0; best if less than half the shorter coinslot dimension @@ -480,8 +481,8 @@ module make_box() { translate ([0,wall/2,totalheight-z_tolerance]) cube ([box_x-wall/2, box_y-wall,z_tolerance],center=false); if(lid_type_1_enhanced_snaps) { - translate([wall * 1.5, wall, totalheight + wall/2]) sphere(wall/2, $fn=lid_fn); - translate([wall * 1.5, box_y - wall, totalheight + wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, wall * (0.5 + lid_type_1_enhanced_snaps_pertrusion_factor), totalheight + wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, box_y - wall * (0.5 + lid_type_1_enhanced_snaps_pertrusion_factor), totalheight + wall/2]) sphere(wall/2, $fn=lid_fn); } } @@ -532,8 +533,8 @@ module make_box() { //Snaps if(has_snap) { if (lid_type_1_enhanced_snaps) { - translate([wall * 1.5, wall/2, wall/2]) sphere(wall/2, $fn=lid_fn); - translate([wall * 1.5, wall/2 + comp_size_y, wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, wall * lid_type_1_enhanced_snaps_pertrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, box_y - 2*tolerance - wall - wall * lid_type_1_enhanced_snaps_pertrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); } else { polyhedron([ [0, -snap_inset, 0], @@ -848,8 +849,8 @@ module make_lid() { //Snaps if(has_snap) { if (lid_type_1_enhanced_snaps) { - translate([wall * 1.5, wall/2, wall/2]) sphere(wall/2, $fn=lid_fn); - translate([wall * 1.5, wall/2 + comp_size_y, wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, wall * lid_type_1_enhanced_snaps_pertrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, box_y - 2*tolerance - wall - wall * lid_type_1_enhanced_snaps_pertrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); } else { polyhedron([ [0, -snap_inset, 0], From 4ccb285174d687f9dcf44633678ea4d0ce9c9bc0 Mon Sep 17 00:00:00 2001 From: nomike Date: Sun, 15 Sep 2024 02:04:35 +0200 Subject: [PATCH 2/2] Fix typo in variable name. --- Box_Template.scad | 2 +- Ultimate_Box_Generator.scad | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Box_Template.scad b/Box_Template.scad index 120707f..956b45b 100644 --- a/Box_Template.scad +++ b/Box_Template.scad @@ -80,7 +80,7 @@ show_lid=true; // Whether or not to render the lid. To make open boxes with no l //has_coinslot=false; // Add slot in the top for dropping in components. //has_snap=true; // Add small ridges or snaps to lids to help keep them closed. //lid_type_1_enhanced_snaps=false; // Add enhanced snaps to lid types 1 and 4. -//lid_type_1_enhanced_snaps_pertrusion_factor = 0.63; // Shift the enhanced snaps to the left or right. Higher values make it more lose, lower values make it tighter but risk the side-walls of the box breaking off. You probably want this to be between 0.55 and 0.67. +//lid_type_1_enhanced_snaps_protrusion_factor = 0.63; // Shift the enhanced snaps to the left or right. Higher values make it more lose, lower values make it tighter but risk the side-walls of the box breaking off. You probably want this to be between 0.55 and 0.67. //coinslot_x=20; // Size in X direction //coinslot_y=2.5; // Size in Y direction //coinslot_corner_radius=0; // rounded coinslot corners if >0; best if less than half the shorter coinslot dimension diff --git a/Ultimate_Box_Generator.scad b/Ultimate_Box_Generator.scad index b4a0172..f405645 100644 --- a/Ultimate_Box_Generator.scad +++ b/Ultimate_Box_Generator.scad @@ -70,7 +70,7 @@ has_thumbhole=true; // Add gripping locations for easy opening. has_coinslot=false; // Add slot in the top for dropping in components. has_snap=true; // Add small ridges or snaps to lids to help keep them closed. lid_type_1_enhanced_snaps=false; // Add enhanced snaps to lid types 1 and 4. -lid_type_1_enhanced_snaps_pertrusion_factor = 0.63; // Shift the enhanced snaps to the left or right. Higher values make it more lose, lower values make it tighter but risk the side-walls of the box breaking off. You probably want this to be between 0.55 and 0.67. +lid_type_1_enhanced_snaps_protrusion_factor = 0.63; // Shift the enhanced snaps to the left or right. Higher values make it more lose, lower values make it tighter but risk the side-walls of the box breaking off. You probably want this to be between 0.55 and 0.67. coinslot_x=20; // Size in X direction coinslot_y=2.5; // Size in Y direction coinslot_corner_radius=0; // rounded coinslot corners if >0; best if less than half the shorter coinslot dimension @@ -481,8 +481,8 @@ module make_box() { translate ([0,wall/2,totalheight-z_tolerance]) cube ([box_x-wall/2, box_y-wall,z_tolerance],center=false); if(lid_type_1_enhanced_snaps) { - translate([wall * 1.5, wall * (0.5 + lid_type_1_enhanced_snaps_pertrusion_factor), totalheight + wall/2]) sphere(wall/2, $fn=lid_fn); - translate([wall * 1.5, box_y - wall * (0.5 + lid_type_1_enhanced_snaps_pertrusion_factor), totalheight + wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, wall * (0.5 + lid_type_1_enhanced_snaps_protrusion_factor), totalheight + wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, box_y - wall * (0.5 + lid_type_1_enhanced_snaps_protrusion_factor), totalheight + wall/2]) sphere(wall/2, $fn=lid_fn); } } @@ -533,8 +533,8 @@ module make_box() { //Snaps if(has_snap) { if (lid_type_1_enhanced_snaps) { - translate([wall * 1.5, wall * lid_type_1_enhanced_snaps_pertrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); - translate([wall * 1.5, box_y - 2*tolerance - wall - wall * lid_type_1_enhanced_snaps_pertrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, wall * lid_type_1_enhanced_snaps_protrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, box_y - 2*tolerance - wall - wall * lid_type_1_enhanced_snaps_protrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); } else { polyhedron([ [0, -snap_inset, 0], @@ -849,8 +849,8 @@ module make_lid() { //Snaps if(has_snap) { if (lid_type_1_enhanced_snaps) { - translate([wall * 1.5, wall * lid_type_1_enhanced_snaps_pertrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); - translate([wall * 1.5, box_y - 2*tolerance - wall - wall * lid_type_1_enhanced_snaps_pertrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, wall * lid_type_1_enhanced_snaps_protrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); + translate([wall * 1.5, box_y - 2*tolerance - wall - wall * lid_type_1_enhanced_snaps_protrusion_factor, wall/2]) sphere(wall/2, $fn=lid_fn); } else { polyhedron([ [0, -snap_inset, 0],