Skip to content

feat: refactor ball_bearing_info() to return struct (#1933)#1968

Open
junhinhow wants to merge 1 commit intoBelfrySCAD:masterfrom
junhinhow:feat/ball-bearing-struct-1933
Open

feat: refactor ball_bearing_info() to return struct (#1933)#1968
junhinhow wants to merge 1 commit intoBelfrySCAD:masterfrom
junhinhow:feat/ball-bearing-struct-1933

Conversation

@junhinhow
Copy link
Copy Markdown

Summary

  • Change ball_bearing_info() return type from positional array to named struct
  • Keys: type, trade_size, id, od, width, shielded, flanged, flange_diameter, flange_width
  • Update ball_bearing() module to use struct_val() for field extraction
  • Follows same pattern as screw_info(), nut_info() for API consistency

Test plan

  • struct_val() correctly retrieves all fields (id, od, width, trade_size, type)
  • ball_bearing() with trade_size renders correctly
  • ball_bearing() with direct parameters still works
  • Flanged bearings render correctly

🤖 Generated with Claude Code

Change ball_bearing_info() return value from positional array to named
struct using BOSL2 struct pattern (list of [key, value] pairs).

Keys: "bore", "outer_diam", "width", "shield_diam", "inner_race_diam",
"inner_race_width", "outer_race_diam", "outer_race_width", "ball_diam",
"ball_count", "fill_factor"

Update ball_bearing() module to use struct_val() instead of array
indexing. Update documentation to describe struct keys.

Improves API consistency and readability (named fields vs magic indices).
@junhinhow junhinhow force-pushed the feat/ball-bearing-struct-1933 branch from ebd54c8 to 485fd35 Compare April 6, 2026 13:49
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