Skip to content

Instantly share code, notes, and snippets.

@garyhodgson
Last active December 16, 2015 03:09
Show Gist options
  • Save garyhodgson/5367679 to your computer and use it in GitHub Desktop.
Save garyhodgson/5367679 to your computer and use it in GitHub Desktop.
function main(){
return CSG.cube({center: [0,0,0],radius: [5,17.5,4.125], resolution: 16}).subtract([CSG.cube({center: [3,3,4.135],radius: [3,3,4.135], resolution: 16}).subtract([CSG.cylinder({start: [0,0,0], end: [0,0,8.27],radiusStart: 3, radiusEnd: 3, resolution: 12})]).translate([-3,-3,-4.135]).translate([5,17.5,0]).rotateX(0).rotateY(0).rotateZ(0).union([CSG.cube({center: [0,0,5.01],radius: [0,0,5.01], resolution: 16}).translate([0,0,-5.01]).translate([4.125,17.5,0]).rotateX(0).rotateY(-90).rotateZ(0),CSG.cube({center: [0,0,5.01],radius: [0,0,5.01], resolution: 16}).translate([0,0,-5.01]).translate([4.125,17.5,0]).rotateX(360).rotateY(90).rotateZ(0)]).union([CSG.cube({center: [3,3,4.135],radius: [3,3,4.135], resolution: 16}).subtract([CSG.cylinder({start: [0,0,0], end: [0,0,8.27],radiusStart: 3, radiusEnd: 3, resolution: 12})]).translate([-3,-3,-4.135]).translate([17.5,5,0]).rotateX(0).rotateY(0).rotateZ(90),CSG.cube({center: [0,0,17.51],radius: [0,0,17.51], resolution: 16}).translate([0,0,-17.51]).translate([4.125,5,0]).rotateX(90).rotateY(-90).rotateZ(0),CSG.cube({center: [0,0,17.51],radius: [0,0,17.51], resolution: 16}).translate([0,0,-17.51]).translate([4.125,5,0]).rotateX(270).rotateY(90).rotateZ(0)]).union([CSG.cube({center: [3,3,4.135],radius: [3,3,4.135], resolution: 16}).subtract([CSG.cylinder({start: [0,0,0], end: [0,0,8.27],radiusStart: 3, radiusEnd: 3, resolution: 12})]).translate([-3,-3,-4.135]).translate([5,17.5,0]).rotateX(0).rotateY(0).rotateZ(180),CSG.cube({center: [0,0,5.01],radius: [0,0,5.01], resolution: 16}).translate([0,0,-5.01]).translate([4.125,17.5,0]).rotateX(180).rotateY(-90).rotateZ(0),CSG.cube({center: [0,0,5.01],radius: [0,0,5.01], resolution: 16}).translate([0,0,-5.01]).translate([4.125,17.5,0]).rotateX(180).rotateY(90).rotateZ(0)]).union([CSG.cube({center: [3,3,4.135],radius: [3,3,4.135], resolution: 16}).subtract([CSG.cylinder({start: [0,0,0], end: [0,0,8.27],radiusStart: 3, radiusEnd: 3, resolution: 12})]).translate([-3,-3,-4.135]).translate([17.5,5,0]).rotateX(0).rotateY(0).rotateZ(270),CSG.cube({center: [0,0,17.51],radius: [0,0,17.51], resolution: 16}).translate([0,0,-17.51]).translate([4.125,5,0]).rotateX(270).rotateY(-90).rotateZ(0),CSG.cube({center: [0,0,17.51],radius: [0,0,17.51], resolution: 16}).translate([0,0,-17.51]).translate([4.125,5,0]).rotateX(90).rotateY(90).rotateZ(0)])]);
};
// PRUSA iteration3
// Configuration file
// GNU GPL v3
// Josef Pr?sa <josefprusa@me.com>
// Vรกclav 'ax' H?la <axtheb@gmail.com>
// http://www.reprap.org/wiki/Prusa_Mendel
// http://github.com/prusajr/PrusaMendel
// PLEASE SELECT ONE OF THE CONFIGURATIONS BELOW
// BY UN-COMMENTING IT
// functions
// PRUSA iteration3
// Functions used in many files
// GNU GPL v3
// Josef Pr?Å¡a <josefprusa@me.com>
// Václav 'ax' H?la <axtheb@gmail.com>
// Vlnofka <>
// http://www.reprap.org/wiki/Prusa_Mendel
// http://github.com/prusajr/PrusaMendel
module chamfer(x=10,y=10,z=10) {
rotate(a=[90,-90,0])
linear_extrude(height = y, center = true, convexity = 2, twist = 0)
polygon(points = [
[-1.00,-1.00]
,[-1.00,x-1.00]
,[0.00,x]
,[z,0.00]
,[z-1.00,-1.00]
]
,paths = [
[0,1,2,3,4]]
);
}
// This will size an outer diameter to fit inside dia with $fn sides
// use this to set the diameter before passing to polyhole
function hole_fit( dia=0,$fn=0) = dia/cos(180/(($fn>0) ? $fn : 0.01));
// This determines the number of sides of a hole that is printable
// I added +1 because nobody wants to print a triangle. (plus it looks nicer, havn't tested printability yet.)
function poly_sides(d) = (max(round(2 * d),3)+1);
// Based on nophead research
module polyhole(d, d1, d2, h, center=false, $fn=0) {
n = max((($fn>0) ? $fn : poly_sides(d)), (($fn>0) ? $fn : poly_sides(d1)), (($fn>0) ? $fn : poly_sides(d2)));
cylinder(h = h, r = (d / 2), r1 = (d1 / 2), r2 = (d2 / 2), $fn = n, center=center);
}
// make it interchangeable between this and cylinder
module cylinder_poly(r, r1, r2, h, center=false, $fn=0){
polyhole(d=r*2, d1=r1*2, d2=r2*2, h=h, center=center, $fn=$fn);
}
module cylinder_slot(r=0, r1, r2, h, length=0, center=false, $fn=0) {
n = ($fn > 0) ? $fn : max(poly_sides(r*2), poly_sides(r1*2), poly_sides(r2*2));
union() {
rotate([0,0, 180/n]) cylinder_poly(h=h, r=r, r1=r1, r2=r2, center=center, $fn=n);
if (length>0) {
translate([((center) ? length/2 : 0),((center) ? 0 : -((r>0) ? r : r1)*cos(180/n)), 0]) trapezoid(cube=[length, ((r>0) ? r*2 : r1*2) *cos(180/n),h], y1=(r1-r2)*cos(180/n), y2=(r1-r2)*cos(180/n), center=center);
//cube([length, dia*cos(180/n),h]);
translate([length, 0, 0]) rotate([0,0, 180/n]) cylinder_poly(h=h, r=r, r1=r1, r2=r2, center=center, $fn=n);
}
}
}
module trapezoid(cube=[10, 10, 10], x1=0, x2=0, y1=0, y2=0, center=false) {
translate((center) ? [0,0,0] : [cube[0]/2, cube[1]/2, cube[2]/2] ) {
difference() {
translate([0, 0 ,0]) cube(cube, center=true);
if (x2 >0 ) translate([cube[0]/2, -(cube[1]+0.1)/2, -cube[2]/2]) rotate([0,-atan(x2/cube[2]),0]) cube([x2*cos(atan(x2/cube[2]))+0.1, cube[1]+0.1, sqrt( pow(cube[2], 2) + pow(x2, 2))]);
if (x1 >0 ) translate([-cube[0]/2, -(cube[1]+0.1)/2, -cube[2]/2]) rotate([0,atan(x1/cube[2]),0]) translate([ -(x1*cos(atan(x1/cube[2]))+0.1), 0, 0]) cube([x1*cos(atan(x1/cube[2]))+0.1, cube[1]+0.1, sqrt( pow(cube[2], 2) + pow(x1, 2))]);
if (y1 >0 ) translate([-(cube[0]+0.1)/2, -cube[1]/2, -cube[2]/2]) rotate([-atan(y1/cube[2]),0,0]) translate([ 0, -(y1*cos(atan(y1/cube[2]))+0.1), 0]) cube([cube[0]+0.1, y1*cos(atan(y1/cube[2]))+0.1, sqrt( pow(cube[2], 2) + pow(y1, 2))]);
if (y2 >0 ) translate([-(cube[0]+0.1)/2, cube[1]/2, -cube[2]/2]) rotate([atan(y2/cube[2]),0,0]) cube([cube[0]+0.1, y2*cos(atan(y2/cube[2]))+0.1, sqrt( pow(cube[2], 2) + pow(y2, 2))]);
}
}
}
module fillet(radius, height=100, $fn=0) {
//this creates acutal fillet
n = ($fn>0) ? $fn : (ceil(poly_sides(radius*2)/4)*4);
translate([-radius, -radius, -height/2-0.01])
difference() {
cube([radius*2, radius*2, height+0.02]);
cylinder(r=radius, h=height+0.02, $fn=n);
}
}
module cube_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=0){
//
render(convexity = 2)
if (use_fillets) {
if (center) {
cube_fillet_inside(size, radius, vertical, top, bottom, $fn);
} else {
translate([size[0]/2, size[1]/2, size[2]/2])
cube_fillet_inside(size, radius, vertical, top, bottom, $fn);
}
} else {
cube(size, center);
}
}
module cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=0){
j=[1,0,1,0];
for (i=[0:3]) {
if (radius > -1) {
rotate([0, 0, 90*i]) translate([size[1-j[i]]/2, size[j[i]]/2, 0]) fillet(radius, size[2], $fn=$fn);
} else {
rotate([0, 0, 90*i]) translate([size[1-j[i]]/2, size[j[i]]/2, 0]) fillet(vertical[i], size[2], $fn=$fn);
}
rotate([90*i, -90, 0]) translate([size[2]/2, size[j[i]]/2, 0 ]) fillet(top[i], size[1-j[i]], $fn=$fn);
rotate([90*(4-i), 90, 0]) translate([size[2]/2, size[j[i]]/2, 0]) fillet(bottom[i], size[1-j[i]], $fn=$fn);
}
}
module cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=0){
//makes CENTERED cube with round corners
// if you give it radius, it will fillet vertical corners.
//othervise use vertical, top, bottom arrays
//when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise
//top/bottom fillet starts in direction of Y axis and goes CCW too
if (radius == 0) {
cube(size, center=true);
} else {
difference() {
cube(size, center=true);
cube_negative_fillet(size, radius, vertical, top, bottom, $fn);
}
}
}
// PRUSA iteration3
// Default metric sizes
// GNU GPL v3
// Josef Průša <josefprusa@me.com>
// http://www.reprap.org/wiki/Prusa_Mendel
// http://github.com/prusajr/PrusaMendel
// DONT CHANGE THIS FILE! ALTER VALUES IN CONFIGURATION.SCAD INSTEAD
// RODS
threaded_rod_diameter = 8.7;
threaded_rod_diameter_horizontal = 8.7;
smooth_bar_diameter = 8;
smooth_bar_diameter_horizontal = 8.5;
// Nuts and bolts
m8_diameter = 9;
m8_nut_diameter = 14.1;
m4_diameter = 4.5;
m4_nut_diameter = 9;
m3_diameter = 3.6;
m3_nut_diameter = 5.3;
m3_nut_diameter_horizontal = 6.1;
m3_washer_diameter = 6.9;
// Motors
motor_shaft = 5.5;
// PRUSA iteration3
// Bushing and bering dimensions
// GNU GPL v3
// Václav 'ax' Hůla <axtheb@gmail.com>
// http://www.reprap.org/wiki/Prusa_Mendel
// http://github.com/prusajr/PrusaMendel
//
// each config is in form[r_rod, r, h, type, name] where:
// r_rod is smooth rod radius [0]
// r is outer bushing radius needed for tight fit or bearing radius with loose fit [1]
// h is barrel length [2]
// type is 0 for linear bearings, 1 is for bushings which needs to be enclosed fully. [3]
// is it alo assumed that type 1 has flange and type 0 has not
// name is human readable name [4]
conf_b_igus = [4, 5.1, 10, 1, "igus J(V)FM 0810-10 or GFM 0810-10"];
conf_b_lm8uu = [4, 7.7, 24, 0, "lm8uu bearing (standard)"];
conf_b_igus10 = [5, 6.1, 10, 1, "igus J(V)FM 1012-10"];
conf_b_lm10uu = [5, 9.7, 29, 0, "lm10uu bearing (10mm smooth rod)"];
conf_b_lm10luu = [5, 9.7, 55, 0, "lm10luu bearing (10mm smooth rod, long)"];
conf_b_lme8uu =[4, 8.2, 25, 0, "lme8uu bearing"];
conf_b_lm8luu = [4, 7.7, 45, 0, "lm8luu bearing (double length)"];
conf_b_bronze = [4, 8, 11, 1, "bronze self-aligning bushing, 8mm"];
conf_b_lm12uu = [6, 10.6, 30, 0, "lm12uu bearing (12mm smooth rod)"];
conf_b_lm12luu = [6, 10.6, 57, 0, "lm12luu bearing (12mm, double length)"];
// extrusion parameters
// width=0
// slot_width=1
// slot_inner_width=2
// thin_wall=3
// center_square=4
// hole_dia=5
// 10 series 8020 (inch)
conf_ex_8020_10s = [25.4, 6.477, 14.859, 2.21, 9.02, 5.2];
// 15 series 8020 (inch)
conf_ex_8020_15s = [38.1, 8.128, 20.574, 2.21, 13.487, 6.655];
// 20 series 8020
conf_ex_8020_20s = [20, 5.26, 11.99, 1.5, 7.31, 4.19];
// 25 series 8020
conf_ex_8020_25s = [25, 6.5, 14.86, 2.14, 8.1, 5];
// 30 series 8020
conf_ex_8020_30s = [30, 8.13, 16.5, 2.55, 11.67, 6.5];
// Misumi 2020
conf_ex_misumi_2020 = [20, 6, 12, 2, 8, 4.2];
// Steph's i3 Varient
// Select your belt type ******************************************************
//tooth_distance = 0;
//tooth_ratio = 1;
//tooth_height = 2;
//height = 3;
//base_height = 4; //belt_height - tooth_height
//T2.5
conf_belt_T2_5 = [ 2.5, 0.5, 0.7, 1.3, 1.3-0.7];
//T5 (strongly discouraged)
conf_belt_T5 = [ 5, 0.75, 1.2, 2.2, 2.2-1.2];
//HTD3
conf_belt_HTD3 = [ 3, 0.75, 1.22, 2.41, 2.41-1.22];
//MXL
conf_belt_MXL = [ 2.032, 0.64, 0.46, 1.2, 1.2-0.46];
//GT2
conf_belt_GT2 = [ 2, 0.5, 0.76, 1.52, 1.52-0.76];
//GT2-3mm
conf_belt_GT2_3mm = [ 3, 0.5, 1.14, 2.41, 2.41-1.14];
// For some reason SDP-SI doesn't give us the height dimensions of the flange. So it has to be calculated.
// height=0;
// hub_height=1;
// belt_height=2;
// setscrew_height=3;
// setscrew_diameter=4;
// diameter=5;
// hub_diameter=6;
// flange_diameter=7;
// belt_center=8; (pulley_height-pulley_hub_height)/2+pulley_hub_height;
// values for GT2-3mm 17 groove pulley
conf_pulley_17_GT2_3mm = [ 20.6, 6.3, 11.1, 3.5, 3, 15.4, 17.5, 22, (20.6-6.3)/2+6.3];
// values for GT2 36 groove pulley
conf_pulley_36_GT2 = [ 17.5, 6.3, 8, 3.5, 3, 22.4, 17.5, 28, (17.5-6.3)/2+6.3];
// values for GT2 40 groove pulley
conf_pulley_40_GT2 = [ 17.5, 6.3, 8, 3.5, 3, 25, 17.5, 30, (17.5-6.3)/2+6.3];
// Nuts_screws.scad
// Released under Attribution 3.0 Unported (CC BY 3.0)
// http://creativecommons.org/licenses/by/3.0/
// Stephanie Shaltes
// PRUSA iteration3
// Functions used in many files
// GNU GPL v3
// Josef Pr?Å¡a <josefprusa@me.com>
// Václav 'ax' H?la <axtheb@gmail.com>
// Vlnofka <>
// http://www.reprap.org/wiki/Prusa_Mendel
// http://github.com/prusajr/PrusaMendel
module chamfer(x=10,y=10,z=10) {
rotate(a=[90,-90,0])
linear_extrude(height = y, center = true, convexity = 2, twist = 0)
polygon(points = [
[-1.00,-1.00]
,[-1.00,x-1.00]
,[0.00,x]
,[z,0.00]
,[z-1.00,-1.00]
]
,paths = [
[0,1,2,3,4]]
);
}
// This will size an outer diameter to fit inside dia with $fn sides
// use this to set the diameter before passing to polyhole
function hole_fit( dia=0,$fn=0) = dia/cos(180/(($fn>0) ? $fn : 0.01));
// This determines the number of sides of a hole that is printable
// I added +1 because nobody wants to print a triangle. (plus it looks nicer, havn't tested printability yet.)
function poly_sides(d) = (max(round(2 * d),3)+1);
// Based on nophead research
module polyhole(d, d1, d2, h, center=false, $fn=0) {
n = max((($fn>0) ? $fn : poly_sides(d)), (($fn>0) ? $fn : poly_sides(d1)), (($fn>0) ? $fn : poly_sides(d2)));
cylinder(h = h, r = (d / 2), r1 = (d1 / 2), r2 = (d2 / 2), $fn = n, center=center);
}
// make it interchangeable between this and cylinder
module cylinder_poly(r, r1, r2, h, center=false, $fn=0){
polyhole(d=r*2, d1=r1*2, d2=r2*2, h=h, center=center, $fn=$fn);
}
module cylinder_slot(r=0, r1, r2, h, length=0, center=false, $fn=0) {
n = ($fn > 0) ? $fn : max(poly_sides(r*2), poly_sides(r1*2), poly_sides(r2*2));
union() {
rotate([0,0, 180/n]) cylinder_poly(h=h, r=r, r1=r1, r2=r2, center=center, $fn=n);
if (length>0) {
translate([((center) ? length/2 : 0),((center) ? 0 : -((r>0) ? r : r1)*cos(180/n)), 0]) trapezoid(cube=[length, ((r>0) ? r*2 : r1*2) *cos(180/n),h], y1=(r1-r2)*cos(180/n), y2=(r1-r2)*cos(180/n), center=center);
//cube([length, dia*cos(180/n),h]);
translate([length, 0, 0]) rotate([0,0, 180/n]) cylinder_poly(h=h, r=r, r1=r1, r2=r2, center=center, $fn=n);
}
}
}
module trapezoid(cube=[10, 10, 10], x1=0, x2=0, y1=0, y2=0, center=false) {
translate((center) ? [0,0,0] : [cube[0]/2, cube[1]/2, cube[2]/2] ) {
difference() {
translate([0, 0 ,0]) cube(cube, center=true);
if (x2 >0 ) translate([cube[0]/2, -(cube[1]+0.1)/2, -cube[2]/2]) rotate([0,-atan(x2/cube[2]),0]) cube([x2*cos(atan(x2/cube[2]))+0.1, cube[1]+0.1, sqrt( pow(cube[2], 2) + pow(x2, 2))]);
if (x1 >0 ) translate([-cube[0]/2, -(cube[1]+0.1)/2, -cube[2]/2]) rotate([0,atan(x1/cube[2]),0]) translate([ -(x1*cos(atan(x1/cube[2]))+0.1), 0, 0]) cube([x1*cos(atan(x1/cube[2]))+0.1, cube[1]+0.1, sqrt( pow(cube[2], 2) + pow(x1, 2))]);
if (y1 >0 ) translate([-(cube[0]+0.1)/2, -cube[1]/2, -cube[2]/2]) rotate([-atan(y1/cube[2]),0,0]) translate([ 0, -(y1*cos(atan(y1/cube[2]))+0.1), 0]) cube([cube[0]+0.1, y1*cos(atan(y1/cube[2]))+0.1, sqrt( pow(cube[2], 2) + pow(y1, 2))]);
if (y2 >0 ) translate([-(cube[0]+0.1)/2, cube[1]/2, -cube[2]/2]) rotate([atan(y2/cube[2]),0,0]) cube([cube[0]+0.1, y2*cos(atan(y2/cube[2]))+0.1, sqrt( pow(cube[2], 2) + pow(y2, 2))]);
}
}
}
module fillet(radius, height=100, $fn=0) {
//this creates acutal fillet
n = ($fn>0) ? $fn : (ceil(poly_sides(radius*2)/4)*4);
translate([-radius, -radius, -height/2-0.01])
difference() {
cube([radius*2, radius*2, height+0.02]);
cylinder(r=radius, h=height+0.02, $fn=n);
}
}
module cube_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=0){
//
render(convexity = 2)
if (use_fillets) {
if (center) {
cube_fillet_inside(size, radius, vertical, top, bottom, $fn);
} else {
translate([size[0]/2, size[1]/2, size[2]/2])
cube_fillet_inside(size, radius, vertical, top, bottom, $fn);
}
} else {
cube(size, center);
}
}
module cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=0){
j=[1,0,1,0];
for (i=[0:3]) {
if (radius > -1) {
rotate([0, 0, 90*i]) translate([size[1-j[i]]/2, size[j[i]]/2, 0]) fillet(radius, size[2], $fn=$fn);
} else {
rotate([0, 0, 90*i]) translate([size[1-j[i]]/2, size[j[i]]/2, 0]) fillet(vertical[i], size[2], $fn=$fn);
}
rotate([90*i, -90, 0]) translate([size[2]/2, size[j[i]]/2, 0 ]) fillet(top[i], size[1-j[i]], $fn=$fn);
rotate([90*(4-i), 90, 0]) translate([size[2]/2, size[j[i]]/2, 0]) fillet(bottom[i], size[1-j[i]], $fn=$fn);
}
}
module cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=0){
//makes CENTERED cube with round corners
// if you give it radius, it will fillet vertical corners.
//othervise use vertical, top, bottom arrays
//when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise
//top/bottom fillet starts in direction of Y axis and goes CCW too
if (radius == 0) {
cube(size, center=true);
} else {
difference() {
cube(size, center=true);
cube_negative_fillet(size, radius, vertical, top, bottom, $fn);
}
}
}
// should pull this from configuration.
layer_height = 0.3;
// Allowances for tolerance
screw_hole_allowance = 0.15;
screw_head_allowance = 0.5;
screw_head_allowance_tight = 0.15;
rod_hole_allowance = 0.15;
nut_hole_allowance = 0.15;
nut_thickness_allowance = 0.15;
washer_hole_allowance = 0.5;
washer_hole_allowance_tight = 0.15;
washer_thickness_allowance = 0.01;
//************* screw access functions *************
function screw_dia(type) = type[0] * type[4];
function screw_head_bottom_dia(type) = type[1] * type[4];
function screw_head_top_dia(type) = type[2] * type[4];
function screw_head_height(type) = type[3] * type[4];
// diameter = 0; head_dia_bottom = 1; head_dia_top = 2; head_height = 3
// multiplier = 4 (this is set to 1 since it will already be converted. So you can still use screw_dia, etc.)
function v_screw_hole(type, hole_allowance=screw_hole_allowance, head_allowance=screw_head_allowance, $fn) = [(hole_fit(screw_dia(type),$fn))+hole_allowance, (hole_fit(screw_head_bottom_dia(type), $fn))+head_allowance, (hole_fit(screw_head_top_dia(type), $fn))+head_allowance, screw_head_height(type), 1];
//************* nut access functions *************
function nut_dia(type) = type[0] * type[3];
function nut_flat(type) = type[1] * type[3];
function nut_outer_dia(type) = (nut_flat(type)/cos(30));
function nut_thickness(type) = type[2] * type[3];
// diameter = 0; nut flat = 1; nut thickness = 2; multiplier = 3 (multiplier should be set to 1, since values are already converted)
function v_nut_hole(type) = [nut_dia(type), nut_flat(type)+nut_hole_allowance, nut_thickness(type)+nut_thickness_allowance, 1];
//************* washer access functions *************
function washer_dia(type) = type[0] * type[3];
function washer_outer_dia(type) = type[1] * type[3];
function washer_thickness(type) = type[2] * type[3];
// diameter = 0; outer diameter = 1; washer thickness = 2; multiplier = 3 (multiplier should be set to 1, since values are already converted)
function v_washer_hole(type, hole_allowance=washer_hole_allowance, thickness_allowance=washer_thickness_allowance, $fn) = [washer_dia(type), (hole_fit(washer_outer_dia(type), $fn))+hole_allowance, washer_thickness(type)+thickness_allowance, 1];
// modules
module screw(h=20, head_drop=0, type=screw_M3_socket_head, washer_type=0, poly=false, $fn=0, hole=false ){
//makes screw with head
head_bottom_dia= screw_head_bottom_dia(type);
head_top_dia= screw_head_top_dia(type);
head_height= screw_head_height(type);
union() {
translate([0, 0, head_drop- ((washer_type[0]>0) ? washer_thickness(washer_type) : 0)]) {
translate([0, 0, -0.01]) {
if (poly) {
cylinder_poly(h=h+0.01, r=screw_dia(type)/2, $fn=$fn);
} else {
cylinder(h=h+0.01, r=screw_dia(type)/2, $fn=$fn);
}
}
translate([0, 0, ((screw_head_bottom_dia(type) < screw_head_top_dia(type)) ? 0 : -head_height)]) {
translate([0, 0, head_height]) washer(type=washer_type, $fn=$fn);
translate([0, 0, -0.01])
cylinder(h=head_height+0.02, r2=head_bottom_dia/2, r1=head_top_dia/2, $fn=$fn);
}
}
}
}
module screw_hole(h=20, length=0, head_drop=0, type=screw_M3_socket_head, washer_type=0, $fn=0, hole_support=false ){
//makes screw with head
screw=v_screw_hole(type, head_allowance=((screw_head_bottom_dia(type) < screw_head_top_dia(type)) ? screw_head_allowance_tight : screw_head_allowance), $fn=$fn);
head_bottom_dia= (washer_type[0]>0) ? washer_outer_dia(v_washer_hole(washer_type, $fn=$fn)) : screw_head_bottom_dia(screw);
head_top_dia= (washer_type[0]>0) ? washer_outer_dia(v_washer_hole(washer_type, $fn=$fn)) : screw_head_top_dia(screw);
head_height = ((screw_head_bottom_dia(screw) < screw_head_top_dia(screw)) ? screw_head_height(screw) : head_drop);
head_drop1= ((screw_head_bottom_dia(screw) < screw_head_top_dia(screw)) ? screw_head_height(screw)+head_drop : head_drop);
translate([0, 0, head_drop1]) {
difference() {
union() {
translate([0, 0, -0.01]) {
cylinder_slot(h=h+0.02, r=screw_dia(screw)/2, length=length, $fn=$fn);
}
render(convexity = 6)
if (head_height>0) {
translate([0, 0, -head_height-0.01]) {
cylinder_slot(h=head_height+0.02, r2=head_bottom_dia/2, r1=head_top_dia/2, length=length, $fn=$fn);
}
translate([0, 0, -head_drop1]) {
cylinder_slot(h=head_drop1-head_height, r=head_top_dia/2, length=length, $fn=$fn);
}
}
}
if (hole_support) translate([0, 0, -0.01]) {
cylinder_slot(h=layer_height+0.01, r=head_top_dia/2, length=length, $fn=$fn);
}
}
}
}
module rod_hole(d=0, h=0, allowance=rod_hole_allowance, $fn=0, center=false){
//makes a rod hole
n=(($fn>0) ? $fn : poly_sides(d));
dia= hole_fit(d, n) + allowance;
rotate([0,0, 180/n])
cylinder_poly(h=h, r=dia/2, $fn=n, center=center);
}
module nut(type=nut_M3, h=0){
//makes a nut
cylinder(h=((h>0) ? h : nut_thickness(type)), r=nut_outer_dia(type)/2, $fn=6);
}
module nut_hole(type=nut_M3, h=0){
//makes a nut hole
nut(type=v_nut_hole(type), h=h);
}
module nut_slot_hole(type=nut_M3, h=0){
//makes a nut slot
union() {
nut_hole(type=type);
translate([0, -(nut_flat(v_nut_hole(type)))/2, 0]) cube([h+0.01, (nut_flat(v_nut_hole(type))), (nut_thickness(v_nut_hole(type)))]);
}
}
module washer(type=washer_M3, $fn=0){
//makes a washer
color([150/255, 150/255, 150/255, 0.7]) rotate([0,0, 180/(($fn>0) ? $fn : poly_sides(washer_outer_dia(type)))])
render(convexity = 4) cylinder_poly(h=washer_thickness(type), r=washer_outer_dia(type)/2, $fn=$fn);
}
module washer_hole(type=washer_M3, $fn=0){
//makes a washer hole
washer(type=v_washer_hole(type=type, $fn=$fn), $fn=$fn);
}
// Screw parameters
// diameter = 0
// head_dia_bottom = 1
// head_dia_top = 2
// head_height = 3
// multiplier = 4 (fractional values are multiplied by 25.4 to get metric, else is 1)
//************* 8020inc Fractional (inch) screws *************
// http://www.3dcontentcentral.com/parts/supplier/80%2020-Inc/9/14/620.aspx
// 8020 #3066 #3342 #3390 1/4-20
screw_8020_1_4_flange_head = [6.35, 13.08, 13.08, 3.08, 1];
// 8020 #3330 #3340 5/16-18
screw_8020_5_16_flange_head = [7.94, 16.93, 16.93, 4.13, 1];
// 8020 #3059 1/4-20
screw_8020_1_4_button_head = [6.35, 11.1, 11.1, 3.35, 1];
// 8020 #3104 5/16-18
screw_8020_5_16_button_head = [7.94, 13.89, 13.89, 4.22, 1];
// 8020 #3058 1/4-20
screw_8020_1_4_socket_head = [6.35, 9.52, 9.52, 6.35, 1];
// 8020 #3106 5/16-18
screw_8020_5_16_socket_head = [7.94, 12.41, 12.41, 8.45, 1];
// 8020 #3400 1/4-20 (countersunk screw)
screw_8020_1_4_flat_head = [6.35, 6.35, 13.56, 4.14, 1];
// 8020 #3410 5/16-18 (countersunk screw)
screw_8020_5_16_flat_head = [7.94, 7.94, 16.66, 5.07, 1];
//************* Generic Fractional (inch) screws *************
// Fractional (inch) #2 Button Head (Generic)
screw_inch_2_button_head = [0.086, 0.164, 0.164, 0.046, 25.4];
// Fractional (inch) #3 Button Head (Generic)
screw_inch_3_button_head = [0.099, 0.188, 0.188, 0.052, 25.4];
// Fractional (inch) #4 Button Head (Generic)
screw_inch_4_button_head = [0.112, 0.213, 0.213, 0.059, 25.4];
// Fractional (inch) #5 Button Head (Generic)
screw_inch_5_button_head = [0.125, 0.238, 0.238, 0.066, 25.4];
// Fractional (inch) #6 Button Head (Generic)
screw_inch_6_button_head = [0.138, 0.262, 0.262, 0.073, 25.4];
// Fractional (inch) #8 Button Head (Generic)
screw_inch_8_button_head = [0.164, 0.312, 0.312, 0.087, 25.4];
// Fractional (inch) #10 Button Head (Generic)
screw_inch_10_button_head = [0.190, 0.361, 0.361, 0.101, 25.4];
// Fractional (inch) 1/4 Button Head (Generic)
screw_inch_1_4_button_head = [0.250, 0.437, 0.437, 0.132, 25.4];
// Fractional (inch) 5/16 Button Head (Generic)
screw_inch_5_16_button_head = [0.3125, 0.547, 0.547, 0.166, 25.4];
// Fractional (inch) 3/8 Button Head (Generic)
screw_inch_3_8_button_head = [0.375, 0.656, 0.656, 0.199, 25.4];
// Fractional (inch) 1/2 Button Head (Generic)
screw_inch_1_2_button_head = [0.500, 0.675, 0.675, 0.265, 25.4];
// Fractional (inch) #2 Socket Head (Generic)
screw_inch_2_socket_head = [0.086, 0.140, 0.140, 0.086, 25.4];
// Fractional (inch) #3 Socket Head (Generic)
screw_inch_3_socket_head = [0.099, 0.161, 0.161, 0.099, 25.4];
// Fractional (inch) #4 Socket Head (Generic)
screw_inch_4_socket_head = [0.112, 0.183, 0.183, 0.112, 25.4];
// Fractional (inch) #5 Socket Head (Generic)
screw_inch_5_socket_head = [0.125, 0.205, 0.205, 0.125, 25.4];
// Fractional (inch) #6 Socket Head (Generic)
screw_inch_6_socket_head = [0.138, 0.226, 0.226, 0.138, 25.4];
// Fractional (inch) #8 Socket Head (Generic)
screw_inch_8_socket_head = [0.164, 0.270, 0.270, 0.164, 25.4];
// Fractional (inch) #10 Socket Head (Generic)
screw_inch_10_socket_head = [0.190, 0.312, 0.312, 0.190, 25.4];
// Fractional (inch) 1/4 Socket Head (Generic)
screw_inch_1_4_socket_head = [0.250, 0.375, 0.375, 0.250, 25.4];
// Fractional (inch) 5/16 Socket Head (Generic)
screw_inch_5_16_socket_head = [0.3125, 0.469, 0.469, 0.3125, 25.4];
// Fractional (inch) 3/8 Socket Head (Generic)
screw_inch_3_8_socket_head = [0.375, 0.563, 0.563, 0.375, 25.4];
// Fractional (inch) 1/2 Socket Head (Generic)
screw_inch_1_2_socket_head = [0.500, 0.750, 0.750, 0.500, 25.4];
// Fractional (inch) #2 Flat Head (countersunk screw) (Generic)
screw_inch_2_flat_head = [0.086, 0.086, 0.197, 0.064, 25.4];
// Fractional (inch) #3 Flat Head (countersunk screw) (Generic)
screw_inch_3_flat_head = [0.099, 0.099, 0.226, 0.073, 25.4];
// Fractional (inch) #4 Flat Head (countersunk screw) (Generic)
screw_inch_4_flat_head = [0.112, 0.112, 0.255, 0.083, 25.4];
// Fractional (inch) #5 Flat Head (countersunk screw) (Generic)
screw_inch_5_flat_head = [0.125, 0.125, 0.281, 0.090, 25.4];
// Fractional (inch) #6 Flat Head (countersunk screw) (Generic)
screw_inch_6_flat_head = [0.138, 0.138, 0.307, 0.097, 25.4];
// Fractional (inch) #8 Flat Head (countersunk screw) (Generic)
screw_inch_8_flat_head = [0.164, 0.164, 0.359, 0.112, 25.4];
// Fractional (inch) #10 Flat Head (countersunk screw) (Generic)
screw_inch_10_flat_head = [0.190, 0.190, 0.411, 0.127, 25.4];
// Fractional (inch) 1/4 Flat Head (countersunk screw) (Generic)
screw_inch_1_4_flat_head = [0.250, 0.250, 0.531, 0.161, 25.4];
// Fractional (inch) 5/16 Flat Head (countersunk screw) (Generic)
screw_inch_5_16_flat_head = [0.3125, 0.3125, 0.656, 0.198, 25.4];
// Fractional (inch) 3/8 Flat Head (countersunk screw) (Generic)
screw_inch_3_8_flat_head = [0.375, 0.375, 0.781, 0.234, 25.4];
// Fractional (inch) 1/2 Flat Head (countersunk screw) (Generic)
screw_inch_1_2_flat_head = [0.500, 0.500, 0.938, 0.251, 25.4];
//************* Generic Metric screws *************
// Metric M3 Button Head (Generic)
screw_M3_button_head = [ 3, 5.7, 5.7, 1.65, 1];
// Metric M4 Button Head (Generic)
screw_M4_button_head = [ 4, 7.6, 7.6, 2.2, 1];
// Metric M5 Button Head (Generic)
screw_M5_button_head = [ 5, 9.5, 9.5, 2.75, 1];
// Metric M6 Button Head (Generic)
screw_M6_button_head = [ 6, 10.5, 10.5, 3.3, 1];
// Metric M8 Button Head (Generic)
screw_M8_button_head = [ 8, 14, 14, 4.4, 1];
// Metric M10 Button Head (Generic)
screw_M10_button_head = [10, 17.5, 17.5, 5.5, 1];
// Metric M3 Socket Head (Generic)
screw_M2p5_socket_head = [2.5, 4.5, 4.5, 2.5, 1];
// Metric M3 Socket Head (Generic)
screw_M3_socket_head = [ 3, 5.5, 5.5, 3, 1];
// Metric M4 Socket Head (Generic)
screw_M4_socket_head = [ 4, 7, 7, 4, 1];
// Metric M5 Socket Head (Generic)
screw_M5_socket_head = [ 5, 8.5, 8.5, 5, 1];
// Metric M6 Socket Head (Generic)
screw_M6_socket_head = [ 6, 10, 10, 6, 1];
// Metric M8 Socket Head (Generic)
screw_M8_socket_head = [ 8, 13, 13, 8, 1];
// Metric M10 Socket Head (Generic)
screw_M10_socket_head = [ 10, 16, 16, 10, 1];
// Metric M3 Flat Head (Generic)
screw_M3_flat_head = [ 3, 3, 6.72, 1.83, 1];
// Metric M4 Flat Head (Generic)
screw_M4_flat_head = [ 4, 4, 8.96, 2.48, 1];
// Metric M5 Flat Head (Generic)
screw_M5_flat_head = [ 5, 5, 11.2, 3.10, 1];
// Metric M6 Flat Head (Generic)
screw_M6_flat_head = [ 6, 6, 13.44, 3.72, 1];
// Metric M8 Flat Head (Generic)
screw_M8_flat_head = [ 8, 8, 17.92, 4.96, 1];
// Metric M10 Flat Head (Generic)
screw_M10_flat_head = [10, 10, 22.4, 6.20, 1];
//************* Generic Metric washers *************
// inner diameter = 0
// outer diameter = 1
// thickness = 2
// multiplier = 3 (fractional values are multiplied by 25.4 to get metric, else is 1)
washer_M2p5 = [ 2.7, 6, 0.5, 1];
washer_M3 = [ 3.2, 7, 0.5, 1];
washer_M3p5 = [ 3.7, 8, 0.5, 1];
washer_M4 = [ 4.3, 9, 0.8, 1];
washer_M5 = [ 5.3, 10, 1.0, 1];
washer_M6 = [ 6.4, 12.5, 1.6, 1];
washer_M8 = [ 8.4, 17, 1.6, 1];
washer_M10 = [10.5, 21, 2, 1];
// Metric Fender washers
washer_fender_M2p5 = [ 2.7, 8, 0.8, 1];
washer_fender_M3 = [ 3.2, 9, 0.8, 1];
washer_fender_M4 = [ 4.3, 12, 1.0, 1];
washer_fender_M5 = [ 5.3, 15, 1.2, 1];
washer_fender_M6 = [ 6.4, 18, 1.6, 1];
washer_fender_M8 = [ 8.4, 24, 2.0, 1];
washer_fender_M10 = [10.5, 30, 2.5, 1];
//************* Generic Fractional (inch) washers *************
// SAE standard washers
washer_inch_2 = [ 3/32, 7/32, 0.03, 25.4];
washer_inch_3 = [ 7/64, 1/4, 0.03, 25.4];
washer_inch_4 = [ 1/8, 5/16, 0.04, 25.4];
washer_inch_5 = [ 9/64, 9/32, 0.04, 25.4];
washer_inch_6 = [ 5/32, 3/8, 0.07, 25.4];
washer_inch_8 = [ 3/16, 7/16, 0.07, 25.4];
washer_inch_10 = [ 7/32, 1/2, 0.07, 25.4];
washer_inch_1_4 = [ 9/32, 5/8, 0.08, 25.4];
washer_inch_5_16 = [ 11/32, 11/16, 0.08, 25.4];
washer_inch_3_8 = [ 13/32, 13/16, 0.08, 25.4];
washer_inch_1_2 = [ 17/32, 1+1/16, 0.13, 25.4];
// Fractional (inch) Fender washers
washer_fender_inch_8 = [ 11/64, 3/4, 0.05, 25.4];
washer_fender_inch_10 = [ 13/64, 1/2, 0.05, 25.4];
washer_fender_inch_1_4_od_1_2 = [ 17/64, 1/2, 0.06, 25.4];
washer_fender_inch_1_4_od_1 = [ 9/32, 1, 0.06, 25.4];
washer_fender_inch_5_16 = [ 11/32, 5/8, 0.08, 25.4];
washer_fender_inch_3_8 = [ 13/32, 1, 0.08, 25.4];
washer_fender_inch_1_2 = [ 17/32, 1.5, 0.08, 25.4];
//************* Generic Metric nuts *************
// inner diameter = 0
// flat size = 1
// thickness = 2
// multiplier = 3 (fractional values are multiplied by 25.4 to get metric, else is 1)
nut_M2p5 = [ 2.5, 5, 2, 1];
nut_M3 = [ 3, 5.5, 2.4, 1];
nut_M4 = [ 4, 7, 3.2, 1];
nut_M5 = [ 5, 8, 4, 1];
nut_M6 = [ 6, 10, 5, 1];
nut_M8 = [ 8, 13, 6.5, 1];
nut_M10 = [ 10, 16, 8, 1];
// Jam nuts, also known as half height nuts
nut_jam_M2p5 = [ 2.5, 5, 1.6, 1];
nut_jam_M3 = [ 3, 5.5, 1.8, 1];
nut_jam_M4 = [ 4, 7, 2.2, 1];
nut_jam_M5 = [ 5, 8, 2.7, 1];
nut_jam_M6 = [ 6, 10, 3.2, 1];
nut_jam_M8 = [ 8, 13, 4, 1];
nut_jam_M10 = [ 10, 16, 5, 1];
//************* Generic Fractional (inch) nuts *************
// inner diameter = 0
// flat size = 1
// thickness = 2
// multiplier = 3 (fractional values are multiplied by 25.4 to get metric, else is 1)
nut_inch_2 = [0.086, 3/16, 1/16, 25.4];
nut_inch_3 = [0.099, 3/16, 1/16, 25.4];
nut_inch_4 = [0.112, 1/4, 3/32, 25.4];
nut_inch_5 = [0.125, 5/16, 7/64, 25.4];
nut_inch_6 = [0.138, 5/16, 7/64, 25.4];
nut_inch_8 = [0.164, 11/32, 1/8, 25.4];
nut_inch_10 = [0.190, 3/8, 1/8, 25.4];
nut_inch_1_4 = [ 1/4, 7/16, 7/32, 25.4];
nut_inch_5_16 = [ 5/16, 1/2, 17/64, 25.4];
nut_inch_3_8 = [ 3/8, 9/16, 21/64, 25.4];
nut_inch_1_2 = [ 1/2, 3/4, 7/16, 25.4];
// Jam nuts, also known as half height nuts
nut_jam_inch_1_4 = [ 1/4, 7/16, 5/32, 25.4];
nut_jam_inch_5_16 = [ 5/16, 1/2, 3/16, 25.4];
nut_jam_inch_3_8 = [ 3/8, 9/16, 7/32, 25.4];
nut_jam_inch_1_2 = [ 1/2, 3/4, 5/16, 25.4];
//screw_hole(type=screw_M3_flat_head, length=4, head_drop=3, $fn=8, hole_support=true);
//nut();
//washer_hole($fn=8);
//washer_hole($fn=4);
//echo (washer_M3[1]/cos(180/(($fn>0) ? $fn : 0.01)));
//rotate([0,0, -135]) nut_slot_hole(h=(nut_outer_dia(v_nut_hole(nut_M3)))/2);
// Custom settings here, tailor to your supplies and print settings
layer_height = 0.3;
width_over_thickness = 2.2;
inch = 25.4;
// Select your belt type ******************************************************
//T2.5 conf_belt_T2_5
//T5 (strongly discouraged) conf_belt_T5
//HTD3 conf_belt_HTD3
//MXL conf_belt_MXL
//GT2 conf_belt_GT2
//GT2-3mm conf_belt_GT2_3mm
belt = conf_belt_GT2_3mm;
belt_width = 7;
// Select your pulley type ******************************************************
// GT2-3mm 17 groove pulley conf_pulley_17_GT2_3mm
// GT2 36 groove pulley conf_pulley_36_GT2
// GT2 40 groove pulley conf_pulley_40_GT2
pulley = conf_pulley_17_GT2_3mm;
// the motor has a cylinder on it that raises the base of the shaft 2mm, this value must be greater than 2mm
pulley_height_from_motor=4;
// Stepper motor dimensions
stepper_motor_height=42;
stepper_motor_width=42;
stepper_motor_padded=stepper_motor_width+2;
z_screw_rod_separation=17;
// Screws used to mount to the extrusion
// Thickness of the mounts (do not change unless you check for clearances)
support_wall_thickness=5;
motor_mount_thickness=10;
smooth_rod_diameter=8;
// Choose screws configuration ***************************************
// screw used for the Y idler bearing. make sure it matches the ID of the bearing.
y_bearing_screw = screw_M4_button_head;
y_bearing_nut = nut_M4;
// Y carriage settings
y_carriage_screw = screw_M4_button_head;
y_carriage_hole_spacing = 29;
y_bushing_height=(support_wall_thickness+2);
// screw used to mount parts to the extrusion
ex_screw=screw_8020_1_4_flange_head;
// extrusion parameters
// 10 series 8020 (inch) conf_ex_8020_10s
// 15 series 8020 (inch) conf_ex_8020_15s
// 20 series 8020 conf_ex_8020_20s
// 25 series 8020 conf_ex_8020_25s
// 30 series 8020 conf_ex_8020_30s
// Misumi 2020 conf_ex_misumi_2020
extrusion = conf_ex_8020_10s;
// extrusion lengths
// You can delete these and just specify in millimeters below
y_length_in = 16;
x_width_in = 12;
z_height_in = 13;
top_x_width_in=x_width_in;
y_length = y_length_in * inch;
x_width = x_width_in * inch;
z_height = z_height_in * inch;
top_x_width = top_x_width_in * inch + smooth_rod_diameter + support_wall_thickness*2+stepper_motor_padded+z_screw_rod_separation*2+screw_head_top_dia(v_screw_hole(ex_screw, $fn=8))*2;
// Smooth rod length is automatically calculated by extrusion length (can do vice-versa)
// the width of the X axis smooth rod block is 50, we have 2, so add in 100
x_smooth_rod_length=(x_width+100);
y_smooth_rod_length=(y_length+extrusion[0]*2);
z_smooth_rod_length=(z_height+extrusion[0]);
// Choose bearing/bushing configuration ***************************************
// conf_b_* are in inc/conf_bushing.scad
bushing_xy = conf_b_lm8uu;
bushing_z = conf_b_lm8uu;
// for longer bearings use one shorter in x-carriage to make place for belt attachment
// by default use same as xy
bushing_x_carriage = bushing_xy;
// Select idler bearing size **************************************************
// [outer_diameter, width, inner_diameter, uses_guide]
// 608 [standard skate bearings] with bearing guide
bearing_608 = [22, 7, 8, 1];
//608 bearings with fender washers
bearing_608_washers = [22, 10, 8, 0];
// 624 [roughly same diameter as pulley, makes belt parallel so its prettier]
bearing_624 = [16, 5, 4, 1];
// two 624 - for use without bearing guides. My favourite [ax]
bearing_624_double = [16, 10, 4, 0];
// Size for 1/4" R4RS bearing
bearing_R4RS = [15.875, 4.9784, 6.35, 0];
// Size for 6mm 626RS bearing
bearing_626RS = [19, 6, 6, 0];
//y_idler_washer=washer_inch_1_4;
x_idler_bearing = bearing_624_double;
y_idler_bearing = bearing_624_double;
// Fillets ********************************************************************
// mostly cosmetic, except z axis.
// 0 = no fillets
// 1 = fillet
use_fillets = 1;
// END of custom settings
// *******************
// Distance between Y rods
//y_rod_separation=100; // for Prusa i3 mounting compatability
y_rod_separation=140;
y_clamp_separation=100;
// this is where the bottom of the Y rod will be.
y_rod_height=support_wall_thickness+7;
// LM8UU dimensions
// LM8UU_length = conf_b[2];
// The thickness of the mount for the LM8UU is 2mm ( using lm8uu-holder-slim_v1-1 )
bushing_height = bushing_xy[1]+y_bushing_height;
y_belt_center=(y_rod_height+smooth_rod_diameter/2+bushing_height)-(pulley[8] + pulley_height_from_motor);
// this setting is for the Prusa i2 bed
y_belt_clamp_hole_distance=18;
// *******************
// You are not supposed to change this
xaxis_rod_distance = 45;
//calculated from settings
single_wall_width = width_over_thickness * layer_height;
x_idler_width = (x_idler_bearing[1] > 7 ? x_idler_bearing[1] : 7) + 2.5 * x_idler_bearing[3] ;
y_idler_width = (y_idler_bearing[1] > 7 ? y_idler_bearing[1] : 7) + 2.5 * y_idler_bearing[3] ;
//deltas are used to enlarge parts for bigger bearings
xy_delta = ((bushing_xy[1] <= 7.7) ? 0 : bushing_xy[1] - 7.7) * 0.9;
z_delta = (bushing_z[1] <= 7.7) ? 0 : bushing_z[1] - 7.7;
// Don't change these calculations. They are for calculating the Brace position.
brace_offset=(extrusion[0]*2-extrusion[0]/sin(45));
brace_pos=y_length/2+((-bushing_xy[0]+0.5-(extrusion[0]/2+support_wall_thickness+stepper_motor_padded/2))-24-3.5+(50.5-(7.4444+32.0111+0.25)))-extrusion[0]*2;
echo("X axis extrusion length = ", x_width, " inch=", (x_width)/inch);
echo("top support X axis extrusion length = ", top_x_width, " inch=", (top_x_width)/inch);
echo("Y axis extrusion length = ", y_length, " inch=", (y_length)/inch);
echo("Z axis extrusion length = ", z_height, " inch=", (z_height)/inch);
echo("Z axis Brace length = ", (brace_pos+brace_offset-support_wall_thickness-extrusion[0]/2)/sin(45), " inch=", (brace_pos+brace_offset-support_wall_thickness-extrusion[0]/2)/sin(45)/inch);
echo("X axis smooth rod length = ", x_smooth_rod_length, " inch=", x_smooth_rod_length/inch);
echo("Y axis smooth rod length = ", y_smooth_rod_length, " inch=", y_smooth_rod_length/inch);
echo("Z axis smooth rod length = ", z_smooth_rod_length, " inch=", z_smooth_rod_length/inch);
//Check to be sure the pulley doesn't hit the Y bed
if ((y_rod_height+smooth_rod_diameter/2+bushing_height)-(pulley[0] + pulley_height_from_motor) < 2) echo ("Warning! Bed is too close to the pulley. Please change y_rod_height.");
echo("Distance between bed and Y pulley:", (y_rod_height+smooth_rod_diameter/2+bushing_height)-(pulley[0] + pulley_height_from_motor));
// These constants define the geometry of the complete-printer.scad
bed_x_size=225;
bed_y_size=225;
cube_fillet([10, 35, y_belt_center-(belt_width+3)/2], center = true, radius=3, $fn=12);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment