Repository navigation
feat: STEP import takes up for Y-up files and names for the bodies' names - #1312
Merged
bherbruck merged 1 commit intoOct 15, 2026
Merged
Conversation
…s' names `doc.open`, `file.insert_step` and the MCP `open` tool take two optional parameters for STEP and IGES files; without them a file comes in as before. - `up`: "z" (default, the file's axes are kept) or "y". "y" turns the file's bodies a quarter turn about X (Y becomes Z) with one Move feature after the Import, the one the window's "Stand it up" offer adds, in the same undo step as the import; the reply names it as `stand_up`. The window makes no offer after a call that said which way is up. - `names`: "solid" (default, as before), "product" or "instance": what the bodies are named after, the solid's own name, the part's, or the assembly occurrence's. A name the file leaves out or fills with a placeholder falls back to the next one. The names go into the Import's existing per-body names, so no new field is stored and the file format does not change. The default stays the solid's name because SolidCraft's own STEP export writes a body's name there. An imported body now knows the assembly occurrence it is (`ImportedBody::instance`), and the app's control channel passes `up` and `names` on to the command (it passed only the path). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
bherbruck
added a commit
to jijinbei/solidcraft
that referenced
this pull request
Oct 15, 2026
This was referenced Oct 15, 2026
This was referenced Oct 15, 2026
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.
Closes #1265.
Change
Missing. Two things about a STEP file from another CAD system could not be said to the commands that import it (
doc.open,file.insert_step, and the MCPopentool).solid.moveof 90 degrees about X itself.Cut-Extrude3), so the bodies of an assembly come in with names that say nothing about their parts, while the importer reads the product (the part) and the assembly occurrence (the instance) too.Now. Two optional parameters, for STEP and IGES files; a call without them gives the design it gave before.
up:"z"(default: the file's axes are kept) or"y": the file's bodies are turned a quarter turn about X (Y becomes Z) by one Move feature right after the Import, the Move the window's "Stand it up" offer adds. The import and the turn are one undo step, the reply names the Move asstand_up, only the file's bodies turn (not the ones already in the design), and the window does not offer to stand the part up after a call that said which way is up.names:"solid"(default, as before),"product"(the name of the part that holds the body) or"instance"(the name of the assembly occurrence, the product's for a body that is in none). A name the file leaves out or fills with a placeholder falls back to the next one. The names are stored in the Import's existing per-body names, so a saved design reopens with them, and repeated names are numbered as ever (Post,Post (2)).{"command": "file.insert_step", "params": {"path": "frame.step", "up": "y", "names": "instance"}}The default of
namesstays the solid's name: SolidCraft's own STEP export writes a body's name there, so another default would rename the bodies of every round trip. Other values are refused with a message, anddoc.openrefuses the options for a design file.How:
solidcraft-kernel: an imported body knows the assembly occurrence it is (ImportedBody::instance) next to its product path.solidcraft-io:StepNamesandstep_import_feature_named;step_import_featureis the same call with the default.solidcraft-engine:upandnamesonfile.insert_stepanddoc.open.solidcraft-ui-egui: the app's control channel passesupandnamesto the command (it passed onlypath), and skips the offer whenupis given.solidcraft-mcp: theopentool takesupandnames;docs/step-import.mdanddocs/mcp.mddescribe them.Validation
Six new tests, in the repo's style next to the code. The frame they use is what another system writes with Y up: a plate 40 × 4 × 20 and a post 4 × 30 × 4 placed twice on it, as products
Frame,PlateandPost, occurrencesPlate-1,Post-1,Post-2, solids namedCut-Extrude3andBoss-Extrude1. SolidCraft's own exporter writes it in the tests (step_export_products).solidcraft-kernel,step_in/tests.rs:bodies_know_their_product_and_instance(each body's product path and occurrence); the two import tests that read assemblies also check the new field.solidcraft-io:step_import_names_follow_the_choice(the stored per-body names for each choice, placeholders falling back, the default unchanged).solidcraft-engine,tests/step_import_options.rs:a_y_up_step_file_comes_in_standing_up(extent as written, and afterup: "y"; the Move feature; one undo step; only the file's bodies turn;"z"andnullas the default),opening_a_y_up_step_file_can_stand_it_up(doc.open; no history on a freshly opened design; a design file refuses the options),wrong_up_and_names_are_refused(other values and types, with the design left as it was),the_bodies_are_named_after_the_solid_the_product_or_the_instance.solidcraft-mcp:open_stands_a_y_up_step_file_up(theopentool; its schema refuses other values).solidcraft-ui-egui:a_control_import_passes_up_and_names_on(an import bridged through the window:upandnamesreach the command, the reply is the session's, and the stand-up offer is made only when the call did not say which way is up).The engine, mcp and ui tests fail on
main(upandnamesare ignored there); the kernel and io tests need the newImportedBody::instanceandStepNames.The same frame through
solidcraft-cli(file.insert_step, theneval), built frommainand from this change:main(upandnamesignored){path}Cut-Extrude3,Boss-Extrude1,Boss-Extrude1 (2); x 0..40, y 0..34, z 0..20up: "y"names: "product"Cut-Extrude3,Boss-Extrude1,Boss-Extrude1 (2)Plate,Post,Post (2)names: "instance"Cut-Extrude3,Boss-Extrude1,Boss-Extrude1 (2)Plate-1,Post-1,Post-2up: "y",names: "instance"Cut-Extrude3, ...; lies on its backPlate-1,Post-1,Post-2; standing up, z 0..34up: "x"upmust be "z" or "y"The whole
cargo xtask ciran once on Windows for this commit (f7914b0f, on1cc65cbc) merged with two other independent changes of mine, posted beside it as their own pull requests, onmained22d663(combined commitcdbc2773). It passes fmt, assets, licences, layers, clippy-D warnings, the wasm32 check, the doc tests, the render tests and the action matrix. What failed is not these changes':mainfails on this machine (41f0c3d0, the same night): the robustness goldensall_0toall_3andissue_851_tests::arc_top_edge_sizes_never_panicin the kernel, andcrash::tests::startup_steps_survive_a_rebase_and_running_ends_startup(Native crash capture on Windows, and startup steps in crash reports #1215), which reads the journal through a second handle while the journal holds its exclusive lock; Windows refuses that, ascrash.rssays atread_live_journal; andrender_workspace::tests::control_render_export_respects_upstream_file_scope(render: persist and consume opaque PBR in product preview and PNG #1046): this machine's temporary folder has a short (8.3) name, which the file scope refuses before it gets to the check the test expects.viewport::tests::cpu_viewport_redraws_in_the_new_themefailed beside the other test binaries and passes alone. This commit changes only the STEP reader (crates/kernel/src/step_in/),crates/io/src/lib.rs, the engine'sfile.rsand its newtests/step_import_options.rs, the MCP's tools and tests, the window'sfile_load.rsand its tests, and the docs.On the same change:
cargo fmt --all --checkandcargo clippy -p solidcraft-kernel -p solidcraft-io -p solidcraft-engine -p solidcraft-mcp -p solidcraft-ui-egui --all-targets --profile ci --locked -- -D warningsclean; the lib tests of the five crates pass except for tests that depend on this machine (a 30 s wall-clock limit, the golden robustness runs, a thread fillet, an 8.3 temp path, and a GPU test process that crashed once under load and passes alone).Screenshots of the behavior (when observable)
The frame as a Y-up file comes in, on
mainand with this change withoutup(first), and withup: "y"(second):The names are in the table above; the window has no dialog for the options, so there is no picture of one.
Integration status
Based on
origin/main1cc65cbc, one commit, not stacked. Searched upstream issues and pull requests, open and closed (stand up,Y-up,up_axis,STEP product name,insert_step,import names): #3 (closed: the window's preference and offer) and nothing on a command option or on names. No new stored field (the Move and the per-body names are what a design holds already), so the format does not change. It merges cleanly withmainat8535d229(#1300).🤖 Generated with Claude Code