Point rotation BUG in the stock SpurGear script/add-in

Point rotation BUG in the stock SpurGear script/add-in

Anonymous
Not applicable
630 Views
3 Replies
Message 1 of 4

Point rotation BUG in the stock SpurGear script/add-in

Anonymous
Not applicable

The following code (line 209 in the python script version) is incorrect - I have not checked the JS or Cpp versions but it's likely the bug is there as well.

 

    # Rotate the involute so the intersection point lies on the x axis.
    cosAngle = math.cos(-pitchPointAngle + (tooththicknessAngle / 2))
    sinAngle = math.sin(-pitchPointAngle + (tooththicknessAngle / 2))
    for i in range(0, involutePointCount):
        involutePoints[i].x = involutePoints[i].x * cosAngle - involutePoints[i].y * sinAngle
        involutePoints[i].y = involutePoints[i].x * sinAngle + involutePoints[i].y * cosAngle

The error is that the point rotation will be skewed because the Y transformation is computed on the already transformed X.

The corrected code follows

    # Rotate the involute so the intersection point lies on the x axis.
    cosAngle = math.cos(-pitchPointAngle + (tooththicknessAngle / 2))
    sinAngle = math.sin(-pitchPointAngle + (tooththicknessAngle / 2))
    for i in range(0, involutePointCount):
        x = involutePoints[i].x
        involutePoints[i].x = x * cosAngle - involutePoints[i].y * sinAngle
        involutePoints[i].y = x * sinAngle + involutePoints[i].y * cosAngle
0 Likes
631 Views
3 Replies
Replies (3)
Message 2 of 4

ekinsb
Alumni
Alumni

I recently just updated the spur gear program and did find a couple of bugs that I fixed in the process.  I don't remember the details now though of what I fixed.  The new version is coming out in a Fusion 360 update scheduled for next week.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 3 of 4

Anonymous
Not applicable

This issue (point rotation) looks to be fixed in the updated version, which looks excellent by the way. I haven't had a chance to really test it out yet but the descriptive image caught my eye and i noticed that "Module" is labeled incorrectly - What is labled as "Module" is actually Circular Pitch which is Pi * Module. I'm trying to figure out how to describe module with a graphic myself but it's hard to do without declaring d = m*z (Pitch Diameter = Module * Teeth)

 

67eYSFZ

0 Likes
Message 4 of 4

ekinsb
Alumni
Alumni

The incorrect picture was identified right after the update went out and has been corrected and should be in the update next month.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes