discuss@lists.openscad.org

OpenSCAD general discussion

View all threads

BOSL2/gears bevel_gear bug?

L
LenStruttmann
Sun, Mar 28, 2021 11:29 PM

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;

include <BOSL2/std.scad>;
include <BOSL2/gears.scad>;
include <BOSL2/attachments.scad>;

#bevel_gear(
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.
http://forum.openscad.org/file/t3150/AnchorTop.png

When using anchor=BOTTOM, the gear bottom is just below the axis, as shown
in the second image.
http://forum.openscad.org/file/t3150/AnchorBOTTOM.png

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[0][0].z - select(verts1,-1)[0].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.

Your thoughts?

--
Sent from: http://forum.openscad.org/

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; include <BOSL2/std.scad>; include <BOSL2/gears.scad>; include <BOSL2/attachments.scad>; #bevel_gear( 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. <http://forum.openscad.org/file/t3150/AnchorTop.png> When using anchor=BOTTOM, the gear bottom is just below the axis, as shown in the second image. <http://forum.openscad.org/file/t3150/AnchorBOTTOM.png> 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[0][0].z - select(verts1,-1)[0].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. Your thoughts? -- Sent from: http://forum.openscad.org/