mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Docs formatting and gear example image fixes.
This commit is contained in:
parent
fc7518b343
commit
21e9dfa1bf
3 changed files with 190 additions and 187 deletions
|
@ -174,7 +174,7 @@ function _gear_q7(f,r,b,r2,t,s) = _gear_q6(b,s,t,(1-f)*max(b,r)+f*r2); //
|
|||
// Example(2D):
|
||||
// gear_tooth_profile(pitch=5, teeth=20, pressure_angle=20, valleys=false);
|
||||
// Example(2D): As a function
|
||||
// stroke(gear_tooth_profile(pitch=5, teeth=20, pressure_angle=20, valleys=false));
|
||||
// stroke(gear_tooth_profile(pitch=5, teeth=20, pressure_angle=20, valleys=false), width=0.1);
|
||||
function gear_tooth_profile(
|
||||
pitch = 3,
|
||||
teeth = 11,
|
||||
|
@ -222,7 +222,7 @@ module gear_tooth_profile(
|
|||
center = false
|
||||
) {
|
||||
r = root_radius(pitch, teeth, clearance, interior);
|
||||
translate([0,-r,0])
|
||||
fwd(r)
|
||||
polygon(
|
||||
points=gear_tooth_profile(
|
||||
pitch = pitch,
|
||||
|
@ -330,9 +330,9 @@ module gear2d(
|
|||
|
||||
// Function&Module: rack2d()
|
||||
// Usage: As a Function
|
||||
// path = rack2d(pitch, teeth, base, <pressure_angle>, <backlash>);
|
||||
// path = rack2d(pitch, teeth, height, <pressure_angle>, <backlash>);
|
||||
// Usage: As a Module
|
||||
// rack2d(pitch, teeth, base, <pressure_angle>, <backlash>);
|
||||
// rack2d(pitch, teeth, height, <pressure_angle>, <backlash>);
|
||||
// Description:
|
||||
// This is used to create a 2D rack, which is a linear bar with teeth that a gear can roll along.
|
||||
// A rack can mesh with any gear that has the same `pitch` and `pressure_angle`.
|
||||
|
@ -341,7 +341,7 @@ module gear2d(
|
|||
// Arguments:
|
||||
// pitch = The circular pitch, or distance between teeth around the pitch circle, in mm.
|
||||
// teeth = Total number of teeth along the rack
|
||||
// base = Height of rack in mm, from tooth top to back of rack.
|
||||
// height = Height of rack in mm, from tooth top to back of rack.
|
||||
// pressure_angle = Controls how straight or bulged the tooth sides are. In degrees.
|
||||
// backlash = Gap between two meshing teeth, in the direction along the circumference of the pitch circle
|
||||
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#anchor). Default: `CENTER`
|
||||
|
@ -350,18 +350,18 @@ module gear2d(
|
|||
// "adendum" = At the tips of the teeth, at the center of rack.
|
||||
// "adendum-left" = At the tips of the teeth, at the left end of the rack.
|
||||
// "adendum-right" = At the tips of the teeth, at the right end of the rack.
|
||||
// "dedendum" = At the base of the teeth, at the center of rack.
|
||||
// "dedendum-left" = At the base of the teeth, at the left end of the rack.
|
||||
// "dedendum-right" = At the base of the teeth, at the right end of the rack.
|
||||
// "dedendum" = At the height of the teeth, at the center of rack.
|
||||
// "dedendum-left" = At the height of the teeth, at the left end of the rack.
|
||||
// "dedendum-right" = At the height of the teeth, at the right end of the rack.
|
||||
// Example(2D):
|
||||
// rack2d(pitch=5, teeth=10, base=5, pressure_angle=20);
|
||||
// rack2d(pitch=5, teeth=10, height=10, pressure_angle=20);
|
||||
// Example(2D): Called as a Function
|
||||
// path = rack2d(pitch=8, teeth=8, base=5, pressure_angle=28);
|
||||
// path = rack2d(pitch=8, teeth=8, height=10, pressure_angle=28);
|
||||
// polygon(path);
|
||||
function rack2d(
|
||||
pitch = 5,
|
||||
teeth = 20,
|
||||
base = 10,
|
||||
height = 10,
|
||||
pressure_angle = 28,
|
||||
backlash = 0.0,
|
||||
clearance = undef,
|
||||
|
@ -370,7 +370,10 @@ function rack2d(
|
|||
) =
|
||||
let(
|
||||
a = adendum(pitch),
|
||||
d = dedendum(pitch, clearance),
|
||||
d = dedendum(pitch, clearance)
|
||||
)
|
||||
assert(a+d < height)
|
||||
let(
|
||||
xa = a * sin(pressure_angle),
|
||||
xd = d * sin(pressure_angle),
|
||||
l = teeth * pitch,
|
||||
|
@ -383,7 +386,7 @@ function rack2d(
|
|||
anchorpt("dedendum-right", [ l/2,-d,0], RIGHT),
|
||||
],
|
||||
path = [
|
||||
[-(teeth-1)/2 * pitch + -1/2 * pitch, a-base],
|
||||
[-(teeth-1)/2 * pitch + -1/2 * pitch, a-height],
|
||||
[-(teeth-1)/2 * pitch + -1/2 * pitch, -d],
|
||||
for (i = [0:1:teeth-1]) let(
|
||||
off = (i-(teeth-1)/2) * pitch
|
||||
|
@ -394,15 +397,15 @@ function rack2d(
|
|||
[off + 1/4 * pitch - backlash + xd, -d],
|
||||
],
|
||||
[ (teeth-1)/2 * pitch + 1/2 * pitch, -d],
|
||||
[ (teeth-1)/2 * pitch + 1/2 * pitch, a-base],
|
||||
[ (teeth-1)/2 * pitch + 1/2 * pitch, a-height],
|
||||
]
|
||||
) reorient(anchor,spin, two_d=true, size=[l,2*abs(a-base)], anchors=anchors, p=path);
|
||||
) reorient(anchor,spin, two_d=true, size=[l,2*abs(a-height)], anchors=anchors, p=path);
|
||||
|
||||
|
||||
module rack2d(
|
||||
pitch = 5,
|
||||
teeth = 20,
|
||||
base = 10,
|
||||
height = 10,
|
||||
pressure_angle = 28,
|
||||
backlash = 0.0,
|
||||
clearance = undef,
|
||||
|
@ -423,12 +426,12 @@ module rack2d(
|
|||
path = rack2d(
|
||||
pitch = pitch,
|
||||
teeth = teeth,
|
||||
base = base,
|
||||
height = height,
|
||||
pressure_angle = pressure_angle,
|
||||
backlash = backlash,
|
||||
clearance = clearance
|
||||
);
|
||||
attachable(anchor,spin, two_d=true, size=[l, 2*abs(a-base)], anchors=anchors) {
|
||||
attachable(anchor,spin, two_d=true, size=[l, 2*abs(a-height)], anchors=anchors) {
|
||||
polygon(path);
|
||||
children();
|
||||
}
|
||||
|
@ -503,7 +506,7 @@ module rack2d(
|
|||
// translate([ d13, 0, 0]) rotate([0,0,-($t-n3/4+n1/4+1/2)*360/n3]) color([0.75,0.75,1.00]) gear(pitch,n3,thickness,hole);
|
||||
// translate([ d13, 0, 0]) rotate([0,0,-($t-n3/4+n1/4+1/2)*360/n3]) color([0.75,0.75,1.00]) gear(pitch,n3,thickness,hole);
|
||||
// translate([-d14, 0, 0]) rotate([0,0,-($t-n4/4-n1/4+1/2-floor(n4/4)-3)*360/n4]) color([1.00,0.75,0.50]) gear(pitch,n4,thickness,hole,hide=n4-3);
|
||||
// translate([(-floor(n5/2)-floor(n1/2)+$t+n1/2)*9, -d1+0.0, 0]) color([0.75,0.75,0.75]) rack(pitch=pitch,teeth=n5,thickness=thickness,base=rack_base,anchor=CENTER,orient=BACK);
|
||||
// translate([(-floor(n5/2)-floor(n1/2)+$t+n1/2)*9, -d1+0.0, 0]) color([0.75,0.75,0.75]) rack(pitch=pitch,teeth=n5,thickness=thickness,height=rack_base,anchor=CENTER,orient=BACK);
|
||||
function gear(
|
||||
pitch = 3,
|
||||
teeth = 11,
|
||||
|
@ -742,7 +745,7 @@ module bevel_gear(
|
|||
teeth = 11,
|
||||
face_width = 10,
|
||||
pitch_angle = 45,
|
||||
mate_teeth = undef,
|
||||
mate_teeth,
|
||||
shaft_diam = 3,
|
||||
hide = 0,
|
||||
pressure_angle = 20,
|
||||
|
@ -799,9 +802,9 @@ module bevel_gear(
|
|||
|
||||
// Function&Module: rack()
|
||||
// Usage: As a Module
|
||||
// rack(pitch, teeth, thickness, base, <pressure_angle>, <backlash>);
|
||||
// rack(pitch, teeth, thickness, height, <pressure_angle>, <backlash>);
|
||||
// Usage: As a Function
|
||||
// vnf = rack(pitch, teeth, thickness, base, <pressure_angle>, <backlash>);
|
||||
// vnf = rack(pitch, teeth, thickness, height, <pressure_angle>, <backlash>);
|
||||
// Description:
|
||||
// This is used to create a 3D rack, which is a linear bar with teeth that a gear can roll along.
|
||||
// A rack can mesh with any gear that has the same `pitch` and `pressure_angle`.
|
||||
|
@ -811,7 +814,7 @@ module bevel_gear(
|
|||
// pitch = The circular pitch, or distance between teeth around the pitch circle, in mm.
|
||||
// teeth = Total number of teeth along the rack
|
||||
// thickness = Thickness of rack in mm (affects each tooth)
|
||||
// base = Height of rack in mm, from tooth top to back of rack.
|
||||
// height = Height of rack in mm, from tooth top to back of rack.
|
||||
// pressure_angle = Controls how straight or bulged the tooth sides are. In degrees.
|
||||
// backlash = Gap between two meshing teeth, in the direction along the circumference of the pitch circle
|
||||
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#anchor). Default: `CENTER`
|
||||
|
@ -829,12 +832,12 @@ module bevel_gear(
|
|||
// "dedendum-back" = At the base of the teeth, at the back of the rack.
|
||||
// "dedendum-front" = At the base of the teeth, at the front of the rack.
|
||||
// Example:
|
||||
// rack(pitch=5, teeth=10, thickness=5, base=5, pressure_angle=20);
|
||||
// rack(pitch=5, teeth=10, thickness=5, height=5, pressure_angle=20);
|
||||
module rack(
|
||||
pitch = 5,
|
||||
teeth = 20,
|
||||
thickness = 5,
|
||||
base = 10,
|
||||
height = 10,
|
||||
pressure_angle = 28,
|
||||
backlash = 0.0,
|
||||
clearance = undef,
|
||||
|
@ -857,13 +860,13 @@ module rack(
|
|||
anchorpt("dedendum-front", [0,-thickness/2,-d], DOWN),
|
||||
anchorpt("dedendum-back", [0, thickness/2,-d], UP),
|
||||
];
|
||||
attachable(anchor,spin,orient, size=[l, thickness, 2*abs(a-base)], anchors=anchors) {
|
||||
attachable(anchor,spin,orient, size=[l, thickness, 2*abs(a-height)], anchors=anchors) {
|
||||
xrot(90) {
|
||||
linear_extrude(height=thickness, center=true, convexity=teeth*2) {
|
||||
rack2d(
|
||||
pitch = pitch,
|
||||
teeth = teeth,
|
||||
base = base,
|
||||
height = height,
|
||||
pressure_angle = pressure_angle,
|
||||
backlash = backlash,
|
||||
clearance = clearance
|
||||
|
@ -879,7 +882,7 @@ function rack(
|
|||
pitch = 5,
|
||||
teeth = 20,
|
||||
thickness = 5,
|
||||
base = 10,
|
||||
height = 10,
|
||||
pressure_angle = 28,
|
||||
backlash = 0.0,
|
||||
clearance = undef,
|
||||
|
@ -906,13 +909,13 @@ function rack(
|
|||
path = rack2d(
|
||||
pitch = pitch,
|
||||
teeth = teeth,
|
||||
base = base,
|
||||
height = height,
|
||||
pressure_angle = pressure_angle,
|
||||
backlash = backlash,
|
||||
clearance = clearance
|
||||
),
|
||||
vnf = linear_sweep(path, height=thickness, anchor="origin", orient=FWD)
|
||||
) reorient(anchor,spin,orient, size=[l, thickness, 2*abs(a-base)], anchors=anchors, p=vnf);
|
||||
) reorient(anchor,spin,orient, size=[l, thickness, 2*abs(a-height)], anchors=anchors, p=vnf);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -294,11 +294,11 @@ def mkdn_esc(txt):
|
|||
while txt:
|
||||
m = quotpat.match(txt)
|
||||
if m:
|
||||
out += m.group(1).replace(r'_', r'\_')
|
||||
out += m.group(1).replace(r'_', r'\_').replace(r'&',r'&').replace(r'<', r'<').replace(r'>',r'>')
|
||||
out += m.group(2)
|
||||
txt = m.group(3)
|
||||
else:
|
||||
out += txt.replace(r'_', r'\_')
|
||||
out += txt.replace(r'_', r'\_').replace(r'&',r'&').replace(r'<', r'<').replace(r'>',r'>')
|
||||
txt = ""
|
||||
return out
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOSL_VERSION = [2,0,453];
|
||||
BOSL_VERSION = [2,0,454];
|
||||
|
||||
|
||||
// Section: BOSL Library Version Functions
|
||||
|
|
Loading…
Reference in a new issue