mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 17:59:41 +00:00
Merge pull request #1192 from BelfrySCAD/revarbat_dev
Herringbone gear example.
This commit is contained in:
commit
aaa64c4119
1 changed files with 23 additions and 6 deletions
29
gears.scad
29
gears.scad
|
@ -92,6 +92,17 @@
|
||||||
// shaft_diam=5, helical=-30, slices=12,
|
// shaft_diam=5, helical=-30, slices=12,
|
||||||
// $fa=1, $fs=1
|
// $fa=1, $fs=1
|
||||||
// );
|
// );
|
||||||
|
// Example: Herringbone Gear
|
||||||
|
// spur_gear(
|
||||||
|
// pitch=5, teeth=20, thickness=5,
|
||||||
|
// shaft_diam=5, helical=-30, slices=5,
|
||||||
|
// anchor=BOT
|
||||||
|
// ) attach(BOT,TOP,overlap=0.01)
|
||||||
|
// spur_gear(
|
||||||
|
// pitch=5, teeth=20, thickness=5,
|
||||||
|
// shaft_diam=5, helical=30, slices=5,
|
||||||
|
// anchor=TOP
|
||||||
|
// );
|
||||||
// Example(Anim,Frames=8,VPT=[0,30,0],VPR=[0,0,0],VPD=300): Assembly of Gears
|
// Example(Anim,Frames=8,VPT=[0,30,0],VPR=[0,0,0],VPD=300): Assembly of Gears
|
||||||
// n1 = 11; //red gear number of teeth
|
// n1 = 11; //red gear number of teeth
|
||||||
// n2 = 20; //green gear
|
// n2 = 20; //green gear
|
||||||
|
@ -200,7 +211,8 @@ function spur_gear(
|
||||||
),
|
),
|
||||||
if (shaft_diam > 0) circle(d=shaft_diam, $fn=max(12,segs(shaft_diam/2)))
|
if (shaft_diam > 0) circle(d=shaft_diam, $fn=max(12,segs(shaft_diam/2)))
|
||||||
],
|
],
|
||||||
vnf = linear_sweep(rgn, height=thickness, center=true)
|
rvnf = linear_sweep(rgn, height=thickness, twist=twist, slices=slices, center=true),
|
||||||
|
vnf = zrot(twist/2, p=rvnf)
|
||||||
) reorient(anchor,spin,orient, h=thickness, r=p, p=vnf);
|
) reorient(anchor,spin,orient, h=thickness, r=p, p=vnf);
|
||||||
|
|
||||||
|
|
||||||
|
@ -227,8 +239,13 @@ module spur_gear(
|
||||||
r = _root_radius(pitch, teeth, clearance, interior);
|
r = _root_radius(pitch, teeth, clearance, interior);
|
||||||
twist = atan2(thickness*tan(helical),p);
|
twist = atan2(thickness*tan(helical),p);
|
||||||
attachable(anchor,spin,orient, r=p, l=thickness) {
|
attachable(anchor,spin,orient, r=p, l=thickness) {
|
||||||
difference() {
|
zrot(twist/2)
|
||||||
linear_extrude(height=thickness, center=true, convexity=teeth/2, twist=twist) {
|
linear_extrude(
|
||||||
|
height=thickness, center=true,
|
||||||
|
twist=twist, slices=slices,
|
||||||
|
convexity=teeth/2
|
||||||
|
) {
|
||||||
|
difference() {
|
||||||
spur_gear2d(
|
spur_gear2d(
|
||||||
pitch = pitch,
|
pitch = pitch,
|
||||||
teeth = teeth,
|
teeth = teeth,
|
||||||
|
@ -238,9 +255,9 @@ module spur_gear(
|
||||||
backlash = backlash,
|
backlash = backlash,
|
||||||
interior = interior
|
interior = interior
|
||||||
);
|
);
|
||||||
}
|
if (shaft_diam > 0) {
|
||||||
if (shaft_diam > 0) {
|
circle(r=shaft_diam/2, $fn=max(12,segs(shaft_diam/2)));
|
||||||
cylinder(h=2*thickness+1, r=shaft_diam/2, center=true, $fn=max(12,segs(shaft_diam/2)));
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
children();
|
children();
|
||||||
|
|
Loading…
Reference in a new issue