Stairs/case/StairCase.scad

97 lines
2.1 KiB
OpenSCAD
Raw Normal View History

caseBottom();
$fa = 1;
$fs = 1;
module caseBottom()
{
innerX = 80;
innerY = 70;
innerZ = 35;
wallThickness = 2;
totalX = innerX + (2 * wallThickness);
totalY = innerY + (2 * wallThickness);
totalZ = innerZ + wallThickness;
difference()
{
cube([totalX, totalY, totalZ]);
translate([wallThickness, wallThickness, wallThickness])
cube([innerX, innerY, totalZ]);
// Hole for the LED cables
translate([-1, totalY / 2, 25])
rotate([0, 90, 0])
cylinder(d = 15, h = wallThickness + 2);
// Hole for the power cable
translate([62, totalY + 1, wallThickness + 2.5])
rotate([90, 0, 0])
cylinder(d = 5, h = wallThickness + 2);
}
translate([wallThickness, wallThickness, wallThickness])
{
translate([4, 4, 0])
PCA9685Mount();
translate([40, 20, 0])
ESP8266PlusPowerMount();
}
}
module PCA9685Mount()
{
totalX = 25.5;
totalY = 62.5;
pinDistanceX = 19;
pinDistanceY = 56;
pinDiameter = 2.3;
pinHeight = 3;
supportDiameter = 4;
supportHeight = 4;
offsetX = (totalX - pinDistanceX) / 2;
offsetY = (totalY - pinDistanceY) / 2;
for (x = [offsetX, offsetX + pinDistanceX])
for (y = [offsetY, offsetY + pinDistanceY])
translate([x, y, 0])
{
cylinder(d = supportDiameter, h = supportHeight);
translate([0, 0, supportHeight])
cylinder(d = pinDiameter, h = pinHeight);
}
}
// I didn't put any actual mount points in the perfboard,
// so I'll settle for some corner pieces to align it and
// use the ultimate maker's friend: hot glue.
module ESP8266PlusPowerMount()
{
innerX = 34;
innerY = 35;
cornerSize = 6;
cornerThickness = 2;
cornerHeight = 2;
totalX = innerX + (2 * cornerThickness);
totalY = innerY + (2 * cornerThickness);
difference()
{
cube([totalX, totalY, cornerHeight]);
translate([cornerThickness, cornerThickness, -1])
cube([innerX, innerY, cornerHeight + 2]);
translate([-1, cornerSize, -1])
cube([totalX + 2, totalY - (2 * cornerSize), cornerHeight + 2]);
translate([cornerSize, -1, -1])
cube([totalX - (2 * cornerSize), totalY + 2, cornerHeight + 2]);
}
}