This commit is contained in:
zhao
2022-12-31 13:56:54 -05:00
parent d81b129686
commit d0c89d13c6
40 changed files with 586 additions and 388 deletions

12
cases/math.scad Normal file
View File

@ -0,0 +1,12 @@
/* Example usage:
for (i=mirror4XY(midpoint=[0,0,0], offsetX=90, offsetY=90)) {
translate(v=i)
something();
}
*/
function mirror4XY(midpoint, offsetX, offsetY) =
[[midpoint[0]+offsetX, midpoint[1]+offsetY, midpoint[2]],
[midpoint[0]-offsetX, midpoint[1]+offsetY, midpoint[2]],
[midpoint[0]-offsetX, midpoint[1]-offsetY, midpoint[2]],
[midpoint[0]+offsetX, midpoint[1]-offsetY, midpoint[2]]];

6
cases/misc/magnet.scad Normal file
View File

@ -0,0 +1,6 @@
// Dimensions for small cylindrical neodymium magnets that I bought off Amazon
magnetD = 6;
magnetR = magnetD/2;
magnetH = 1.7;

95
cases/misc/voronoi.scad Normal file
View File

@ -0,0 +1,95 @@
// (c)2013 Felipe Sanches <juca@members.fsf.org>
// licensed under the terms of the GNU GPL version 3 (or later)
function normalize(v) = v / (sqrt(v[0] * v[0] + v[1] * v[1]));
//
// The voronoi() function generates a 2D surface, which can be provided to
// a) linear_extrude() to produce a 3D object
// b) intersection() to restrict it to a a specified shape -- see voronoi_polygon.scad
//
// Parameters:
// points (required) ... nuclei coordinates (array of [x, y] pairs)
// L ... the radius of the "world" (the pattern is built within this circle)
// thickness ... the thickness of the lines between cells
// round ... the radius applied to corners (fillet in CAD terms)
// nuclei (bool) ... show nuclei sites
//
// These parameters need to be kept more or less in proportion to each other, and to the distance
// apart of points in the point_set. If one or the other parameter is increased or decreased too
// much, you'll get no output.
//
module voronoi(points, L = 200, thickness = 1, round = 6, nuclei = true) {
for (p = points) {
difference() {
minkowski() {
intersection_for(p1 = points){
if (p != p1) {
angle = 90 + atan2(p[1] - p1[1], p[0] - p1[0]);
translate((p + p1) / 2 - normalize(p1 - p) * (thickness + round))
rotate([0, 0, angle])
translate([-L, -L])
square([2 * L, L]);
}
}
circle(r = round, $fn = 20);
}
if (nuclei)
translate(p) circle(r = 1, $fn = 20);
}
}
}
//
// The random_voronoi() function is the helper wrapper over the voronoi() core.
// It generates random nuclei site coordinates into the square area,
// passing other arguments to voronoi() unchanged.
//
// Parameters:
// n ... number of nuclei sites to be generated
// nuclei (bool) ... show nuclei sites
// L ... the radius of the "world" (the pattern is built within this circle)
// thickness ... the thickness of the lines between cells
// round ... the radius applied to corners (fillet in CAD terms)
// min ... minimum x and y coordinate for nuclei generation
// max ... maximum x and y coordinate for nuclei generation
// seed ... seed for the random generator (random if undefined)
// center (bool) ... move resulting pattern to [0, 0] if true
//
module random_voronoi(n = 20, nuclei = true, L = 200, thickness = 1, round = 6, min = 0, max = 100, seed = undef, center = false) {
seed = seed == undef ? rands(0, 100, 1)[0] : seed;
echo("Seed", seed);
// Generate points.
x = rands(min, max, n, seed);
y = rands(min, max, n, seed + 1);
points = [ for (i = [0 : n - 1]) [x[i], y[i]] ];
// Center Voronoi.
offset_x = center ? -(max(x) - min(x)) / 2 : 0;
offset_y = center ? -(max(y) - min(y)) / 2 : 0;
translate([offset_x, offset_y])
voronoi(points, L = L, thickness = thickness, round = round, nuclei = nuclei);
}
// example with an explicit list of points:
point_set = [
[0, 0], [30, 0], [20, 10], [50, 20], [15, 30], [85, 30], [35, 30], [12, 60],
[45, 50], [80, 80], [20, -40], [-20, 20], [-15, 10], [-15, 50]
];
//voronoi(points = point_set, round = 4, nuclei = true);
module voronoi3u_N(h) {
intersection() {
translate(v=[10,5,0])
cube(size=[160, 10, h]);
translate(v=[20,-52,0])
scale(v=[0.40,0.44,10])
linear_extrude(height=10)
random_voronoi(n = 128, round = 10, min = 0, max = 300, seed = 40, thickness=3.5, nuclei=false);
}
}

View File

@ -1,14 +1,8 @@
$fn=64; $fn=64;
include <./math.scad>
eps=0.1; eps=0.1;
function mirror4XY(midpoint, offsetX, offsetY) =
[[midpoint[0]+offsetX, midpoint[1]+offsetY, midpoint[2]],
[midpoint[0]-offsetX, midpoint[1]+offsetY, midpoint[2]],
[midpoint[0]-offsetX, midpoint[1]-offsetY, midpoint[2]],
[midpoint[0]+offsetX, midpoint[1]-offsetY, midpoint[2]]];
module leg() { module leg() {
mainLength = 80; mainLength = 80;
upperDim = 20; upperDim = 20;

View File

@ -91,11 +91,29 @@ module frontPlate() {
} }
difference() { difference() {
difference() {
difference() { difference() {
union() { union() {
rotate(a = [- 90, 0, 0]) rotate(a = [- 90, 0, 0])
frontPlate(); frontPlate();
} }
union() {
translate(v=[1,0,0])
rotate(a=[0,-15, 0])
translate(v=[0,-50,0])
cube(size=[100, 100, 30]);
translate(v=[180-1,0,0])
mirror(v=[1,0,0]) {
rotate(a = [0, - 15, 0])
translate(v = [0, - 50, 0])
cube(size = [100, 100, 30]);
}
}
}
// lug holes // lug holes
union() { union() {
translate(v=[160,-3,-frontPlateThickness]) translate(v=[160,-3,-frontPlateThickness])
@ -105,7 +123,7 @@ difference() {
} }
} }
for (i=[0:5]) { for (i=[0:5]) {
translate(v=[5,i*4 - 0.5,-10]) translate(v=[5,i*4 - 0.75,-10])
cube(size=[170, 2, 20]); cube(size=[170, 1.5, 20]);
} }
} }

Binary file not shown.

View File

@ -134,11 +134,11 @@ module cutoutProfile_N() {
// front I/O // front I/O
mirror(v=[0,1,0]) mirror(v=[0,1,0])
translate(v=[1, -eps*100, pcbThickness-4]) translate(v=[1, -eps*100, pcbThickness-4])
cube(size=[58.0 + 0.1, inf50, 18.0 + 0.1]); cube(size=[58.0 + 0.1, inf50, 19.0 + 0.1]);
// side I/O // side I/O
translate(v=[-48-3, (pcbDimensions[1]-54)-10, pcbThickness-4]) translate(v=[-48-3, (pcbDimensions[1]-54)-10, pcbThickness-4])
cube(size=[inf50, 64, 18]); cube(size=[inf50, 64, 19]);
} }
} }

Binary file not shown.

View File

@ -4,7 +4,7 @@ difference() {
union() { union() {
cube(size=[67,95.7,1]); cube(size=[67,95.7,1]);
translate(v=[2,2,1]) translate(v=[2,2,1])
cube(size=[63,91.7,3]); cube(size=[63.2,92,3]);
} }
union() { union() {

BIN
cases/profiles/rpi/top.stl Normal file

Binary file not shown.

View File

@ -1,5 +1,5 @@
include <../common.scad> include <../../common.scad>
include <./screws.scad> include <../screws.scad>
$fn=64; $fn=64;

View File

@ -1,5 +1,5 @@
include <../common.scad> include <../../common.scad>
include <./screws.scad> include <../screws.scad>
//slack = 0.5; //slack = 0.5;

View File

@ -1,19 +1,88 @@
sideHeight = 210; include <../../../misc/magnet.scad>
sideLength = 200; include <../../../math.scad>
$fn=64;
_height = 210;
_depth = 200;
_thickness = 5;
holeOffset = 10; holeOffset = 10;
module _base() {
difference() {
cube(size = [_height, _depth, _thickness], center=true);
union() {
translate(v = [0, 0, 20])
minkowski() {
sphere(r = 20);
cube(size = [_height - 34, _depth - 34, 1], center = true);
// TODO make helper function for this }
screwDiffs = [ // handles
[sideLength-holeOffset, sideHeight-holeOffset,0], handleLength = 80;
[holeOffset, holeOffset,0], translate(v=[0, _depth/2, _thickness+5.5])
[sideLength-holeOffset, holeOffset], minkowski() {
[holeOffset, sideHeight-holeOffset], sphere(r=10);
cube(size=[handleLength, 10, 1], center=true);
}
translate(v=[0, -_depth/2, _thickness+5.5])
minkowski() {
sphere(r=10);
cube(size=[handleLength, 10, 1], center=true);
}
}
}
}
module magnetMount(h) {
slack = 0.2;
difference() {
cylinder(h = h, r=magnetR*2);
translate(v=[0,0,h-magnetH])
cylinder(h = magnetH, r = magnetR+slack);
}
}
module side() {
magnetMountOffsetX = 95;
magnetMountOffsetY = 90;
difference() {
union() {
// align _base to positive z plan
translate(v = [0, 0, _thickness / 2])
_base();
// magnet mounts (no holes)
for (i=mirror4XY(midpoint=[0,0,0], offsetX=magnetMountOffsetX, offsetY=magnetMountOffsetY)) {
translate(v=i)
cylinder(h=_thickness, r=2*magnetR);
}
}
// magnet mount holes
for (i=mirror4XY(midpoint=[0,0,_thickness-magnetH], offsetX=magnetMountOffsetX, offsetY=magnetMountOffsetY)) {
translate(v=i)
cylinder(h=magnetH, r=magnetR);
}
}
}
difference() {
side();
union() {
for (i=[0:7]) {
translate(v=[i*15 - 52.5,0,0])
minkowski() {
cube(size = [2, 100, 10], center = true);
sphere(r=2);
}
}
}
}
[sideLength-2*holeOffset, sideHeight-holeOffset,0],
[2*holeOffset, holeOffset,0],
[sideLength-2*holeOffset, holeOffset],
[2*holeOffset, sideHeight-holeOffset]
];

Binary file not shown.

View File

@ -1,79 +1,97 @@
include <../common.scad> include <../../common.scad>
include <./screws.scad> include <../../math.scad>
include <../screws.scad>
$fn=64; $fn=64;
module baseFrame() { _height = 8;
difference() { _width = 210;
cube(size=[200,200,4], center=true); _depth = 200;
cube(size=[180,180,4], center=true);
module _bodySilBase(width, depth, height, roundedPartHeight) {
hull() {
cube(size = [width, depth, height - roundedPartHeight]);
minkowski() {
translate(v = [roundedPartHeight, 0, height - roundedPartHeight])
cube(size = [width-2*roundedPartHeight, depth, eps]);
rotate(a = [90, 0, 0])
cylinder(r = roundedPartHeight, h = eps);
}
}
} }
translate(v=[80,80,0]) module _bodySil(width, depth, height, roundedPartHeight, wallThickness, topThickness) {
cube(size=[20,20, 4],center=true); cornerSquareDim = 30;
translate(v=[-80,80,0])
cube(size=[20,20, 4],center=true);
translate(v=[80,-80,0])
cube(size=[20,20, 4],center=true);
translate(v=[-80,-80,0])
cube(size=[20,20, 4],center=true);
}
module lugBottom() {
difference() {
cube(size=[9.7,9.7,6], center=true);
translate(v=[2,2,0])
cube(size=[9.1,9.1,5+1], center=true);
}
}
module base() {
difference() { difference() {
union() { _bodySilBase(width, depth, height, roundedPartHeight);
translate(v=[0,0,4/2])
baseFrame();
translate(v=[-90,-90,-6/2])
lugBottom();
mirror(v=[1,0,0])
translate(v=[-90,-90,-6/2])
lugBottom();
mirror(v=[0,1,0])
translate(v=[-90,-90,-6/2])
lugBottom();
mirror(v=[1,1,0])
translate(v=[-90,-90,-6/2])
lugBottom();
}
union() { union() {
translate(v=[80,80,0]) translate(v = [wallThickness, cornerSquareDim, - topThickness])
cylinder(h = 100, r = m3ptr, $fn=32, center=true); _bodySilBase(width - 2 * wallThickness, depth - 2 * cornerSquareDim, height, roundedPartHeight);
translate(v=[-80,80,0]) translate(v=[cornerSquareDim, wallThickness, -topThickness])
cylinder(h = 100, r = m3ptr, $fn=32, center=true); cube(size=[width-2*cornerSquareDim, depth-2*wallThickness, height]);
}
}
}
translate(v=[80,-80,0]) // Negative and centered on xy. Aligned with z=0 downwards
cylinder(h = 100, r = m3ptr, $fn=32, center=true); module _lugAndMagnet() {
slack = 0.3;
vSlack = 0.1;
// lug
translate(v=[0,0,-2.5])
cube(size=[10+slack, 10+slack, 5+vSlack], center=true);
translate(v=[-80,-80,0]) // hole for magnet, no tolerance on
cylinder(h = 100, r = m3ptr, $fn=32, center=true); translate(v=[0,0,-(5+vSlack+1.7)])
cylinder(d=6+slack, h=1.7+vSlack);
}
module baseBody() {
difference() {
_bodySil(_width, _depth, _height, 4, 5, 2);
_mid = [_width / 2, _depth / 2, _height];
union() {
for (i = mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 15, offsetY = (_depth / 2) - 10)) {
translate(v = i)
_lugAndMagnet();
}
screwHolePositions = concat(
mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 25, offsetY = (_depth / 2) - 20),
mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 15, offsetY = (_depth / 2) - 20),
mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 25, offsetY = (_depth / 2) - 10)
);
for (i = screwHolePositions) {
translate(v = i) {
cylinder(r = m3RadiusSlacked, h = inf, center = true);
}
}
} }
} }
} }
base();
difference() {
baseBody();
union() {
minkowski() {
translate(v = [(_width - 130) / 2, (_depth - 150) / 2, - inf / 2])
cube(size = [130, 150, inf]);
cylinder(r = 5);
}
}
}

BIN
cases/rack/body/top1.stl Normal file

Binary file not shown.

View File

@ -298,7 +298,7 @@ module frontPlateAligned() {
frontPlate(); frontPlate();
union() { union() {
// lugs // lugs TODO not recessed enough!!
translate(v=[-0.05,-(1.5+boxFrontThickness),-0.05]) translate(v=[-0.05,-(1.5+boxFrontThickness),-0.05])
cube(size=[4+0.1,2,4+0.1]); cube(size=[4+0.1,2,4+0.1]);

32
cases/rack2/config.scad Normal file
View File

@ -0,0 +1,32 @@
/*
case-files v2
This file contains parameters used for declaring/generating a customized rack frame.
- All dimensions are in millimetres (mm) unless stated otherwise.
- A "_N" appended to a module is meant to denote that this module is a negative volume, and should only be used to
substract from other volumes.
*/
// Maximum width for rackmount units. Change this according your max expected enclosure width.
// Changing this will directly affect the required build volume.
maxUnitWidth = 200;
// Maximum (recommended) unit depth. There technically isn't a max unit depth because there's no physical bound on
// how far a rack unit can extrude back. This parameter basically controls the distance between the front of the front
// rails and the back of the back rails. Changing this will directly affect the required build volume.
maxUnitDepth = 200;
// Vertical distance between the midpoint of adjacent screws mounts. Affects build volume.
screwDiff = 10;
// Number screw slots on the main rail. Affects build volume.
numRailScrews = 20;
// Screw type used for rackmount units. See screws.scad.
railMainScrewType = "m4";
// Screw type used to affix side rails.
railSideMountScrewType = "m4";
// Screw type used for constructing the actual rack frame.
rackScrewType = "m3";

121
cases/rack2/mainRail.scad Normal file
View File

@ -0,0 +1,121 @@
include <./config.scad>
include <./screws.scad>
// Distance between the middle of a screw mount and the rail's vertical edges
railScrewHoleToInnerEdge = 5;
railScrewHoleToOuterEdge = 5;
// Distance between the midpoint of the rail screw holes.
rackMountScrewWidth = maxUnitWidth + 2*railScrewHoleToInnerEdge;
railFrontThickness = 6; // Make sure that the nuts for the chosen screw type can slot within the front face
railSideMountThickness = 2.5;
railOtherThickness = 2.5;
// Extra spacing for the rack unit screws.
frontScrewSpacing = 8;
/* Small horizontal planes at the top and bottom of the main rails. Used so we can fasten the rail to the frame
Note that this value is also used for a depression at the bottom/top of the frame for aligning the rail */
railFootThickness = 3;
railTotalHeight = screwDiff * (numRailScrews+1) + 2*railFootThickness;
sideSupportExtraSpace = 2;
sideSupportScrewHoleToFrontEdge = 5;
sideSupportScrewHoleToBackEdge = 4.5;
sideSupportDepth = sideSupportScrewHoleToBackEdge + sideSupportScrewHoleToFrontEdge;
frontFaceWidth = railScrewHoleToInnerEdge + railScrewHoleToOuterEdge;
module _frontRailSegment() {
difference() {
cube(size=[frontFaceWidth, railFrontThickness, railTotalHeight]);
for (i=[1:numRailScrews]) {
translate(v=[railScrewHoleToOuterEdge, railFrontThickness/2, i*screwDiff + railFootThickness])
rotate(a=[90,0,0])
m4HexNutPocketNegative();
}
}
}
module _connectingLBracketRailSegment() {
difference() {
cube(size = [railOtherThickness, frontScrewSpacing + railOtherThickness, railTotalHeight]);
union () {
translate(v=[0,4,railFootThickness + screwDiff / 2])
rotate(a=[0,90,0])
cylinder(r=m3RadiusSlacked, h = 10, $fn=32, center=true);
translate(v=[0,4,railTotalHeight-(railFootThickness + screwDiff / 2)])
rotate(a=[0,90,0])
cylinder(r=m3RadiusSlacked, h = 10, $fn=32, center=true);
}
}
translate(v=[0, frontScrewSpacing + railOtherThickness, 0])
rotate(a=[0,0,270])
cube(size=[railOtherThickness, frontFaceWidth - sideSupportExtraSpace, railTotalHeight]);
}
module _sideSupportSegment() {
difference() {
cube(size=[sideSupportDepth, railSideMountThickness, railTotalHeight]);
for (i=[1:numRailScrews]) {
translate(v=[sideSupportScrewHoleToFrontEdge, railFrontThickness/2, i*screwDiff + railFootThickness])
rotate(a=[90,0,0])
cylinder(r=m4RadiusSlacked, h=10, $fn=32);
}
}
}
module _railFeet() {
difference() {
cube(size = [frontFaceWidth - sideSupportExtraSpace, sideSupportDepth, railFootThickness]);
hull() {
translate(v = [1.5, 5, 0])
cylinder(r = m3RadiusSlacked, h = 10, $fn = 32);
translate(v = [0, 5, 0])
cube(size=[0.1, m3RadiusSlacked*2, 10], center=true);
}
}
}
module mainRail() {
union() {
_frontRailSegment();
translate(v = [0, railFrontThickness, 0])
_connectingLBracketRailSegment();
translate(v = [frontFaceWidth-sideSupportExtraSpace, railFrontThickness + railOtherThickness + frontScrewSpacing, 0])
rotate(a = [0, 0, 90])
_sideSupportSegment();
translate(v = [0, railFrontThickness + railOtherThickness + frontScrewSpacing, 0]) {
_railFeet();
translate(v = [0, 0, railTotalHeight-railFootThickness])
_railFeet();
}
}
}
mainRail();
echo("Total Rail Height = ", railTotalHeight);

BIN
cases/rack2/mainRail.stl Normal file

Binary file not shown.

113
cases/rack2/screws.scad Normal file
View File

@ -0,0 +1,113 @@
/* Some common screw dimensions */
inf = 400; // basically infinity
/********************************************************************************/
// M3 dimensions
m3HoleRadiusSlack = 0.15;
m3Diameter = 3.0;
m3Radius = m3Diameter/2.0;
m3RadiusSlacked = m3Radius + m3HoleRadiusSlack;
// legacy TODO: replace
m3ptr = m3RadiusSlacked;
// NUTS!
m3HexNutWidthAcrossFlats = 5.41;
m3HexNutWidthAcrossCorners = FtoG(m3HexNutWidthAcrossFlats);
m3HexNutThickness = 2.18;
module m3HexNutPocketNegative() {
hexNutPocketNegative(m3RadiusSlacked,
m3HexNutWidthAcrossCorners/2 + 0.1,
m3HexNutThickness + 0.2);
}
// TODO: remove test
*difference() {
cube(size=[8,12,5], center=true);
rotate(a=[0,0,20])
m3HexNutPocketNegative();
}
*m3HexNutPocketNegative();
/********************************************************************************/
// M4 dimensions
m4HoleRadiusSlack = 0.15;
m4Diameter = 4.0;
m4Radius = m4Diameter/2.0;
m4RadiusSlacked = m4Radius + m4HoleRadiusSlack;
m4HexNutWidthAcrossFlats = 6.89;
m4HexNutWidthAcrossCorners = FtoG(m4HexNutWidthAcrossFlats);
m4HexNutThickness = 3.07;
module m4HexNutPocketNegative() {
hexNutPocketNegative(m4RadiusSlacked,
m4HexNutWidthAcrossCorners/2 + 0.1,
m4HexNutThickness + 0.2);
}
// TODO: remove test
*difference() {
translate(v=[0,1,0])
cube(size=[10,12,6], center=true);
rotate(a=[0,0,20])
m4HexNutPocketNegative();
}
*m4HexNutPocketNegative();
/********************************************************************************/
// Convert a regular hexagon widthAcrossFlats to widthAcrossCorners
function FtoG(widthAcrossFlats) = widthAcrossFlats * (2/sqrt(3));
// Convert a regular hexagon widthAcrossCorners to widthAcrossFlats
function GtoF(widthAcrossCorners) = widthAcrossCorners * (sqrt(3)/2);
module hexNutPocketNegative(
innerRadius,
widthAcrossCorners,
thickness)
{
union() {
hull() {
// hexagonal cylinder representing where the nut should fit
cylinder(r=widthAcrossCorners, h=thickness, center=true, $fn=6);
// negative volume for sliding in the nut
translate(v=[inf,0,0])
cylinder(r=widthAcrossCorners, h=thickness, center=true, $fn=6);
}
// negative volume for screw lead
translate(v=[0,0,-10])
cylinder(r=innerRadius, h = inf, $fn=32);
hull() {
translate(v=[inf,0,0])
cylinder(r=innerRadius, h = inf, $fn=32);
cylinder(r=innerRadius, h = inf, $fn=32);
}
}
}

View File

@ -1,214 +0,0 @@
// test for screw tolerances
include <./rockpro.scad>;
include <../power/src/base.scad>;
$fn = 128;
outerD = 4.65;
innerD = 2.93;
*difference() {
cube(size=[10,50,10]);
union() {
translate(v=[5,10,-1])
cylinder(h=30,r=innerD/2-0.2);
translate(v=[5,25,-1])
cylinder(h=30,r=innerD/2);
translate(v=[5,40,-1])
cylinder(h=30,r=innerD/2+0.2);
}
}
module caseOuter() {
rotate(a=[90,0,0])
minkowski() {
cube(size=[80,40,195], center=true);
cylinder(h=0.00000000001, r=10);
}
}
module caseInner() {
translate(v=[0,0,2])
rotate(a=[90,0,0])
minkowski() {
cube(size=[81.5,47,195+0.01], center=true);
*cylinder(h=0.00000000001, r=5);
}
}
module hgill(i) {
minkowski() {
*sphere(r=2);
translate(v=[0,i*10,5])
rotate(a=[30,0,0])
cube(size=[200, 4, 30], center=true);
}
}
module caseShell() {
difference() {
caseOuter();
union() {
caseInner();
// side perforations
for (i=[-7:7]) {
hgill(i=i);
}
// top perforations
for (i=[-3:3]) {
translate(v=[0,i*20,50])
cube(size=[75,10,60], center=true);
}
// bottom perforations
for (i=[2:4]) {
translate(v=[0,i*20,-20])
cube(size=[60,8,50], center=true);
}
for (i=[-4:0]) {
translate(v=[0,i*20,-20])
cube(size=[60,8,50], center=true);
}
}
}
}
module faceMountDiffs() {
translate(v=[45,0,20])
rotate(a=[90,0,0])
cylinder(r=innerD/2,h=300, center=true);
translate(v=[45,0,-20])
rotate(a=[90,0,0])
cylinder(r=innerD/2,h=300, center=true);
translate(v=[-45,0,-20])
rotate(a=[90,0,0])
cylinder(r=innerD/2,h=300, center=true);
translate(v=[-45,0,20])
rotate(a=[90,0,0])
cylinder(r=innerD/2,h=300, center=true);
}
module caseWithMountHoles() {
difference() {
union() {
caseShell();
translate(v=[-35, 25,-27.5])
rotate(a=[0,0,-90])
rockProMountPoints(6, 3.8, 64, false);
}
union() {
translate(v=[-35, 25,-27.5])
rotate(a=[0,0,-90])
rockProMountPoints(6, innerD/2, 64, false);
faceMountDiffs();
}
}
}
*caseWithMountHoles();
module bottomTray() {
difference() {
union() {
intersection() {
caseWithMountHoles();
translate(v=[0,0,-115])
cube(size=[500,500,200], center=true);
}
translate(v=[-45.5,0,-15])
rotate(a=[90,90,0])
joinTriangle(185);
translate(v=[45.5,0,-15])
rotate(a=[90,90,0])
joinTriangle(185);
}
// bottom lugs
union() {
translate(v=[-40,-90,-29])
cube(size=[10.2,10.2,2.5], center=true);
translate(v=[40,-90,-29])
cube(size=[10.2,10.2,2.5],center=true);
translate(v=[40,90,-29])
cube(size=[10.2,10.2,2.5],center=true);
translate(v=[-40,90,-29])
cube(size=[10.2,10.2,2.5],center=true);
}
}
}
module topTray() {
difference () {
union() {
difference() {
caseWithMountHoles();
translate(v=[0,0,-115])
cube(size=[500,500,200], center=true);
}
}
// bottom lugs
union() {
translate(v=[-40,-90,29])
cube(size=[10.2,10.2,2.5], center=true);
translate(v=[40,-90,29])
cube(size=[10.2,10.2,2.5],center=true);
translate(v=[40,90,29])
cube(size=[10.2,10.2,2.5],center=true);
translate(v=[-40,90,29])
cube(size=[10.2,10.2,2.5],center=true);
translate(v=[-45.5,0,-15])
rotate(a=[90,90,0])
scale(v=[1,0.9,1])
joinTriangle(300);
translate(v=[45.5,0,-15])
rotate(a=[90,90,0])
scale(v=[1,0.9,1])
joinTriangle(300);
}
}
}
topTray();
// TODO make sure rail works!!!
scale(v=[1,0.9,1])
*joinTriangle(10);

View File

@ -1,66 +0,0 @@
include <./rockpro.scad>;
include <../power/src/base.scad>;
$fn = 128;
outerD = 4.65;
innerD = 2.93;
module caseOuter() {
rotate(a=[90,0,0])
minkowski() {
cube(size=[80,40,195], center=true);
cylinder(h=0.00000000001, r=10);
}
}
module caseInner() {
translate(v=[0,0,2])
rotate(a=[90,0,0])
minkowski() {
cube(size=[81.5,47,195+0.01], center=true);
*cylinder(h=0.00000000001, r=5);
}
}
module caseShell() {
difference() {
caseOuter();
union() {
caseInner();
// side perforations
for (i=[-7:7]) {
hgill(i=i);
}
// top perforations
for (i=[-3:3]) {
translate(v=[0,i*20,50])
cube(size=[75,10,60], center=true);
}
// bottom perforations
for (i=[2:4]) {
translate(v=[0,i*20,-20])
cube(size=[60,8,50], center=true);
}
for (i=[-4:0]) {
translate(v=[0,i*20,-20])
cube(size=[60,8,50], center=true);
}
}
}
}
caseShell();

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -25,15 +25,15 @@ module sineWave(length, resolution, amplitudeFunction, period, shift) {
idx_curr = i * dx; idx_curr = i * dx;
hull() { hull() {
translate(v = [idx_prev, amplitudeFunction(idx_prev) * sinR(p * idx_prev + shift), 0]) translate(v = [idx_prev, amplitudeFunction(idx_prev) * sinR(p * idx_prev + shift), 0])
cube(size = [0.1, 1, 1]); cube(size = [0.1, 2, 2]);
translate(v = [idx_curr, amplitudeFunction(idx_curr) * sinR(p * idx_curr + shift), 0]) translate(v = [idx_curr, amplitudeFunction(idx_curr) * sinR(p * idx_curr + shift), 0])
cube(size = [0.1, 1, 1]); cube(size = [0.1, 2, 2]);
translate(v = [idx_curr, -10, 0]) translate(v = [idx_curr, -10, 0])
cube(size=[0.1,1,1]); cube(size=[0.1,2,2]);
translate(v = [idx_prev, -10, 0]) translate(v = [idx_prev, -10, 0])
cube(size=[0.1,1,1]); cube(size=[0.1,2,2]);
} }
} }
} }
@ -47,15 +47,15 @@ module sineWaveHull(length, resolution, amplitudeFunction, period, shift, hullDi
idx_curr = i * dx; idx_curr = i * dx;
hull() { hull() {
translate(v = [idx_prev, amplitudeFunction(idx_prev) * sinR(p * idx_prev + shift), 0]) translate(v = [idx_prev, amplitudeFunction(idx_prev) * sinR(p * idx_prev + shift), 0])
cube(size = [0.1, 1, 1]); cube(size = [0.1, 2, 2]);
translate(v = [idx_curr, amplitudeFunction(idx_curr) * sinR(p * idx_curr + shift), 0]) translate(v = [idx_curr, amplitudeFunction(idx_curr) * sinR(p * idx_curr + shift), 0])
cube(size = [0.1, 1, 1]); cube(size = [0.1, 2, 2]);
translate(v = [idx_curr, -hullDiff, 0]) translate(v = [idx_curr, -hullDiff, 0])
cube(size=[0.1,1,1]); cube(size=[0.1,2,2]);
translate(v = [idx_prev, -hullDiff, 0]) translate(v = [idx_prev, -hullDiff, 0])
cube(size=[0.1,1,1]); cube(size=[0.1,2,2]);
} }
} }
} }