Use 2.5 hole radius, replace comments, fix carrier_simpler and sun_drive

master
Vitaliy Filippov 2014-03-26 21:25:23 +00:00
parent 4735bbc937
commit 2db882cf7e
6 changed files with 43061 additions and 58611 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,3 @@
// Algorithmic LEGO(r) Technic compatible gear generator
//
// NOTE regarding Patents: Since 1977 the LEGO Group has produced "Technic"
// elements with gear teeth, axles, axle-holes, and other features closely
// resembling the design(s) in this file, as part of their "Expert Builder"
@ -18,56 +16,17 @@
// to make objects and then try to "pass them off" as LEGO products. See
// for example the Kirkbi AG v. Ritvik Holdings Inc. case, (Supreme Court of
// Canada [2005] 3 S.C.R. 302).
//
// This was originally created by user bjepson on Thingiverse (thing 29989),
// then heavily modified and expanded by Robert Munafo:
// 20121226: separate parameters for rows/columns of cylinder holes and of
// "plus-shaped" holes
// * Rotate the holes by 20 degrees to take advantage of
// edge dithering both for improved hole width resolution
// and to provide a rough surface which better grips the
// smooth axles.
// * You can now get more than just a single row of plus-holes
// in each direction
//
// 20130105: added MCAD functions to make this file work all by itself (no
// need to hunt down missing pieces elsewhere)
// * More accurate axle hole dimensions
// * Round holes are actually round now (imagine that!)
// * Automatically determines correct parameters for number and placement
// of holes, based on number of teeth
//
// 20130106: fix small glitch seen at junction of fillet and bottom land (for
// illustration of the problem, see "0106-fix.jpg" at
// thingiverse.com/thing:40410)
// 32 teeth is the real "missing" gear size, because all the other
// multiples of 8 are available. An argument can also be made for 28 (which
// however is available in the new small turntable) or any other multiple of 4
// because the official gears are all multiples of 4, namely: 8, 12, 16,
// 20, 24, 28(turntable), 36, 40 and 56(big turntable).
// Contains some code from thing 29989 by bjepson on Thingiverse, thing 40410
// by Robert Munafo, and MCAD library. myGear() from 40410 is here, but with
// different (better) involute gear teeth shape, and with some tweaks to make
// better gears without degenerate faces.
//
// For my orrery designs ( see mrob.com/orrery ) I might use any integer
// number of teeth from 8 up to around 60 or 70.
// Everything other is (c)oded by me, Vitaliy Filippov. License is GNU LGPL2.1+
//
// The holes parameters need to be chosen a certain way. To get a normal style
// gear with a + hole in the middle, the plus_row and plus_col should both
// be odd, and the holes_row, holes_col should both be even. To get a round
// hole in the center, do it the other way 'round. Then invoke it as
// myGearParamed(n_teeth, holes_row, holes_col, plus_row, plus_col)
//
// Examples:
// my 20 gear: holes_row=2, holes_col=2, plus_row=1, plus_col=1
// Standard 24 gear: holes_row=2, holes_col=2, plus_row=1, plus_col=1
// my 28 gear: holes_row=2, holes_col=2, plus_row=3, plus_col=1
// my 32 gear: holes_row=2, holes_col=2, plus_row=3, plus_col=3
// nonstandard 36 gear: holes_row=2, holes_col=2, plus_row=3, plus_col=3
// Standard 40 gear: holes_row=4, holes_col=2, plus_row=3, plus_col=3
// my 44 gear: holes_row=4, holes_col=2, plus_row=3, plus_col=3
// my 48 gear: holes_row=4, holes_col=4, plus_row=5, plus_col=3
//
// By default, the myGear function chooses the best values for all the holes paramters
// based on the number of teeth.
// Also I HIGHLY recommend to build OpenSCAD from my fork: github.com/vitalif/openscad,
// because there's a patch that makes OpenSCAD to use Delaunay triangulation which
// greatly improves the resulting model quality.
// Standard LEGO dimensions:
// Stud spacing = 8mm
@ -107,7 +66,7 @@ translate([0, 0, 16])
/* Planetary ring gear with both inner and outer 40 teeth */
//planetary_ring_gear(plane_height=1);
planetary_ring_gear(plane_height=1);
/* 40-teeth planetary ring gear with clutch */
@ -115,7 +74,7 @@ translate([0, 0, 16])
/* Solid clutch gear, like standard 16-teeth */
clutchGear(32);
//clutchGear(32);
/* Gear with clutch fully offset to one side */
@ -145,6 +104,7 @@ clutchGear(32);
//-------------
// Same as carrier_32t(), but with axle hole at the center
module sun_drive_32t() {
root = 3.06*(32/2-1)/3.1415926;
segments = 32*2; // so gear teeth edge never match cylinder segment edges
@ -154,31 +114,34 @@ module sun_drive_32t() {
translate([0, 0, 2]) gear_teeth(mm_per_tooth=3.06, number_of_teeth=32, thickness=4, clearance=-0.1);
cylinder($fn=100, h=8, r=root-0.5);
}
translate([0, 0, 3.5]) cylinder($fn=32*2, h=1, r=root-0.5);
cylinder($fn=100, h=8, r=3.5);
difference() {
union() {
difference() {
translate([0, 0, 0.8-0.1]) cylinder($fn=32*2, h=7.2+0.1, r=root);
translate([0, 0, -0.1]) cylinder($fn=32*2, h=7.3, r=root-1);
translate([0, 0, 7.2-0.1]) cylinder($fn=32*2, h=1, r=3.06*(24/2)/3.1415926);
translate([0, 0, -0.1]) cylinder($fn=32*2, h=7.1, r=root-1);
}
translate([-8, 0, 0]) cylinder($fn=32*2, h=8, r=3.5);
translate([0, -8, 0]) cylinder($fn=32*2, h=8, r=3.5);
translate([0, 8, 0]) cylinder($fn=32*2, h=8, r=3.5);
translate([8, 0, 0]) cylinder($fn=32*2, h=8, r=3.5);
translate([-8, 0, 0.1]) cylinder($fn=32, h=8-0.2, r=3.5);
translate([0, -8, 0.1]) cylinder($fn=32, h=8-0.2, r=3.5);
translate([0, 8, 0.1]) cylinder($fn=32, h=8-0.2, r=3.5);
translate([8, 0, 0.1]) cylinder($fn=32, h=8-0.2, r=3.5);
translate([-0.5, -root+0.5, 0]) cube(size=[1, root*2-1, 8]);
rotate([0, 0, 90]) translate([-0.5, -root+0.5, 0]) cube(size=[1, root*2-1, 8]);
}
translate([0, 0, 8-0.8]) cylinder($fn=32*2, r=3.06*(24/2)/3.1415926, h=1);
translate([-20, -20, -0.2]) cube(size=[40, 40, 1]);
}
}
translate([-8, 0, -0.2]) cylinder($fn=32*2, h=10, r=2.4);
translate([0, -8, -0.2]) cylinder($fn=32*2, h=10, r=2.4);
translate([0, 8, -0.2]) cylinder($fn=32*2, h=10, r=2.4);
translate([8, 0, -0.2]) cylinder($fn=32*2, h=10, r=2.4);
rotate([0, 0, 45]) axleCut(0, 0, -0.2, 10);
translate([-8, 0, -0.2]) cylinder($fn=32, h=10, r=2.5);
translate([0, -8, -0.2]) cylinder($fn=32, h=10, r=2.5);
translate([0, 8, -0.2]) cylinder($fn=32, h=10, r=2.5);
translate([8, 0, -0.2]) cylinder($fn=32, h=10, r=2.5);
translate([-8, 0, 7.2]) cylinder($fn=32, h=0.8+0.1, r=3);
translate([0, -8, 7.2]) cylinder($fn=32, h=0.8+0.1, r=3);
translate([0, 8, 7.2]) cylinder($fn=32, h=0.8+0.1, r=3);
translate([8, 0, 7.2]) cylinder($fn=32, h=0.8+0.1, r=3);
}
}
@ -217,13 +180,13 @@ module carrier_32t_simpler() {
translate([0, 0, 2]) gear_teeth(mm_per_tooth=3.06, number_of_teeth=32, thickness=4, clearance=-0.1);
cylinder($fn=100, h=8, r=root-0.5);
}
difference() {
translate([0, 0, 0.8-0.1]) cylinder($fn=32*2, h=7.2+0.1, r=root);
translate([0, 0, -0.1]) cylinder($fn=32*2, h=7.1, r=root-1);
}
cylinder($fn=100, h=8, r=3.5);
difference() {
union() {
difference() {
translate([0, 0, 0.8-0.1]) cylinder($fn=32*2, h=7.2+0.1, r=root);
translate([0, 0, -0.1]) cylinder($fn=32*2, h=7.1, r=root-1);
}
translate([-8, 0, 0.1]) cylinder($fn=32, h=8-0.2, r=3.5);
translate([0, -8, 0.1]) cylinder($fn=32, h=8-0.2, r=3.5);
translate([0, 8, 0.1]) cylinder($fn=32, h=8-0.2, r=3.5);
@ -231,21 +194,20 @@ module carrier_32t_simpler() {
translate([-0.5, -root+0.5, 0]) cube(size=[1, root*2-1, 8]);
rotate([0, 0, 90]) translate([-0.5, -root+0.5, 0]) cube(size=[1, root*2-1, 8]);
}
translate([-20, -20, 8-0.8]) cube(size=[40, 40, 1]);
translate([-20, -20, -0.2]) cube(size=[40, 40, 1]);
}
}
translate([0, 0, -0.2]) cylinder($fn=32, h=10, r=2.4);
translate([0, 0, -0.2]) cylinder($fn=32, h=10, r=2.5);
translate([-8, 0, -0.2]) cylinder($fn=32, h=10, r=2.4);
translate([0, -8, -0.2]) cylinder($fn=32, h=10, r=2.4);
translate([0, 8, -0.2]) cylinder($fn=32, h=10, r=2.4);
translate([8, 0, -0.2]) cylinder($fn=32, h=10, r=2.4);
translate([-8, 0, -0.2]) cylinder($fn=32, h=10, r=2.5);
translate([0, -8, -0.2]) cylinder($fn=32, h=10, r=2.5);
translate([0, 8, -0.2]) cylinder($fn=32, h=10, r=2.5);
translate([8, 0, -0.2]) cylinder($fn=32, h=10, r=2.5);
translate([-8, 0, 7.2]) cylinder($fn=32, h=0.8+0.1, r=2.9);
translate([0, -8, 7.2]) cylinder($fn=32, h=0.8+0.1, r=2.9);
translate([0, 8, 7.2]) cylinder($fn=32, h=0.8+0.1, r=2.9);
translate([8, 0, 7.2]) cylinder($fn=32, h=0.8+0.1, r=2.9);
translate([-8, 0, 7.2]) cylinder($fn=32, h=0.8+0.1, r=3);
translate([0, -8, 7.2]) cylinder($fn=32, h=0.8+0.1, r=3);
translate([0, 8, 7.2]) cylinder($fn=32, h=0.8+0.1, r=3);
translate([8, 0, 7.2]) cylinder($fn=32, h=0.8+0.1, r=3);
}
}
@ -278,11 +240,11 @@ module carrier_32t() {
translate([-20, -20, -0.2]) cube(size=[40, 40, 1]);
}
}
translate([-8, 0, -0.2]) cylinder($fn=32*2, h=10, r=2.4);
translate([0, -8, -0.2]) cylinder($fn=32*2, h=10, r=2.4);
translate([0, 0, -0.2]) cylinder($fn=32*2, h=10, r=2.4);
translate([0, 8, -0.2]) cylinder($fn=32*2, h=10, r=2.4);
translate([8, 0, -0.2]) cylinder($fn=32*2, h=10, r=2.4);
translate([-8, 0, -0.2]) cylinder($fn=32*2, h=10, r=2.5);
translate([0, -8, -0.2]) cylinder($fn=32*2, h=10, r=2.5);
translate([0, 0, -0.2]) cylinder($fn=32*2, h=10, r=2.5);
translate([0, 8, -0.2]) cylinder($fn=32*2, h=10, r=2.5);
translate([8, 0, -0.2]) cylinder($fn=32*2, h=10, r=2.5);
}
}
@ -383,7 +345,7 @@ module planetary_ring_gear_with_clutch() {
rotate([0, 0, -135]) translate([-0.5, 10, -0.1]) cube(size=[1, 10, 10]);
rotate([0, 0, 135]) translate([-0.5, 10, -0.1]) cube(size=[1, 10, 10]);*/
}
translate([0, 0, -0.1]) cylinder($fn=100, h=10, r=2.4);
translate([0, 0, -0.1]) cylinder($fn=100, h=10, r=2.5);
}
translate([0, 0, 10.2]) union() {
clutchTeeth();
@ -433,15 +395,15 @@ module planetary_ring_gear(plane_height = 1) {
translate([8, 0, -0.1]) cylinder($fn=50, h=10, r=3.5);
translate([8, 8, -0.1]) cylinder($fn=50, h=10, r=3.5);
}
translate([-8, -8, -0.1]) cylinder($fn=50, h=10, r=2.4);
translate([-8, 0, -0.1]) cylinder($fn=50, h=10, r=2.4);
translate([-8, 8, -0.1]) cylinder($fn=50, h=10, r=2.4);
translate([0, -8, -0.1]) cylinder($fn=50, h=10, r=2.4);
translate([0, 0, -0.1]) cylinder($fn=50, h=10, r=2.4);
translate([0, 8, -0.1]) cylinder($fn=50, h=10, r=2.4);
translate([8, -8, -0.1]) cylinder($fn=50, h=10, r=2.4);
translate([8, 0, -0.1]) cylinder($fn=50, h=10, r=2.4);
translate([8, 8, -0.1]) cylinder($fn=50, h=10, r=2.4);
translate([-8, -8, -0.1]) cylinder($fn=50, h=10, r=2.5);
translate([-8, 0, -0.1]) cylinder($fn=50, h=10, r=2.5);
translate([-8, 8, -0.1]) cylinder($fn=50, h=10, r=2.5);
translate([0, -8, -0.1]) cylinder($fn=50, h=10, r=2.5);
translate([0, 0, -0.1]) cylinder($fn=50, h=10, r=2.5);
translate([0, 8, -0.1]) cylinder($fn=50, h=10, r=2.5);
translate([8, -8, -0.1]) cylinder($fn=50, h=10, r=2.5);
translate([8, 0, -0.1]) cylinder($fn=50, h=10, r=2.5);
translate([8, 8, -0.1]) cylinder($fn=50, h=10, r=2.5);
}
}
}
@ -461,9 +423,9 @@ module gear28_4holes() {
// from some solid part (like half or full beam)
module pinHole(height=8) {
union() {
translate([0, 0, -0.1]) cylinder($fs=0.5, h=height+0.2, r=2.4);
translate([0, 0, -0.1]) cylinder($fs=0.5, h=0.8+0.1, r=2.9);
translate([0, 0, height-0.8]) cylinder($fs=0.5, h=0.8+0.1, r=2.9);
translate([0, 0, -0.1]) cylinder($fs=0.5, h=height+0.2, r=2.5);
translate([0, 0, -0.1]) cylinder($fs=0.5, h=0.8+0.1, r=3);
translate([0, 0, height-0.8]) cylinder($fs=0.5, h=0.8+0.1, r=3);
}
}
@ -513,7 +475,7 @@ module offsetClutchGear(number_of_teeth) {
translate([0, 0, 4.8]) cylinder($fn=100, h=4, r=3.3);
}
// round hole
translate([0, 0, -3]) cylinder($fn=100, h=12, r=2.45);
translate([0, 0, -3]) cylinder($fn=100, h=12, r=2.5);
// axle hole
//axle(0, 0, -1, 10);
}
@ -529,7 +491,7 @@ module offsetClutchGear(number_of_teeth) {
// Axle
module axle(x, y, z, height) {
axle_gap = 1.85;
hole_radius = 2.4;
hole_radius = 2.5;
union() {
translate([x - hole_radius, y - axle_gap/2, z])
roundedRect([hole_radius * 2, axle_gap, height], .2);
@ -542,7 +504,7 @@ module axle(x, y, z, height) {
module axleCut(x, y, z, height) {
axle_gap = 1.85;
axle_gap_cut = 1.7;
hole_radius = 2.4;
hole_radius = 2.5;
union() {
translate([x - hole_radius, y - axle_gap/2, z])
roundedRect([hole_radius * 2, axle_gap, height], .2);