mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Merge pull request #1232 from BelfrySCAD/revarbat_dev
Implemented herringbone racks.
This commit is contained in:
commit
f74f0565df
1 changed files with 50 additions and 23 deletions
73
gears.scad
73
gears.scad
|
@ -1226,6 +1226,7 @@ module ring_gear2d(
|
||||||
// mod = The metric module/modulus of the gear, or mm of pitch diameter per tooth.
|
// mod = The metric module/modulus of the gear, or mm of pitch diameter per tooth.
|
||||||
// diam_pitch = The diametral pitch, or number of teeth per inch of pitch diameter. Note that the diametral pitch is a completely different thing than the pitch diameter.
|
// diam_pitch = The diametral pitch, or number of teeth per inch of pitch diameter. Note that the diametral pitch is a completely different thing than the pitch diameter.
|
||||||
// helical = The angle of the rack teeth away from perpendicular to the rack length. Used to match helical spur gear pinions. Default: 0
|
// helical = The angle of the rack teeth away from perpendicular to the rack length. Used to match helical spur gear pinions. Default: 0
|
||||||
|
// herringbone = If true, and helical is set, creates a herringbone rack.
|
||||||
// profile_shift = Profile shift factor x. Default: 0
|
// profile_shift = Profile shift factor x. Default: 0
|
||||||
// pressure_angle = Controls how straight or bulged the tooth sides are. In degrees. Default: 20
|
// pressure_angle = Controls how straight or bulged the tooth sides are. In degrees. Default: 20
|
||||||
// backlash = Gap between two meshing teeth, in the direction along the circumference of the pitch circle. Default: 0
|
// backlash = Gap between two meshing teeth, in the direction along the circumference of the pitch circle. Default: 0
|
||||||
|
@ -1283,8 +1284,9 @@ module rack(
|
||||||
backlash = 0.0,
|
backlash = 0.0,
|
||||||
clearance,
|
clearance,
|
||||||
helical,
|
helical,
|
||||||
|
herringbone = false,
|
||||||
profile_shift = 0,
|
profile_shift = 0,
|
||||||
gear_travel=0,
|
gear_travel = 0,
|
||||||
circ_pitch,
|
circ_pitch,
|
||||||
diam_pitch,
|
diam_pitch,
|
||||||
mod,
|
mod,
|
||||||
|
@ -1303,7 +1305,8 @@ module rack(
|
||||||
assert(clearance==undef || (is_finite(clearance) && clearance>=0))
|
assert(clearance==undef || (is_finite(clearance) && clearance>=0))
|
||||||
assert(is_finite(backlash) && backlash>=0)
|
assert(is_finite(backlash) && backlash>=0)
|
||||||
assert(is_finite(helical) && abs(helical)<90)
|
assert(is_finite(helical) && abs(helical)<90)
|
||||||
//assert(is_bool(herringbone))
|
assert(is_bool(herringbone))
|
||||||
|
assert(is_finite(profile_shift))
|
||||||
assert(is_finite(gear_travel));
|
assert(is_finite(gear_travel));
|
||||||
trans_pitch = pitch / cos(helical);
|
trans_pitch = pitch / cos(helical);
|
||||||
a = _adendum(pitch, profile_shift);
|
a = _adendum(pitch, profile_shift);
|
||||||
|
@ -1334,18 +1337,36 @@ module rack(
|
||||||
size = [l, thickness, 2*bottom];
|
size = [l, thickness, 2*bottom];
|
||||||
attachable(anchor,spin,orient, size=size, anchors=anchors) {
|
attachable(anchor,spin,orient, size=size, anchors=anchors) {
|
||||||
right(gear_travel)
|
right(gear_travel)
|
||||||
skew(sxy=-tan(helical)) xrot(90) {
|
xrot(90) {
|
||||||
linear_extrude(height=thickness, center=true, convexity=teeth*2) {
|
if (herringbone) {
|
||||||
rack2d(
|
zflip_copy()
|
||||||
pitch = pitch,
|
skew(axz=-helical) down(0.01)
|
||||||
teeth = teeth,
|
linear_extrude(height=thickness/2, center=false, convexity=teeth*2) {
|
||||||
bottom=bottom,
|
rack2d(
|
||||||
pressure_angle = PA,
|
pitch = pitch,
|
||||||
backlash = backlash,
|
teeth = teeth,
|
||||||
clearance = clearance,
|
bottom = bottom,
|
||||||
helical = helical,
|
pressure_angle = PA,
|
||||||
profile_shift = profile_shift
|
backlash = backlash,
|
||||||
);
|
clearance = clearance,
|
||||||
|
helical = helical,
|
||||||
|
profile_shift = profile_shift
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
skew(axz=helical)
|
||||||
|
linear_extrude(height=thickness, center=true, convexity=teeth*2) {
|
||||||
|
rack2d(
|
||||||
|
pitch = pitch,
|
||||||
|
teeth = teeth,
|
||||||
|
bottom = bottom,
|
||||||
|
pressure_angle = PA,
|
||||||
|
backlash = backlash,
|
||||||
|
clearance = clearance,
|
||||||
|
helical = helical,
|
||||||
|
profile_shift = profile_shift
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
children();
|
children();
|
||||||
|
@ -1362,11 +1383,12 @@ function rack(
|
||||||
backlash = 0.0,
|
backlash = 0.0,
|
||||||
clearance,
|
clearance,
|
||||||
helical,
|
helical,
|
||||||
|
herringbone = false,
|
||||||
profile_shift = 0,
|
profile_shift = 0,
|
||||||
circ_pitch,
|
circ_pitch,
|
||||||
diam_pitch,
|
diam_pitch,
|
||||||
mod,
|
mod,
|
||||||
gear_travel=0,
|
gear_travel = 0,
|
||||||
anchor = CENTER,
|
anchor = CENTER,
|
||||||
spin = 0,
|
spin = 0,
|
||||||
orient = UP
|
orient = UP
|
||||||
|
@ -1383,7 +1405,8 @@ function rack(
|
||||||
assert(clearance==undef || (is_finite(clearance) && clearance>=0))
|
assert(clearance==undef || (is_finite(clearance) && clearance>=0))
|
||||||
assert(is_finite(backlash) && backlash>=0)
|
assert(is_finite(backlash) && backlash>=0)
|
||||||
assert(is_finite(helical) && abs(helical)<90)
|
assert(is_finite(helical) && abs(helical)<90)
|
||||||
//assert(is_bool(herringbone))
|
assert(is_bool(herringbone))
|
||||||
|
assert(is_finite(profile_shift))
|
||||||
assert(is_finite(gear_travel))
|
assert(is_finite(gear_travel))
|
||||||
let(
|
let(
|
||||||
trans_pitch = pitch / cos(helical),
|
trans_pitch = pitch / cos(helical),
|
||||||
|
@ -1403,19 +1426,23 @@ function rack(
|
||||||
path = rack2d(
|
path = rack2d(
|
||||||
pitch = pitch,
|
pitch = pitch,
|
||||||
teeth = teeth,
|
teeth = teeth,
|
||||||
bottom=bottom,
|
bottom = bottom,
|
||||||
pressure_angle = PA,
|
pressure_angle = PA,
|
||||||
backlash = backlash,
|
backlash = backlash,
|
||||||
clearance = clearance,
|
clearance = clearance,
|
||||||
helical = helical,
|
helical = helical,
|
||||||
profile_shift = profile_shift
|
profile_shift = profile_shift
|
||||||
),
|
),
|
||||||
vnf = linear_sweep(path, height=thickness, anchor="origin", orient=FWD),
|
vnf = herringbone
|
||||||
m = product([
|
? sweep(path, [
|
||||||
right(gear_travel),
|
left(adj_ang_to_opp(thickness/2,helical)) *
|
||||||
if (helical) skew(sxy=-tan(helical))
|
back(thickness/2) * xrot(90),
|
||||||
]),
|
xrot(90),
|
||||||
out = apply(m, vnf),
|
left(adj_ang_to_opp(thickness/2,helical)) *
|
||||||
|
fwd(thickness/2) * xrot(90),
|
||||||
|
], style="alt", orient=FWD)
|
||||||
|
: skew(axy=-helical, p=linear_sweep(path, height=thickness, anchor="origin", orient=FWD)),
|
||||||
|
out = right(gear_travel, p=vnf),
|
||||||
size = [l, thickness, 2*bottom],
|
size = [l, thickness, 2*bottom],
|
||||||
anchors = [
|
anchors = [
|
||||||
named_anchor("tip", [0,0,a], BACK),
|
named_anchor("tip", [0,0,a], BACK),
|
||||||
|
|
Loading…
Reference in a new issue