You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.6 KiB
42 lines
1.6 KiB
8 years ago
|
/////////////////////////////////////////////////////////////////////////////////
|
||
|
// Module for a open box with rounded edges.
|
||
|
//
|
||
|
// Author: Maximilian Stiefel
|
||
8 years ago
|
// Last modification: 26.04.2017
|
||
8 years ago
|
/////////////////////////////////////////////////////////////////////////////////
|
||
|
|
||
8 years ago
|
module open_box(width, length, height, thickness)
|
||
8 years ago
|
{
|
||
|
|
||
|
/////////////////////////////////////////////////////////////////////////
|
||
|
// Vars
|
||
|
/////////////////////////////////////////////////////////////////////////
|
||
8 years ago
|
edge_rounding = 8;
|
||
8 years ago
|
compensation = 2*abs(edge_rounding-thickness);
|
||
8 years ago
|
|
||
|
/////////////////////////////////////////////////////////////////////////
|
||
|
// Action
|
||
|
/////////////////////////////////////////////////////////////////////////
|
||
8 years ago
|
translate([0, 0, 0]) difference(){
|
||
8 years ago
|
// Hull 4 cylinders which are compensated against the thickness
|
||
8 years ago
|
// so the actual desired thickness/2 and edge rounding is always achieved.
|
||
8 years ago
|
hull(){
|
||
8 years ago
|
// x=0, y=0
|
||
|
translate([edge_rounding, edge_rounding, 0])
|
||
8 years ago
|
cylinder(r = edge_rounding, h = height + thickness);
|
||
8 years ago
|
// x=width, y=0
|
||
|
translate([width + edge_rounding - compensation, edge_rounding, 0])
|
||
8 years ago
|
cylinder(r = edge_rounding, h = height + thickness);
|
||
8 years ago
|
// x=0, y=length
|
||
|
translate([edge_rounding, length + edge_rounding - compensation,0])
|
||
8 years ago
|
cylinder(r = edge_rounding, h = height + thickness);
|
||
8 years ago
|
//x=width, y=length
|
||
|
translate([width + edge_rounding - compensation, length + edge_rounding - compensation,0])
|
||
8 years ago
|
cylinder(r = edge_rounding, h = height + thickness);
|
||
|
}
|
||
|
|
||
|
translate([thickness, thickness, thickness])
|
||
8 years ago
|
cube([width, length, height + 1]);
|
||
8 years ago
|
}
|
||
|
}
|