Repository navigation
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
| Layer / File(s) | Summary |
|---|---|
Gear data and document lifecycle crates/doc/src/document.rs, crates/doc/src/component_removal.rs, crates/doc/src/placement_reuse.rs, crates/doc/src/format/pending/spur-gears.rs, crates/engine/src/cmd/component_clone.rs, crates/engine/src/cmd/component_extract.rs |
Documents now store gear specifications by component. Component removal, cloning, extraction, and geometry-input comparisons account for gear records. |
Gear profile geometry crates/engine/src/cmd/gear_profile.rs |
GearSpec calculates gear radii and generates validated external and internal outlines. Optional root fillets and tip rounding are supported. Tests cover geometry and invalid inputs. |
Gear command contracts and construction crates/engine/src/schema/gears.rs, crates/engine/src/schema/mod.rs, crates/engine/src/cmd/gears.rs, crates/engine/src/cmd/mod.rs, crates/engine/src/cmd/gears_tests.rs |
Public schemas and commands support gear insertion and editing. Commands validate settings, build solids, store specifications, and return calculated diameters. Tests cover insertion, editing, persistence, and geometry options. |
Gear dialog and application entry points crates/ui-egui/src/dialogs_gear.rs, crates/ui-egui/src/dialogs_part_size.rs, crates/ui-egui/src/dialogs.rs, crates/ui-egui/src/dialogs_dense.rs, crates/ui-egui/src/context_menu.rs, crates/ui-egui/src/command_help.rs, crates/ui-egui/src/lib.rs, crates/ui-egui/src/workspace.rs, assets/locales/pending/gear-insert.json, docs/ribbon-layout.md |
The UI adds gear insertion and editing forms, selection helpers, and context-menu actions. The commands appear in the library menu and help, with translated labels and text. |
Estimated code review effort: 4 (Complex) | ~60 minutes
Merge Risk: 
Moderate · previous review 6fda8
-
Insert and Edit Gear work in the normal case, but extracting a gear loses its editable parameters. Editing a gear can delete other sketches kept in the same component, and an unrelated feature error elsewhere in the design can block an edit. These should be fixed before merge.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the main change: a new Insert tab command that adds spur gears set by module and tooth count. The changeset adds gear.insert and gear.edit commands, a gear profile generator, a gear dialog, and persistence, which match this. The title is short, specific, and does not describe anything absent from the changeset. It omits helical, internal gears, and editing, but it does not need to cover every detail.
Full details: Linked Issues check
-
Explanation
Active directly linked issue:
#6796. Closed#7137is background only and adds no requirements. The summary shows implementation for each#6796objective. External and internal gears: gear.insert and gear.edit in crates/engine/src/cmd/gears.rs, with internal gears built as a disc with teeth cut out. Parameters: module, tooth count, pressure angle, face width, profile shift, backlash, clearance, root fillet, tip rounding, flank_points (profile accuracy) and backlash_thicker (backlash direction), in SpurGear and GearSpec. Helical and double-helical teeth: helix_angle and double_helical, with a twisted sweep and mirrored half. Internal rim thickness: rim_thickness. External axle holes, centred or offset: bore_diameter and bore_offset. Diameter display: gear_diameters and the Insert Gear form. Persistence: Document.gears, with save, reopen, clone and extract handling. Unchanged-value no-op: gear.edit skips the rebuild. Edit in place: gear.edit rebuilds the features. Tests: gears_tests.rs and the gear profile tests. Note: a double-helical internal gear is refused with a message. The issue does not require that case explicitly, so this does not fail the assessment. Meshing gear trains are deferred to#12455, which the issue also defers. Runtime results are not independently verified here: the Linux test build did not complete on the fork's CI, as the PR description states.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within
#6796. Core gear work covers the gear profile generator, gear commands, schema types, document storage and the Gear dialog. Supporting changes connect gears to existing behaviour: component removal, clone and extract, placement reuse, same_but_features and same_model_source comparisons, and context-menu Edit Gear. The predicate generalisation in dialogs_part_size.rs supports gear selection while keeping the existing Change Part Size behaviour through the old helpers. Command registration, help text, the ribbon layout doc and the pending locale file support the new commands. No change was found that lacks a connection to the gear feature. The doc cost test flakiness and GPU test failure are test-environment issues, not scope issues.
Full details: Description check
-
Explanation
The description is thorough and largely complete. It states the change in plain words (Insert Gear and Edit Gear commands for involute spur and helical gears, external or internal). It includes the required 'Changes a default: No.' line. The Validation section lists local test runs, the partial xtask runs, the failed or incomplete fork CI run, and an app-geometry check. It includes 1280x720 screenshots of the Insert tab, the form with live preview, and the result, as the template requires for UI additions. It links issue
#6796and explains scope limits (meshing gear trains deferred to#12455, root fillets and tip rounding not included). The Integration status section from the template is missing: it does not record the upstream commit and PR status checked before handoff, or the post-integration validation. The description says the branch is at 6612c88 with main merged as of Nov 23, which partly covers this, but it does not state the upstream PR status. The description also has a small inconsistency: it says root fillets and tip rounding are not included, while the raw summary says gear.insert and the gear profile code include root_fillet and tip_round parameters. The author should confirm which is correct and align the text with the code. The full CI suite has not passed on this branch, and the author states this openly.
Full details: Existing Defaults Unchanged
-
Explanation
The PR changes no existing UX default. Its changes are additive. Evidence reviewed: - Ribbon, INSERT > LIBRARY (crates/ui-egui/src/workspace.rs,
SECTIONS). The list changes from["parts.fastener", "parts.library", "parts.resize", "parts.insert"]to["parts.fastener", "parts.library", "parts.resize", "gear.insert", "parts.insert", "gear.edit"]. The promoted count stays 3, so the three promoted buttons do not change. Before: Insert Part was the fourth menu item. After: it is the fifth, because Insert Gear sits ahead of it. Insert Gear and Edit Gear are new entries. No existing entry is removed, renamed, or hidden. The only existing-item change is that Insert Part moves down one menu slot. - Context menus (crates/ui-egui/src/context_menu.rs). "Edit Gear" appears only when the selected component or body is a gear (dialogs_gear::selected/of_bodies). Other menus are unchanged. - Command help (DOCUMENTED) and docs/ribbon-layout.md. These are documentation lists. They do not change any behaviour. - Dialog routing (dialogs.rs, dialogs_dense.rs).Kind::Gearis a new variant. Existing dialogs keep their routing. - dialogs_part_size.rs. The_wherehelpers keep the standard-part predicatedoc.parts.contains_keyas the default, so existing Change Part Size behaviour is unchanged. - Geometry and document changes (gears, component clone/extract, placement reuse, same_but_features) add data. They do not change existing kernel or geometry results. Under the check's rules, these are not UX defaults. The PR description states "Changes a default: No.". The code changes no UX default, so that statement is consistent with the code. Caveat: the localmainis the merge-base, but the branch carries about 987 commits of other upstream work. The branch-wide diff therefore includes unrelated UI changes, such as the workspace focus logic. I excluded those from this assessment because they are not this PR's gear changes. The gear-specific hunks are the ones listed above. Prior failure: the standing FAIL gave no details, so I cannot refute its specific claims. I re-checked the current diff against the check criteria. It finds no changed UX default beyond the additive Library entries and the one-slot shift of Insert Part. Prior failure refuted: The prior FAIL gave no details, so its specific claims cannot be checked. Re-review of the current diff finds no changed existing UX default: the ribbon change only adds gear.insert and gear.edit to INSERT > LIBRARY with the promoted count still 3, the context-menu Edit Gear entry shows only for gear components, and the remaining changes are data, documentation, or refactors that keep prior def...
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
…count Brings in tangency-labs#13431 (draft, by bourneash): `gear.insert` sketches an external involute spur gear from its module, tooth count and pressure angle, and extrudes it as a component of its own. Fixed for current upstream: a fit spline now takes `handles` (empty keeps the natural interpolation). The two sorted mod lists that conflicted keep both sides. Gate (`cargo xtask ci`, macOS): every static stage, clippy and the wasm check pass, and so do the 11 gear tests. The test failures are outside what the merge touches: the engine's known macOS fillet, extent, hole and mirror cases, a hole-pattern timing test run alongside every other binary, ui-egui agent-runtime and slicer tests, the SMLib, kernel and GPU crates, and three CLI corpus and fuzz-help tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
075918f to
3b92179
Compare
3b92179 to
e46e0e2
Compare
…angency-labs#6796) Adds gear.insert, which makes an external spur gear as a new component from module, tooth count, pressure angle, face width, profile shift and backlash. The tooth outline comes from the involute equations (gear_profile.rs); each flank is one spline, so a tooth is 4 sketch edges and the extrude stays fast. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…through clone, extract and removal (tangency-labs#6796) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…bs#6796) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e exactly (tangency-labs#6796) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nd an Insert Gear / Edit Gear form (tangency-labs#6796) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…6796) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…anguage (tangency-labs#6796) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…y menus (tangency-labs#6796) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
e46e0e2 to
69157f6
Compare
…e form shows the profile diameters (tangency-labs#6796) An Edit Gear that sends the saved values no longer deletes and rebuilds the features, bumps the revision, or makes an undo step. The form shows pitch, base, outside and root diameters from the values as they are, before anything is inserted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… and profile accuracy (tangency-labs#6796) The roots lie m (1 + clearance - shift) inside the pitch circle (0.25 as before). Each flank-to-root and flank-to-tip corner can be rounded with an arc; a radius too large for the tooth is refused with the most it allows. The backlash can thicken the teeth for a mate that carries the clearance. The form shows all of these and the points per flank. A design saved before these existed opens with the values it was built with. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d Reset (tangency-labs#6796) Insert Gear and Edit Gear use the gear icon instead of the fastener one. The form previews the gear as the values change and leaves the design alone on Cancel. Spur, helical, herringbone and ring presets set the kind of gear and keep its size; Reset goes back to what the form opened with (the saved values when editing). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…erman internal-gear label (tangency-labs#6796) The five preset/Reset buttons pushed the form wider than its card; they now wrap. gear.edit gets its help text in every language, and the German label for internal gears matches the one the coupling dialog already uses. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…orm (tangency-labs#6796) The wrapped preset row sat in a fixed-height form row, so only Spur and Helical showed. The presets now take the full width of the card under their heading. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Screenshots of the Insert Gear form from the real app running on this branch (commit 39d4f9f). First image: the Helical starting point sets a 20° helix angle and the gear previews live with twisted teeth. Second image: the Ring starting point makes a 40-tooth internal gear with a ring thickness, and the form lists the pitch, base, outside and root diameters. The Spur, Helical, Herringbone and Ring buttons and Reset are at the top of the form; the toolbar button now shows the gear icon.
|
|
Hi @bourneash, nice work on this. I have a local branch with a standard-parts gear library in the Insert → Library panel. It overlaps with this PR on spur, helical, double helical and internal gears, so I won't open anything for those: this PR has the claim for #6796. The branch also has gear types this PR doesn't cover:
Each part is built in its own component, so several identical gears never share feature names. That is the problem that broke the earlier #6618 and the gear plugin in #15958. Once this PR lands, I'd like to send these as separate follow-up PRs, one topic each, on top of your profile generator ( Does that work for you? Is there anything in the form or the The branch is here if you want to look: gun4as/solidcraft |
|
This also conflicts with main now, in four files. All of them are list entries:
The screenshot ask above still stands. git fetch https://github.com/tangency-labs/solidcraft.git main
git merge FETCH_HEAD
# resolve as above, then
git add -A && git commit --no-edit && git push |
|
@bherbruck screenshots are in the description now (1280x720, whole window): the Insert tab, the Library menu with Insert Gear, the form with its live preview, and the gear it makes. I also merged main and fixed the CodeRabbit findings. One thing still open on my side: |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks for the merge. Main moved again, and it conflicts in git fetch https://github.com/tangency-labs/solidcraft.git main
git merge FETCH_HEAD
# resolve, then
git add -A && git commit --no-edit && git pushThe screenshot ask above still stands; this is a new dialog and tab, so Nate reviews the look. |
…and belt width (tangency-labs#20116) `pulley.insert` builds a pulley as its own component from ordinary features: the grooved outline (one circular arc per groove) extruded, a flange at each end and an optional axle hole, off the axis with `bore_offset`. Parameter names follow `gear.insert` (tangency-labs#13431) where they mean the same. The Insert Pulley dialog sits in INSERT > LIBRARY. Tests check the diameters against the pitch line (GT2 20T: 12.224 mm outside), the volume against the outline's area worked out by hand, one undo step, and hostile parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and belt width (tangency-labs#20116) `pulley.insert` builds a pulley as its own component from ordinary features: the grooved outline (one circular arc per groove) extruded, a flange at each end and an optional axle hole, off the axis with `bore_offset`. Parameter names follow `gear.insert` (tangency-labs#13431) where they mean the same. The Insert Pulley dialog sits in INSERT > LIBRARY. Tests check the diameters against the pitch line (GT2 20T: 12.224 mm outside), the volume against the outline's area worked out by hand, one undo step, and hostile parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… code computes no geometry the app-geometry check would refuse Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Update: I dropped root fillet and tip rounding from this PR, so |
|
Thanks for the push. Main moved again while it was waiting, and it conflicts in five files now:
git fetch https://github.com/tangency-labs/solidcraft.git main
git merge FETCH_HEAD
# resolve, then
git add -A && git commit --no-edit && git pushThen the full checks run, and Nate looks at the gear dialog. |
…g arms sit beside main's frame trim and gusset, sorted Co-authored-by: bourneash (Jesse T) <8842394+bourneash@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Done it for you: I merged main into your branch. The conflicts were all lists and dialog arms next to main's frame trim and gusset (module lines, help list, preview arm), now holding both, sorted. Nothing else changed and nothing is needed from you; the checks run again on the new head. Update: the kernel-cases check wanted EXEMPT lines for the new |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This conflicted with main, so I merged main into your branch (merge commit, nothing force-pushed) so CI can run. Please pull before your next push. |
dialogs.rs, dialogs_dense.rs: main's Shaft Spline dialog and this branch's Gear dialog sit side by side in Kind and its matches. Co-authored-by: bourneash <8842394+bourneash@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This conflicted with main again, so I merged main into your branch ( |
# Conflicts: # crates/doc/src/component_removal.rs # crates/ui-egui/src/dialogs.rs
component_removal.rs: main's removed_components (a kept root keeps its records) with this branch's gears line. dialogs.rs: this branch's Gear preview arm with main's CellGrid arm. Co-authored-by: bourneash <8842394+bourneash@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This conflicted with main again, so I merged main into your branch (
|
…inds and nothing outside builds on them, reports a failed delete, and a ring conversion drops an inherited double-helical flag Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Update: thanks, |
# Conflicts: # crates/engine/src/cmd/mod.rs
# Conflicts: # crates/engine/src/cmd/mod.rs # crates/engine/src/schema/mod.rs
|
This conflicted with main again, so I merged main into your branch ( |
|
@bourneash update: main moved again since my |










The Insert tab gets an Insert Gear command and an Edit Gear form that make involute spur or helical gears, external or internal, from their module, tooth count and pressure angle.
Fixes #6796, which the closed #7137 left open. This PR covers external and internal gears, profile shift, backlash, helical and double helical teeth, an axle hole (centred or offset) in external gears, a ring thickness for internal gears, tooth clearance, a backlash direction and the profile accuracy. Meshing gear trains stay in #12455.
Changes a default: No.
Validation
gear.insertandgear.edit, save and reopen, clone and extract, and hostile values leaving the design unchanged.cargo xtask fast --base upstream/mainpasses: layers, lists, mesh decisions, UI containers,app-geometryand the rest of the repository checks. A plaincargo xtask faston my machine also reports failures outside this PR: tests ontests/KNOWN_FAILING_TESTS, font tests (no fonts on this machine) and the SolidCore goldens, none of which this PR touches.Native Linux testsand the SolidCore test build never ran to a result: GitHub's free runners were shut down mid-job (exit 143) in two attempts, with no test failure in the logs. The full suite has not run against this branch; it needs the project's runners (approved-for-ci).cargo xtask app-geometrylists nothing from the gear files. (It lists seven sites in other files, which come from main, not from this branch.)Screenshots
Before: the Insert tab. Insert Gear is in the Library menu, next to Change Part Size.
The Insert Gear form (module 2, 20 teeth) with its live preview:
After OK, the gear is a component in the design:
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation