Skip to content

Add radial bearing shorthand and per-face flags - #55

Merged
seveibar merged 2 commits into
mainfrom
codex/motion-ball-bearings
Oct 7, 2026
Merged

seveibar merged 2 commits into
mainfrom
codex/motion-ball-bearings

Conversation

@seveibar

@seveibar seveibar commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Adds compact radial-bearing strings that expand into explicit dimensions and boolean face flags. ballbearing608 becomes ballbearing_id8mm_od22mm_w7mm_bothsidesopen; ballbearing625zz becomes ballbearing_id5mm_od16mm_w5mm_bothsidesshielded. mp.string(source).params().string exposes the expanded string, and .json() resolves six booleans with exactly one true flag per face.

Supports conventional envelope codes 608, 625, 624, 6000, 6001 and 6002. Z/RS selects a bottom shield/seal; ZZ/2Z/2RS selects both. Value-free global flags (_open, _bothsidesopen, _bothsidesshielded, _bothsidessealed) override suffix defaults, and face flags override those globals independently of order. ballbearing625zz_topsideopen keeps the bottom shield. Repeated/conflicting selectors, unknown suffixes, malformed units and conflicting dimensions are rejected before expansion.

Model logic and public schemas live in src/models/ballbearing/. A pure optional registration normalizer supports model-local expansion while leaving existing models' raw parameters and parsers unchanged. AGENTS.md and registration documentation guide future standard/de-facto naming, flag APIs, canonicalization and validation. These bearing dimensions and visualization internals carry no vendor-specific construction or load-rating claims.

Paired renderer: jscad-electronics#439, targeting main and consuming this PR's exact immutable preview package. Verified live 625 ZZ model. All 16 compact/asymmetric browser fixtures rendered real model canvases without page/console errors or failed requests.

Validation: exact-head CI is green. Locally, all 80 Modelprinter tests / 2,413 assertions, typecheck, format check and build pass. Renderer checks pass all 14 targeted tests and nine snapshot comparisons. Ordinary Node/TypeScript packaged-consumer audits preserve all 23 existing model definitions/geometries, 404 existing public declarations and 46 schema inputs/outputs; 22 bearing cases pass Three.js conversion and real GLB export with compact/full-form output equivalence. Both exact-head published preview packages match the audited build bytes. Three reviewed symmetric meshes retain exact hashes. Six existing PCB/connector footprints and the current fan adapter remain unchanged.

Supersedes #17. Manual review only; auto-merge is disabled.

Generated paired-renderer snapshots (ISOMETRIC, TOP, FRONT, SIDE), labeled with full canonical model strings. ISOMETRIC shows the bottom face and TOP shows the top:

ballbearing-open four views

ballbearing-shielded four views

ballbearing-sealed four views

ballbearing-top-open-bottom-shielded four views

ballbearing-top-open-bottom-sealed four views

ballbearing-top-shielded-bottom-open four views

ballbearing-top-shielded-bottom-sealed four views

ballbearing-top-sealed-bottom-open four views

ballbearing-top-sealed-bottom-shielded four views

@seveibar seveibar changed the title Add radial and thrust bearing contracts with folder-local registration Add radial bearing shorthand and per-face flags Oct 7, 2026
@seveibar
seveibar merged commit 5ba1ce8 into main Oct 7, 2026
3 checks passed
@tscircuitbot

Copy link
Copy Markdown

Thank you for your contribution! 🎉

PR Rating: ⭐⭐⭐
Impact: Major

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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.

2 participants