Message 1 of 4
Point rotation BUG in the stock SpurGear script/add-in

Not applicable
09-29-2016
08:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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