Skip to content

fix: worm gear issues - echoes, docs, validation, left_handed (#1281)#1955

Open
junhinhow wants to merge 5 commits intoBelfrySCAD:masterfrom
junhinhow:fix/worm-gear-issues-1281
Open

fix: worm gear issues - echoes, docs, validation, left_handed (#1281)#1955
junhinhow wants to merge 5 commits intoBelfrySCAD:masterfrom
junhinhow:fix/worm-gear-issues-1281

Conversation

@junhinhow
Copy link
Copy Markdown

Summary

  • Fix crowning default value in worm_gear() documentation: "1" → "0.1"
  • Remove 7 leftover debug echo() statements from worm gear functions
  • Re-enable worm_arc bounds assertion (0-90°) in both function and module forms
  • Fix inverted left_handed logic in enveloping_worm(): !left_handedleft_handed
  • Remove assert_no_echoes = false workarounds from worm gear tests

Test plan

  • test_worm_gear passes without assert_no_echoes = false
  • test_worm_gear_thickness passes without assert_no_echoes = false
  • test_enveloping_worm generates valid geometry
  • test_worm generates valid geometry
  • No regressions in other gear tests

Addresses #1281

🤖 Generated with Claude Code

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant