format all files

add 3dprinter.scad where to simulate the whole 3dprinter should look like
This commit is contained in:
lukas 2021-01-04 19:08:21 +01:00
parent 77607f2ecc
commit b26be99f4e
5 changed files with 212 additions and 130 deletions

62
3dprinter.scad Normal file
View File

@ -0,0 +1,62 @@
use <angle_bracket.scad>;
use <horizontal_angle_bracket.scad>;
use <Motorhalter.scad>;
use <YRollHolder.scad>;
bottmoutline();
bottomAngleBrackets();
horizontalProfile();
YAxis();
module bottmoutline() {
// draw alu profiles
translate([0, - 40, 0]) aluProfile(400);
translate([0, 400, 0]) aluProfile(400);
translate([0, - 40, 0]) rotate([0, 0, 90]) aluProfile(480);
translate([440, - 40, 0]) rotate([0, 0, 90]) aluProfile(480);
}
module bottomAngleBrackets() {
// draw angle bracktes
angle_bracket();
translate([400, 0, 0]) rotate([0, 0, 90]) angle_bracket();
translate([400, 400, 0]) rotate([0, 0, 180]) angle_bracket();
translate([0, 400, 0]) rotate([0, 0, 270]) angle_bracket();
}
module horizontalProfile() {
height = 600;
translate([- 40, 180, 0]) rotate([0, - 90, 0]) halfAluProfile(height);
translate([460, 180, 0]) rotate([0, - 90, 0]) halfAluProfile(height);
// upper part
translate([- 60, 180, height]) halfAluProfile(520);
// add the horitzontal angle bracktes
translate([- 40, 135, 0]) rotate([0, 0, 90]) horizontal_angle_bracket();
translate([440, 265, 0]) rotate([0, 0, 270]) horizontal_angle_bracket();
// angle brackets up
translate([- 40, 220, height]) rotate([90, 90, 0]) angle_bracket();
translate([440, 180, height]) rotate([-90, 90, 0]) angle_bracket();
}
module YAxis() {
translate([160, 0, 0]) Motorhalter();
translate([214, 400, 0]) rotate([0, 0, 180]) YRollHolder();
}
// -- MODULES -- //
module aluProfile(length) {
color("#dddddd") cube([length, 40, 40]);
}
module halfAluProfile(length) {
color("#dddddd") cube([length, 40, 20]);
}

View File

@ -1,64 +1,71 @@
$fn=50;
$fn = 50;
motorheight=42.1;
motorwidth=40.5;
wanddickemotor=3;
wanddickelinks=5.5;
motorheight = 42.1;
motorwidth = 40.5;
wanddickemotor = 3;
wanddickelinks = 5.5;
cylinderdiameter=22.2;
cylinderdiameter = 22.2;
motorholedistance=(motorheight-31) /2;
leftholedist=7;
M3HoleDiam=3.4;
M3HeadDiam=5.8;
motorholedistance = (motorheight - 31) / 2;
leftholedist = 7;
M3HoleDiam = 3.4;
M3HeadDiam = 5.8;
render() difference() {
Motorhalter();
module Motorhalter() {
render() difference() {
mainbody();
translate([motorwidth,wanddickelinks,0]) motorholes();
translate([motorwidth, wanddickelinks, 0]) motorholes();
leftholes();
}
}
//modules
module mainbody(){
cube([motorwidth + wanddickemotor, wanddickelinks ,motorheight]);
module mainbody() {
cube([motorwidth + wanddickemotor, wanddickelinks, motorheight]);
translate([motorwidth,wanddickelinks,0])cube([wanddickemotor, motorheight, motorheight]);
translate([motorwidth, wanddickelinks, 0])cube([wanddickemotor, motorheight, motorheight]);
translate([motorwidth + wanddickemotor,motorheight * 2 /3,motorheight]) rotate([0,0,180]) linear_extrude(3) polygon([[0,0], [0, motorheight * 2 /3], [motorwidth * 2 /3, motorheight* 2 /3]]);
translate([motorwidth + wanddickemotor, motorheight * 2 / 3, motorheight]) rotate([0, 0, 180]) linear_extrude(3)
polygon([[0, 0], [0, motorheight * 2 / 3], [motorwidth * 2 / 3, motorheight * 2 / 3]]);
}
module motorholes(){
translate([0,motorheight/2,motorheight/2])rotate([0,90,0])cylinder(h=wanddickemotor, d=cylinderdiameter, $fn=130);
module motorholes() {
translate([0, motorheight / 2, motorheight / 2])rotate([0, 90, 0])cylinder(h = wanddickemotor, d = cylinderdiameter,
$fn = 130);
translate([0,motorheight - motorholedistance,motorheight - motorholedistance]) MotorM3Hole();
translate([0, motorheight - motorholedistance, motorheight - motorholedistance]) MotorM3Hole();
translate([0,motorheight - motorholedistance, motorholedistance]) MotorM3Hole();
translate([0, motorheight - motorholedistance, motorholedistance]) MotorM3Hole();
translate([0,motorholedistance,motorheight - motorholedistance]) MotorM3Hole();
translate([0, motorholedistance, motorheight - motorholedistance]) MotorM3Hole();
translate([0,motorholedistance, motorholedistance]) MotorM3Hole();
translate([0, motorholedistance, motorholedistance]) MotorM3Hole();
}
module leftholes() {
// bottom left
translate([leftholedist,0,leftholedist]) LeftM3Hole();
translate([leftholedist, 0, leftholedist]) LeftM3Hole();
//bottom right
translate([motorwidth - leftholedist,0,leftholedist]) LeftM3Hole();
translate([motorwidth - leftholedist, 0, leftholedist]) LeftM3Hole();
// upper left
translate([leftholedist,0,motorwidth - leftholedist]) LeftM3Hole();
translate([leftholedist, 0, motorwidth - leftholedist]) LeftM3Hole();
// upper right
translate([motorwidth - leftholedist,0,motorwidth - leftholedist]) LeftM3Hole();
translate([motorwidth - leftholedist, 0, motorwidth - leftholedist]) LeftM3Hole();
}
module MotorM3Hole() {
rotate([0,90,0])cylinder(h=wanddickemotor, d=M3HoleDiam);
rotate([0, 90, 0])cylinder(h = wanddickemotor, d = M3HoleDiam);
}
module LeftM3Hole() {
rotate([270,0,0])cylinder(h=wanddickelinks, d=M3HoleDiam);
translate([0,wanddickelinks-3,0]) rotate([270,0,0])cylinder(h=3, d=M3HeadDiam);
rotate([270, 0, 0])cylinder(h = wanddickelinks, d = M3HoleDiam);
translate([0, wanddickelinks - 3, 0]) rotate([270, 0, 0])cylinder(h = 3, d = M3HeadDiam);
}

View File

@ -1,41 +1,45 @@
$fn=33;
$fn = 33;
M3HoleDiam=3.4;
M3HoleDiam = 3.4;
height=40;
thickness=3;
length=30;
height = 40;
thickness = 3;
length = 30;
// cambelt has 6mm width
innerspace=8;
innerspace = 8;
render() difference() {
// call main
YRollHolder();
module YRollHolder() {
render() difference() {
frame();
holes();
}
}
module frame() {
cube([innerspace + 2 * thickness,thickness,height]);
cube([innerspace + 2 * thickness, thickness, height]);
translate([0, thickness, 0]) cube([thickness, length, height]);
translate([innerspace + thickness, thickness, 0]) cube([thickness, length, height]);
}
module holes(){
module holes() {
// two inner holes
translate([innerspace / 2 + thickness, 0, height / 4]) M3Hole();
translate([innerspace / 2 + thickness, 0, height / 4 * 3]) M3Hole();
translate([0, length / 4 *3, height / 2]) SideM3Hole();
translate([0, length / 4 * 3, height / 2]) SideM3Hole();
translate([innerspace + thickness, length / 4 * 3, height / 2]) SideM3Hole();
}
module M3Hole() {
rotate([0,90,90])cylinder(h=thickness, d=M3HoleDiam);
rotate([0, 90, 90])cylinder(h = thickness, d = M3HoleDiam);
}
module SideM3Hole() {
rotate([0,90,0])cylinder(h=thickness, d=M3HoleDiam);
rotate([0, 90, 0])cylinder(h = thickness, d = M3HoleDiam);
}

View File

@ -1,55 +1,59 @@
$fn=33;
$fn = 33;
height=40;
width=60;
b=3;
triagleheight=5;
height = 40;
width = 60;
b = 3;
triagleheight = 5;
M4HoleDiam=4.4;
M4HoleDiam = 4.4;
holedistance=10;
holedistance = 10;
// main call
angle_bracket();
difference() {
module angle_bracket() {
render() difference() {
frame();
holes();
}
}
module frame() {
// x plate
cube([width,b,height]);
cube([width, b, height]);
// y plate
translate([b, 0,0]) rotate([0,0,90]) cube([width,b,height]);
// y plate
translate([b, 0, 0]) rotate([0, 0, 90]) cube([width, b, height]);
//bottom triangle
translate([b,b,0]) stabilizetriangle();
// upper triangle
translate([b,b,height-triagleheight]) stabilizetriangle();
//bottom triangle
translate([b, b, 0]) stabilizetriangle();
// upper triangle
translate([b, b, height - triagleheight]) stabilizetriangle();
}
module holes() {
// y holes
translate([0,holedistance,height-holedistance]) YM3Hole();
translate([0,width-holedistance,height-holedistance]) YM3Hole();
translate([0,holedistance,holedistance]) YM3Hole();
translate([0,width-holedistance,holedistance]) YM3Hole();
translate([0, holedistance, height - holedistance]) YM3Hole();
translate([0, width - holedistance, height - holedistance]) YM3Hole();
translate([0, holedistance, holedistance]) YM3Hole();
translate([0, width - holedistance, holedistance]) YM3Hole();
translate([holedistance,0,height-holedistance]) XM3Hole();
translate([width-holedistance,0,height-holedistance]) XM3Hole();
translate([holedistance,0,holedistance]) XM3Hole();
translate([width-holedistance,0,holedistance]) XM3Hole();
translate([holedistance, 0, height - holedistance]) XM3Hole();
translate([width - holedistance, 0, height - holedistance]) XM3Hole();
translate([holedistance, 0, holedistance]) XM3Hole();
translate([width - holedistance, 0, holedistance]) XM3Hole();
}
module stabilizetriangle() {
linear_extrude(triagleheight) polygon([[0,0], [0, width-b], [width-b, 0]]);
linear_extrude(triagleheight) polygon([[0, 0], [0, width - b], [width - b, 0]]);
}
module YM3Hole() {
rotate([0,90,0])cylinder(h=b, d=M4HoleDiam);
rotate([0, 90, 0])cylinder(h = b, d = M4HoleDiam);
}
module XM3Hole() {
rotate([270,0,0])cylinder(h=b, d=M4HoleDiam);
rotate([270, 0, 0])cylinder(h = b, d = M4HoleDiam);
}

View File

@ -1,60 +1,65 @@
$fn=33;
$fn = 33;
height=40;
hwidth=40;
thickness=5;
height = 40;
hwidth = 40;
thickness = 5;
vthickness=20;
vwidth=40.3;
vheight=80;
vthickness = 20;
vwidth = 40.3;
vheight = 80;
//https://de.wikipedia.org/wiki/Durchgangsbohrung
M4HoleDiam=4.4;
M4HoleDiam = 4.4;
holedistance=10;
holedistance = 10;
horizontalcenterholes=true;
horizontalcenterholes = true;
difference() {
// calling main
horizontal_angle_bracket();
module horizontal_angle_bracket() {
render() difference() {
frame();
holes();
}
}
module frame(){
module frame() {
// left tile
cube([hwidth,thickness,height]);
translate([0,thickness,0]) sidetriangle();
translate([0,thickness,height - thickness]) sidetriangle();
cube([hwidth, thickness, height]);
translate([0, thickness, 0]) sidetriangle();
translate([0, thickness, height - thickness]) sidetriangle();
// left to back tile
translate([hwidth,0,0]) cube([thickness, vthickness, height]);
translate([hwidth, 0, 0]) cube([thickness, vthickness, height]);
// left triangle
translate([hwidth,0,height]) rotate([90, 0, 90]) middletriangle();
translate([hwidth, 0, height]) rotate([90, 0, 90]) middletriangle();
// covers upper edge of above
translate([hwidth, vthickness, 0]) cube([vwidth + thickness * 2, thickness, vheight]);
// right to back tile
translate([hwidth + vwidth + thickness,0,0]) cube([thickness, vthickness, height]);
// right to back tile
translate([hwidth + vwidth + thickness, 0, 0]) cube([thickness, vthickness, height]);
// right triangle
translate([hwidth + vwidth + thickness,0,height]) rotate([90, 0, 90]) middletriangle();
translate([hwidth + vwidth + thickness, 0, height]) rotate([90, 0, 90]) middletriangle();
// right tile
translate([hwidth + vwidth + thickness * 2, 0, 0]) cube([hwidth,thickness,height]);
// right tile
translate([hwidth + vwidth + thickness * 2, 0, 0]) cube([hwidth, thickness, height]);
translate([hwidth * 2 + vwidth + thickness * 2,thickness,thickness]) rotate([0, 180,0 ]) sidetriangle();
translate([hwidth * 2 + vwidth + thickness * 2,thickness,height]) rotate([0, 180,0 ]) sidetriangle();
translate([hwidth * 2 + vwidth + thickness * 2, thickness, thickness]) rotate([0, 180, 0]) sidetriangle();
translate([hwidth * 2 + vwidth + thickness * 2, thickness, height]) rotate([0, 180, 0]) sidetriangle();
}
module middletriangle(){
linear_extrude(thickness) polygon([[0,0], [vthickness, 0], [vthickness, vheight-height]]);
module middletriangle() {
linear_extrude(thickness) polygon([[0, 0], [vthickness, 0], [vthickness, vheight - height]]);
}
module sidetriangle() {
linear_extrude(5) polygon([[0,0], [hwidth, 0], [hwidth, vthickness]]);
linear_extrude(5) polygon([[0, 0], [hwidth, 0], [hwidth, vthickness]]);
}
module holes() {
@ -62,13 +67,13 @@ module holes() {
leftholes();
// right holes
translate([hwidth + vwidth + thickness * 2,0,0]) leftholes();
translate([hwidth + vwidth + thickness * 2, 0, 0]) leftholes();
// center holes
translate([hwidth + thickness,vthickness,0]) centerholes();
translate([hwidth + thickness, vthickness, 0]) centerholes();
}
module leftholes(){
module leftholes() {
translate([holedistance, 0, holedistance]) XM3Hole();
translate([hwidth - holedistance, 0, holedistance]) XM3Hole();
translate([holedistance, 0, height - holedistance]) XM3Hole();
@ -81,7 +86,7 @@ module centerholes() {
translate([holedistance, 0, vheight - holedistance]) XM3Hole();
translate([vwidth - holedistance, 0, vheight - holedistance]) XM3Hole();
if(horizontalcenterholes){
if (horizontalcenterholes) {
// center holes
translate([vwidth - holedistance, 0, vheight / 2]) XM3Hole();
translate([holedistance, 0, vheight / 2]) XM3Hole();
@ -89,5 +94,5 @@ module centerholes() {
}
module XM3Hole() {
rotate([270,0,0])cylinder(h=thickness, d=M4HoleDiam);
rotate([270, 0, 0])cylinder(h = thickness, d = M4HoleDiam);
}