4 changed files with 114 additions and 8 deletions
After Width: | Height: | Size: 19 KiB |
@ -0,0 +1,38 @@ |
|||
///////////////////////////////////////////////////////////////////////////////// |
|||
// Module for a open box with rounded edges. |
|||
// |
|||
// Author: Maximilian Stiefel |
|||
// Last modification: 26.04.3017 |
|||
///////////////////////////////////////////////////////////////////////////////// |
|||
|
|||
module open_box(width, length, height, thickness, allowance) |
|||
{ |
|||
|
|||
///////////////////////////////////////////////////////////////////////// |
|||
// Vars |
|||
///////////////////////////////////////////////////////////////////////// |
|||
edge_rounding = 8; |
|||
compensation = abs(thickness-edge_rounding); |
|||
|
|||
///////////////////////////////////////////////////////////////////////// |
|||
// Action |
|||
///////////////////////////////////////////////////////////////////////// |
|||
difference(){ |
|||
|
|||
// Hull 4 cylinders which are compensated against the thickness |
|||
// so the actual desired thickness and edge rounding is always achieved. |
|||
hull(){ |
|||
translate([+compensation, +compensation, 0]) |
|||
cylinder(r = edge_rounding, h = height + thickness); |
|||
translate([width + 2*allowance + 2*thickness - compensation, compensation, 0]) |
|||
cylinder(r = edge_rounding, h = height + thickness); |
|||
translate([compensation, length + 2*allowance + 2*thickness - compensation,0]) |
|||
cylinder(r = edge_rounding, h = height + thickness); |
|||
translate([width + 2*allowance + 2*thickness - compensation, length + 2*allowance + 2*thickness - compensation,0]) |
|||
cylinder(r = edge_rounding, h = height + thickness); |
|||
} |
|||
|
|||
translate([thickness, thickness, thickness]) |
|||
cube([width + 2*allowance, length + 2*allowance, height + 1]); |
|||
} |
|||
} |
@ -1,6 +1,26 @@ |
|||
translate{[0,0,10]}{ |
|||
///////////////////////////////////////////////////////////////////////////////// |
|||
// Housing box for UppSense first tries. |
|||
// |
|||
// Author: Maximilian Stiefel |
|||
// Last modification: 26.04.3017 |
|||
///////////////////////////////////////////////////////////////////////////////// |
|||
|
|||
use <open_box.scad> |
|||
|
|||
///////////////////////////////////////////////////////////////////////////////// |
|||
// Vars |
|||
///////////////////////////////////////////////////////////////////////////////// |
|||
length = 50; |
|||
width = 80; |
|||
height = 45; |
|||
thickness = 5; |
|||
allowance = 1; |
|||
lid_depth = 5; |
|||
|
|||
difference(){ |
|||
cube([20,20,20], center=true); |
|||
color([0.2,0.8,1]) sphere(13); |
|||
} |
|||
// Using my open box module for creating a simple box |
|||
open_box(length, width, height, thickness, allowance); |
|||
// Creating a depening for the lid |
|||
translate([0, 0, height]) |
|||
cube([length + 2*allowance + 2*thickness, width + 2*allowance + 2*thickness, lid_depth]); |
|||
} |
|||
|
Loading…
Reference in new issue