Skip to content

Instantly share code, notes, and snippets.

@cyrildiagne
Created October 25, 2014 18:35
Show Gist options
  • Save cyrildiagne/b53d579d8e461a074a31 to your computer and use it in GitHub Desktop.
Save cyrildiagne/b53d579d8e461a074a31 to your computer and use it in GitHub Desktop.
Portée/ - 3d printed case v1
//box length
length = 104;
//breadth
breadth = 30;
//box height
height = 30;
// top height
topHeight = 7;
// plates thickness
plateThick = 1;
//outer radius for rounded box
radiusOuter = 1;
//radius for screw holes
radiusHole = 1.3;
// visholder
inverterHole = 4.5 / 2;
inverterHoleX = 31;
inverterHoleBaseHeight = 4;
// languettes
languetteThick = 0.5;
languetteHeight = 1;
// switchHole
switchHoleX = 33;
switchHoleLength = 8;
switchHoleHeight = 3;
// holder position
holderX = 62;
module faceplate(l,b) {
minkowski() {
circle(radiusOuter);
square([l,b]);
}
}
module inner_shape(l,b) {
difference() {
square([l,b]);
circle(radiusOuter);
}
}
module base() {
l = length + languetteThick * 2;
h = height - topHeight + plateThick;
union() {
difference() {
union() {
// outline
linear_extrude(height = h)
{
difference() {
faceplate(l, breadth);
square([l,breadth]);
}
}
// languettes
languette(h + languetteHeight);
translate([l-languetteThick,0,0]) languette(h + languetteHeight);
}
// holes
translate([0, 0, height - topHeight]) hole();
}
// plate
linear_extrude(height = plateThick ) faceplate(l,breadth);
// holders
holder(holderX, 0);
holder(holderX, breadth-radiusOuter-1);
// vis stand
translate([inverterHoleX, breadth*0.5 , plateThick]) {
linear_extrude(height = height - inverterHoleBaseHeight) {
difference() {
circle(inverterHole);
circle(radiusHole);
}
}
}
}
}
module hole() {
rotate([0, 90, 0]) {
translate([0, breadth*0.5, -radiusOuter]){
linear_extrude(height = length + radiusOuter*2 + languetteThick*2)
{
union() {
circle(3);
translate([-6,-3,0]) square([6, 6]);
}
}
}
}
}
module holder(x, y) {
translate([x, y, plateThick]) {
linear_extrude(height = height - plateThick - 3) {
square([1,2]);
}
}
}
module languette(lh) {
linear_extrude(height = lh)
{
square([languetteThick,breadth]);
}
}
module top() {
l = length + languetteThick * 2;
union() {
// outline
difference() {
linear_extrude(height = topHeight + plateThick )
{
difference() {
faceplate(l, breadth);
square([l,breadth]);
}
}
translate([switchHoleX, breadth-radiusOuter*0.5, plateThick + topHeight - switchHoleHeight]) {
linear_extrude(height = switchHoleHeight) {
square([switchHoleLength, radiusOuter*2]);
}
}
translate([0, 0, topHeight]) hole();
}
// plate
linear_extrude(height = plateThick ) {
difference() {
faceplate(l,breadth);
translate([inverterHoleX, breadth*0.5 ,0]) circle(radiusHole);
}
}
// vis stand
translate([inverterHoleX, breadth*0.5 , plateThick]) {
linear_extrude(height = inverterHoleBaseHeight) {
difference() {
circle(inverterHole);
circle(radiusHole);
}
}
}
}
}
base();
translate([0,breadth+2*radiusOuter+5,0]) {
top();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment