* Components: copy and paste bodies and components between designs and components (#3390) Squashed for the rebase onto main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * claim: #3511 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Paste New: copy from a design other than the one pasted into `component_clone::paste` read the design it copies from through the session it pastes into. `build` now takes the source (document, evaluated model, unapplied moves) apart from the target session; Paste New within one design passes the session as both, as before. Names are numbered against the target's names. From another design (`Source::copied`, a `ForeignCopy` snapshot taken at copy time): - names are kept where the target doesn't have them, else numbered; - the user parameters the copy uses come along, `w_2` where the target has a `w`, with the copied expressions following; - a copy whose features use what isn't in it (bodies, sketches, faces, parameters outside it) is refused with a list of what; `FeatureKind::input_bodies` lists the bodies a feature uses; - configurations stay with their design, and the target's timeline marker must be at the end; - a body moved in from outside comes as an imported base named `BodyImport1`. Body transfers are pointed at the copy's components before they are added: `add_feature` checks that the components they name exist, which another design's don't. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Engine: paste bodies and components copied in another design `component.paste_from_design` pastes what `Session::foreign_copy` holds, at the same world coordinates as in its design, into the active component or `component` (placed by `component_path`; a component placed more than once gets it in every instance), as one step to undo: - bodies as imported bodies, without their history, in one Import feature (named as any import is, "Import1"); a body seen in another placement ("Cube (B:2)") pastes as "Cube"; names the target has are numbered; - components as independent copies (Paste New from the snapshot): with their history, appearances, materials, joints and motion inside them; joints to the outside stay behind. Tests: bodies (position, naming, target component, undo; a body of another placement) and components (history, appearances, a part placed twice, editing independently, save and reopen, undo; user parameters renamed; refused when using a body outside it; bodies moved in). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Clipboard: copy in one design, paste in another Copying or cutting bodies or components also keeps a snapshot of them (`ForeignCopy`); another tab pastes it with `component.paste_from_design`: bodies as imported bodies, components as independent copies (Paste and Paste New alike), folded and selected. Cut pastes as a copy there, the original staying; Esc on the cut leaves nothing to paste anywhere. The last copy in any design is what pastes: each copy or cut is numbered, and a tab whose own copy is older empties its clipboard when it is switched to (`drop_stale`). A failed copy anywhere leaves nothing to paste in any tab. Tests: bodies and components pasted in another tab, the last copy winning across tabs, cut as a copy. `copied_bodies_stay_with_their_design` gave way to the cross-design test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Clipboard: what is selected wins over a design row picked earlier Copy copied the whole design as a linked component whenever the design's browser row was still picked, even after a component, body or feature had been selected in the view or another tab, and failed in an unsaved design. The design row now gives way to anything selected, and switching tabs drops the picked components of the design left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Put the Paste from Another Design label in the pending locale file Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Tests: unground the placement before moving it (a design's first part is grounded) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop locale keys main already folded into en.json Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Pending locale: Paste from Another Design in the complete catalogs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
Application resources
assets/ is the design resource home for SolidCraft.
ATTRIBUTION.md is the file inventory and provenance record.
Keep one editable master per resource and place shipped derivatives in exports/.
assets/
icons/
app/
shared/source/ # original Rust mark and executable ICO encoder
macos/source/SolidCraft.icon/ # approved Composer project and linked SVGs
macos/exports/ # paired Assets.car and icon.icns
windows/exports/ # executable DIB ICO and installer PNG ICO
linux/exports/hicolor/ # Linux/FreeBSD package images, 16–512 px
ui/design/svg/ # authoritative original UI icon masters
ui/design/tools/ # authoring bases, checks and included review app
ui/source/ # Rust viewport glyphs, markers and navigation
branding/web/source/og.png # shared social preview card
styles/ui/palettes.rs # light/dark defaults
styles/web/loading.css # web loading/canvas styles
appearances/library.rs # built-in visual presets
materials/library.rs # physical defaults and colours
shaders/viewport.wgsl # original viewport shader
fonts/{liberation-sans,biz-udp-gothic}/ # unmodified fonts and OFL licences
locales/{en,de,ja,ko}.json # shared offline catalogs
platforms/{macos,linux,windows}/ # bundle, freedesktop and WiX templates
platforms/macos/dmg/ # disk image window: layout, dmgbuild settings, background art
archive/icons/macos-v1/
source/icon.vectorcraft # earlier editable work, retained
# redundant historical exports are retired
Editing and regeneration
UI artwork identifies the drawing masters and their consumers. Read the mandatory UI style guide before editing an icon. Edit SVG geometry and its command/UI assignments together; inspect both themes and small sizes. Temporary media and generated reports belong in ignored target/. Palettes and model presets are also editable Rust data.
The current macOS master is icons/app/macos/source/SolidCraft.icon/, including
its linked SVG layers and appearance settings. The earlier VectorCraft document
is preserved in the archive. No other native design projects were available for
the current UI set or preview card. Keep any future .vectorcraft, .ai or other
native work and linked inputs under that resource's source/work/, with an
attribution row; retain the editable document alongside its exports.
Regenerate all exports of the shared Windows/Linux/FreeBSD mark together:
cargo xtask app-icons
For macOS, use Xcode with Icon Composer support:
mkdir -p target/resources/macos-icon
xcrun actool assets/icons/app/macos/source/SolidCraft.icon \
--compile target/resources/macos-icon --platform macosx \
--minimum-deployment-target 11.0 --app-icon SolidCraft \
--output-partial-info-plist target/resources/macos-icon/icon-info.plist \
--output-format human-readable-text
cp target/resources/macos-icon/Assets.car assets/icons/app/macos/exports/Assets.car
cp target/resources/macos-icon/SolidCraft.icns assets/icons/app/macos/exports/icon.icns
Review and commit source changes and required exports together. Temporary renders,
tool caches and package staging belong under ignored target/ or dist/.
Normal builds use the committed exports and require no design applications.
The CLI still supports arbitrary PNG/ICO exports with solidcraft-cli icon.
Platform bindings
| Platform | Resources and output paths |
|---|---|
| macOS | Composer master and paired exports; bundle installs Assets.car and SolidCraft.icns |
| Windows executable | solidcraft-executable.ico: original DIB/mask representations at 16/24/32/48/64/128/256 px |
| Windows installer | solidcraft.ico: PNG representations at 16/20/24/32/40/48/64/128/256 px; SOLIDCRAFT_ICONS override retained |
| Linux, Nix, deb/rpm, tar, Flatpak, Snap | Copy canonical hicolor images; icon name stays io.tangencylabs.solidcraft |
| AppImage | Uses the Linux 256 px image and .DirIcon alias |
| FreeBSD | Shares Linux hicolor images and freedesktop metadata |
| Web | HTML/Trunk and manifest.webmanifest stay in apps/solidcraft-web/; copies Japanese font/licence to fonts/, uses the collected CSS, and copies the Linux 32/256/512 px images to icons/ for the favicon and installed app |
| Docs and link previews | xtask book copies the shared card to the existing /solidcraft/og.png public path |
Code and provenance
Resources remain compiled by their owning layer through existing APIs:
ui-egui::icons::paint_icon and Tokens at L5, model presets in L2 doc, and sketch
fonts at L1. State, projection, interaction, commands and GPU bindings stay in
their current modules. Embedded data uses CARGO_MANIFEST_DIR; application code
needs no runtime resource registry or repository lookup.
cargo xtask assets requires an exact attribution row for every collected file
except Markdown documentation, and continues checking file assets elsewhere in
the repository. This includes native work, Rust masters, catalogs, shaders and
platform templates. Packaging selects explicit current files and fails when
required inputs are absent. Archived artwork has no production consumers.
Dependency-owned egui fonts and vendored renderer shaders stay with their
libraries; their licences remain in THIRD-PARTY-LICENSES.txt and ATTRIBUTION.md.
System fonts, optional packs, user fonts/canvases/decals/materials and native OS
controls retain external ownership. Root licence/notice texts stay canonical.