Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,28 @@ The rack module matches the gear module directly, without additional helix-based
* `helix_angle` = bevel angle perpendicular to the rack's length; 0° = straight teeth


## Parametric Herringbone Gear Rack

<img src="examples/herringbone_rack.png" alt="Herringbone Rack" width="300" />

Creates a herringbone gear rack by mirroring two helical racks.

This script adjusts the pressure angle in the transverse section to the helix angle: e.g. with a 20° helix angle, a pressure angle of 20° becomes a pressure angle of 21.17° in the transverse section.
The rack module matches the gear module directly, without additional helix-based scaling.

### Format

`herringbone_rack(modul, length, height, width, pressure_angle=20, helix_angle=45)`

#### Parameters
* `modul` = height of the tooth above the pitch line
* `length` = length of the rack
* `height` = height from bottom to the pitch line
* `width` = face width
* `pressure_angle` = pressure angle, standard value = 20° according to DIN 867. Should not be greater than 45°.
* `helix_angle` = bevel angle perpendicular to the rack's length; 0° = straight teeth


## Parametric Involute Spur Gear

<img src="examples/spur_gear.png" alt="Spur Gear" width="300" />
Expand Down
Binary file modified examples/herringbone_rack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/herringbone_rack.scad
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include <../gears.scad>

rotate([90,0,0])
herringbone_rack(modul=1, length=60, height=5, width=20, pressure_angle=20, helix_angle=45);
Binary file modified examples/mountable_herringbone_rack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/mountable_herringbone_rack.scad
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include <../gears.scad>

rotate([90,0,0])
mountable_herringbone_rack(modul=1, length=60, height=5, width=20, pressure_angle=20, helix_angle=45, profile=3, head="PH", fastners=3);
Binary file modified examples/mountable_rack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/mountable_rack.scad
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include <../gears.scad>

rotate([90,0,0])
mountable_rack(modul=1, length=60, height=5, width=20, pressure_angle=20, helix_angle=0, profile=3, head="PH", fastners=3);
Binary file modified examples/rack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/rack.scad
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include <../gears.scad>

rotate([0,0,180])
rotate([90,0,0])
rack(modul=1, length=60, height=5, width=20, pressure_angle=20, helix_angle=0);
30 changes: 26 additions & 4 deletions examples/render_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,34 @@ else
exit 1
fi

for scad in "${SCRIPT_DIR}"/*.scad; do
render_one() {
local scad="$1"
local base
base="$(basename "${scad}" .scad)"
if [[ "${base}" == "demo" ]]; then
continue
return 0
fi
out="${SCRIPT_DIR}/${base}.png"
local out="${SCRIPT_DIR}/${base}.png"
"${OPENSCAD_BIN}" -o "${out}" --imgsize 800,800 "${scad}"
echo "Rendered ${out}"
done
}

if [[ "${1:-}" != "" ]]; then
target="${1}"
if [[ "${target}" != /* ]]; then
if [[ "${target}" != *.scad ]]; then
target="${SCRIPT_DIR}/${target}.scad"
else
target="${SCRIPT_DIR}/${target}"
fi
fi
if [[ ! -f "${target}" ]]; then
echo "Error: SCAD file not found: ${target}" >&2
exit 1
fi
render_one "${target}"
else
for scad in "${SCRIPT_DIR}"/*.scad; do
render_one "${scad}"
done
fi
34 changes: 21 additions & 13 deletions gears.scad
Original file line number Diff line number Diff line change
Expand Up @@ -199,21 +199,29 @@ module involute_rack(modul, length, height, width, pressure_angle = 20, helix_an
);

translate([-pitch*(nz-1)/2,0,0]){
intersection(){
copier([1,0,0], nz, pitch, 0){
multmatrix(m = [
[1,0,x_slope,0],
[0,1,0,0],
[0,0,1,0],
[0,0,0,1]
])
linear_extrude(height = width, convexity = 10)
polygon(points_2d);
union(){
intersection(){
copier([1,0,0], nz, pitch, 0){
multmatrix(m = [
[1,0,x_slope,0],
[0,1,0,0],
[0,0,1,0],
[0,0,0,1]
])
linear_extrude(height = width, convexity = 10)
polygon(points_2d);
};
translate([abs(x_shift),-height-0.5,-0.5]){
cube([length,height+mx+1,width+1]); // Cuboid which includes the Volume of the Rack
}
};
translate([abs(x_shift),-height-0.5,-0.5]){
cube([length,height+mx+1,width+1]); // Cuboid which includes the Volume of the Rack
body_height = height - (mx + c);
if (body_height > 0) {
translate([abs(x_shift),-height,0]){
cube([length,body_height,width]); // Rectangular rack body
}
}
};
}
};
}

Expand Down