Even though I am a noobie, it looks like I've run across some apparent issues in BOSL2/gears.scad
When using anchor=TOP" or BOTTOM, or "flattop" in bevel_gear(), the resulting translation is incorrect:
Here is my example code:
$fn = 24;
pitch=5, teeth=36, face_width=20, shaft_diam=5,
pitch_angle=45, spiral_angle=0, anchor=BOTTOM // or TOP, or "flattop"
When using anchor=TOP or "flattop", the gear top is just above the axis, as shown in the first image.
When using anchor=BOTTOM, the gear bottom is just below the axis, as shown in the second image.
This issue seems to be caused by the fact that the "thickness" variable is calculated differently in the bevel_gear() function...
Line 963: thickness = abs(verts1.z - select(verts1,-1).z),
...than it is in the bevel_gear() module...
Line 1028: thickness = face_width * cos(pitch_angle);
As someone who is very new to OpenSCAD and BOSL2, my question is:
Q. Is this truly a bug, or am I misinterpreting what anchor is meant to do?
A secondary consequence of this is that the true thickness of the gear is not available to the user.
When using anchor="apex" to get a correctly matched pair of bevels, as far as I can tell, the user MUST have access to the true thickness and/or the distance from the apex to (at least) one face of the gear to correctly place the gears in an assembly. This suggested that one or more bevel-gear informational functions may need to be added.