DIY_3D_Printer/Slider_back.scad
2021-12-19 19:20:46 +01:00

97 lines
2.8 KiB
OpenSCAD

use <helpers/Holes.scad>;
include <Slider_dims.scad>;
Slider_back();
module Slider_back() {
difference() {
union() {
body();
zcube();
}
dist=(heightMain-holeDist)/2;
translate([0,0,dist]) bearingHalfHoles();
translate([0,0,dist+holeDist]) bearingHalfHoles();
cubecenter=heightMain/2-rollWithRodDist/2;
translate([0, 0, heightMain/2]) cube([width, 5, rollWithRodDist]);
translate([0, -5, cubecenter]) beltHolder();
translate([width, -5, cubecenter]) rotate([0, 180, 0]) beltHolder();
// add the 4 mountholes
MountHoles();
}
}
module body() {
edgeRound=1.5;
translate([edgeRound, 0, edgeRound]) minkowski() {
cube([width-edgeRound*2, depth/2, heightMain-edgeRound*2]);
rotate([-90, 0, 0]) cylinder(r=edgeRound,h=depth/2);
}
}
// add the offset cube with the triangle to have space for the belts in it
module zcube() {
cubez=heightMain/2-rollWithRodDist;
translate([0, -5, cubez]) cube([width, 5, rollWithRodDist]);
// the bottom triangle
translate([0, 0, cubez]) rotate([-90,0,-90]) linear_extrude(width) #polygon([[0,0],[5,0],[0,5]]);
}
function getBearingLength() = bearingLength;
module bearingHalfHoles() {
sideDist=3;
//rotate([0, 90, 0]) cylinder(h = width, d = 8+2); // we are defining +1mm to fit the rod in the hole...
translate([sideDist,0,0]) bearingHalfHole();
translate([width-bearingLength-sideDist,0,0]) bearingHalfHole();
}
module bearingHalfHole(rodln=bearingLength+10) {
#translate([(bearingLength - rodln)/2,0,0]) rotate([0, 90, 0]) cylinder(h = rodln, d = 8+2);
rotate([0, 90, 0]) cylinder(h = bearingLength, d = bearingDiam);
}
module beltHolder() {
translate([0, 0, -twoRodSize/2]) {
cube([17, 10, twoRodSize]);
translate([20, 0, twoRodSize/2]) rotate([-90, 0, 0]) difference() {
hull() {
cylinder(r=middleCylinderOuterRad, h=10);
#translate([-5, 0, 0]) #cylinder(r=1, h=10);
}
cylinder(r=middleCylinderRad, h=10);
}
}
}
module MountHoles() {
translate([holeLeftRightMargin,0,holeTop]) {
rotate([0,0,90]) #M3Hole(10);
translate([0,5,0]) rotate([0,0,90]) M3Nut(5);
}
translate([width-holeLeftRightMargin,0,holeTop]) {
rotate([0,0,90]) #M3Hole(10);
translate([0,5,0]) rotate([0,0,90]) M3Nut(5);
}
translate([holeLeftRightMargin,0,holeBottom]) {
translate([0,-5,0]) rotate([0,0,90]) #M3Hole(15);
translate([0,5,0]) rotate([0,0,90]) M3Nut(10);
}
translate([width-holeLeftRightMargin,0,holeBottom]) {
translate([0,-5,0]) rotate([0,0,90]) #M3Hole(15);
translate([0,5,0]) rotate([0,0,90]) M3Nut(10);
}
}