fix: worm gear issues - echoes, docs, validation, left_handed (#1281)#1955
Open
junhinhow wants to merge 5 commits intoBelfrySCAD:masterfrom
Open
fix: worm gear issues - echoes, docs, validation, left_handed (#1281)#1955junhinhow wants to merge 5 commits intoBelfrySCAD:masterfrom
junhinhow wants to merge 5 commits intoBelfrySCAD:masterfrom
Conversation
The documentation for worm_gear() and its module form stated the default crowning value as 1, but the actual code default is 0.1 (a 10x discrepancy). This could mislead users who rely on the docs to understand the default behavior. Fixed both worm_gear() function and module doc blocks to show the correct default of 0.1. Ref: BelfrySCAD#1281
Remove leftover debug echo statements with garbled variable names (fdeewqqq, feee, feef) from worm_gear() function, and commented-out debug echoes from worm() and worm_gear(). These debug statements cause unwanted ECHO output during normal use and force tests to use assert_no_echoes=false to pass. Removed lines: - worm(): ff=echo(tooth=...) (commented) - worm_gear(): fdeewqqq=echo(toothbounds=...) - worm_gear(): fee=echo(helical=...) (commented) - worm_gear(): eer=echo(full_tooth=...) (commented) - worm_gear(): fdewq=echo(tooth_half1=...) (commented) - worm_gear(): feee=echo(pr_worm=...) - worm_gear(): feef=echo(actual_thick=...) Ref: BelfrySCAD#1281
The worm_arc parameter assertion was commented out in both the function and module forms of worm_gear(). This allowed invalid values to pass silently, potentially producing broken geometry. Re-enabled with bounds 0 < worm_arc <= 90 degrees and a clear error message. The original bound of 60 was too restrictive; 90 degrees is the geometric maximum for a worm gear arc. Ref: BelfrySCAD#1281
Now that debug echo statements have been removed from worm_gear() and worm_gear_thickness(), the tests no longer need assert_no_echoes=false to suppress expected ECHO output. This makes the tests stricter — any unexpected echo output from worm gear functions will now correctly cause test failure. Ref: BelfrySCAD#1281
The enveloping_worm() function had inverted left_handed logic compared to worm(). When left_handed=false (right-handed, the default): - worm(): correctly does NOT apply xflip() - enveloping_worm(): incorrectly DOES apply xflip() This meant a right-handed enveloping_worm would not mesh with a right-handed worm_gear, and vice versa. Fixed by changing "if (!left_handed) xflip()" to "if (left_handed) xflip()" to match the convention used in worm(). Ref: BelfrySCAD#1281
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
worm_gear()documentation: "1" → "0.1"echo()statements from worm gear functionsworm_arcbounds assertion (0-90°) in both function and module formsleft_handedlogic inenveloping_worm():!left_handed→left_handedassert_no_echoes = falseworkarounds from worm gear testsTest plan
test_worm_gearpasses withoutassert_no_echoes = falsetest_worm_gear_thicknesspasses withoutassert_no_echoes = falsetest_enveloping_wormgenerates valid geometrytest_wormgenerates valid geometryAddresses #1281
🤖 Generated with Claude Code