Repository navigation
Add radial bearing shorthand and per-face flags - #55
Merged
Merged
Conversation
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
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.
Adds compact radial-bearing strings that expand into explicit dimensions and boolean face flags.
ballbearing608becomesballbearing_id8mm_od22mm_w7mm_bothsidesopen;ballbearing625zzbecomesballbearing_id5mm_od16mm_w5mm_bothsidesshielded.mp.string(source).params().stringexposes 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_topsideopenkeeps 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.mdand 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: