Browse Source

Fixed a couple of bugs in the open box module. Now it is bravo.

master
Maximilian Stiefel 8 years ago
parent
commit
85086d2bf7
  1. 39
      cad/housing.scad
  2. 24
      cad/open_box.scad

39
cad/housing.scad

@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////////
// 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 = 10;
allowance = 1;
lid_depth = 5;
bolt_diameter = 4;
bolt_spacing = 5;
my_color = "SteelBlue";
union(){
// Using my open box module for creating a simple box
color(my_color, 0.8)
open_box(length, width, height, thickness, allowance);
// Creating a depening for the lid
color(my_color, 0.9)
*translate([thickness/2, thickness/2, height])
cube([length + 2*allowance + thickness, width + 2*allowance + thickness, lid_depth]);
// Cylindric holes for the PCB
*color(my_color, 1.0) translate([0, 0, thickness/2]){
translate([thickness + bolt_spacing, bolt_spacing + thickness, 0])
cylinder(r=bolt_diameter/2, h=thickness/2+1);
}
*translate([0,0,0])
cube([90, thickness, 50]);
}

24
cad/open_box.scad

@ -11,27 +11,33 @@ module open_box(width, length, height, thickness, allowance)
/////////////////////////////////////////////////////////////////////////
// Vars
/////////////////////////////////////////////////////////////////////////
edge_rounding = 6;
compensation = abs(thickness-edge_rounding);
edge_rounding = 15;
compensation = 2*abs(edge_rounding-thickness);
width = width + 2*allowance;
length = length + 2*allowance;
/////////////////////////////////////////////////////////////////////////
// Action
/////////////////////////////////////////////////////////////////////////
difference(){
translate([0, 0, 0]) difference(){
// Hull 4 cylinders which are compensated against the thickness
// so the actual desired thickness and edge rounding is always achieved.
// so the actual desired thickness/2 and edge rounding is always achieved.
hull(){
translate([+compensation, +compensation, 0])
// x=0, y=0
translate([edge_rounding, edge_rounding, 0])
cylinder(r = edge_rounding, h = height + thickness);
translate([width + 2*allowance + 2*thickness - compensation, compensation, 0])
// x=width, y=0
translate([width + edge_rounding - compensation, edge_rounding, 0])
cylinder(r = edge_rounding, h = height + thickness);
translate([compensation, length + 2*allowance + 2*thickness - compensation,0])
// x=0, y=length
translate([edge_rounding, length + edge_rounding - compensation,0])
cylinder(r = edge_rounding, h = height + thickness);
translate([width + 2*allowance + 2*thickness - compensation, length + 2*allowance + 2*thickness - compensation,0])
//x=width, y=length
translate([width + edge_rounding - compensation, length + edge_rounding - compensation,0])
cylinder(r = edge_rounding, h = height + thickness);
}
translate([thickness, thickness, thickness])
cube([width + 2*allowance, length + 2*allowance, height + 1]);
cube([width, length, height + 1]);
}
}

Loading…
Cancel
Save