Openscad · Programmering

Simple gear

egettand_foto

// By Bjørn Houdorf June 20, 2015
// houdorf.wordpress.com
// sangogbas@outlook.dk

// This is a simple gear that can
// be fixed on a round stick of
// wood with 2 screws.
// It is written in Openscad.

rbc=120; // Radius of big circle
nt=32; // Number of teeth
tg=10; // Thickness of gear
hr=14; // Radius of center hole
pi=3.14159265;
//lr=(sr*pi)/n; // Radius of small circles

module small_circles_outer(n, sr, height) { // Make the teeth
lr=(sr*pi)/n;
for ( i = [0 : n] )

{
rotate([0,0,(360*(i/n))])
translate([sr,0,0])
cylinder(h=height, r=(lr/2));
}
}

module small_circles_inner(n, sr, height) { // The holes between
lr=(sr*pi)/n; // the teeth
for ( i = [0 : n] )

{
rotate([0,0,(360*(0.5/n))])
rotate([0,0,(360*(i/n))])
translate([sr,0,0])
cylinder(h=height, r=(lr/2));
}
}

module skrew_holes(radius, angle, lenght, thickness, centerholeradius) {

translate([centerholeradius, 0, 0.5*thickness])
rotate([0, angle, 0]) // 2 small
cylinder(h=lenght, r=radius); //hulls used for skrews

// for axe

translate([-centerholeradius, 0, 0.5*thickness])
rotate([0, angle+180, 0])
cylinder(h=lenght, r=radius);
}

module mat_holes(holeradius, holedepth, number, circleradius) {
// Number of hulls to save material
for ( i = [1 : number] ) {
rotate([0, 0, i*(360/number)])
translate([0,circleradius,0])
cylinder(h=holedepth, r=holeradius);

}
}

// ——————————-

difference() {
difference() {
difference() {
difference() {

union() {

small_circles_outer(nt, rbc, tg);
cylinder(h=tg, r=rbc);
}
small_circles_inner(nt, rbc, tg);
}
cylinder(h=tg, r=hr);
}

skrew_holes(2, 70, 40, 10, 14);
}
mat_holes(26, 30, 6, 70);
}

// *********************************

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s