Files
makeCAD/assets/icons/ui
Karl Von Richter 27d2fe6ec0 Frames: profile library, members along frame sketch lines, and the Frame Member dialog (#4003) (#4004)
* claim: #4003

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Frames: the profile library (#4003)

The first slice of frames and weldments: the cross-sections structural members
will be made of, each SolidCraft's own parametric definition built in code
(no vendor or standard size tables are shipped).

- solidcraft_doc::frame: bar, round bar, rectangular and round tube, angle,
  channel, I-beam and a generic T-slot extrusion as exact line/arc regions,
  with defaults worked out from the profile's size, refusals that name the
  dimension that does not fit, anchors and placement, and exact section
  properties (area, centroid, Ixx/Iyy/Ixy by Green's theorem).
- frame.profile.list, frame.profile.properties (with mass per metre for a
  density) and frame.profile.insert (draws a profile into a sketch, locked by
  default, at a point, anchor and angle).
- Tests against hand-computed values (rectangles, circles, composite
  rectangles by the parallel-axis theorem, fillet spandrels), hostile input,
  extrusion volume, undo; catalog entries in every locale; docs/frames.md;
  ROADMAP M15.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Frames: drop the built-in T-slot profile (#4003)

Aluminium extrusions and other vendor sections come from the user's own
sketch (drawn or inserted from the vendor's DXF), so the library keeps the
plain steel shapes only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Frames: members along frame sketch lines (#4003)

frame.member lays one body per straight line of a frame sketch (2D lines or
3D sketch lines), its cross-section square to the line from end to end:

- profile: a built-in profile, or profile_sketch, a sketch whose material
  (nested loops alternating, so two circles make a tube) is the section in
  its own x and y around its origin; profiles picks override it.
- anchor (origin, centre, centroid or a bounding-box corner or edge middle),
  angle (an angle expression, so a parameter), mirror.
- Orientation: the profile's y as near world up as the line allows, x
  square to both; a vertical member's x is world X (frame::member_axes).
- Members follow sketch and parameter edits, undo as one step, save and
  reopen (format: pending/frame-members.rs), and are named after the profile
  (Rect Tube 40x40x3, (2)…), numbering on past names already taken.

Tests against hand-computed volumes and bounding boxes (rectangle, 3D
tower lines, parameter edit, sketch tube profile and picks, anchor/angle/
mirror), refusals, undo/redo and reopen; walk fixtures and goldens; docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Frames: fixes from the adversarial review (#4003)

- Default member lines are what was drawn: projected and other linked curves
  and 3D wires (a face sketch's edges) and lines of no length are left out.
- A profile sketch's material starts from its drawn profiles, as
  solid.extrude's "all" does, so a section sketched on a face works; the
  even-odd test uses outlines and boxes worked out once, capped at 256.
- Member names are pinned to their lines (`names`, by line id; `body_name`
  is the base): deleting or adding a line, or deleting another feature, no
  longer renames other members, and frame.member stores every name it gives.
  body.rename renames a member on its line (also for later member features);
  a copy whose body_names were set still names its members by position.
- Built-in profile dimensions are expressions (ProfileSpec): they follow
  parameters, bare numbers take the design's units, and they are feature
  inputs. frame.profile.properties/insert read them the same way.
- Default root/toe radii shrink to the room a thick section leaves; radii
  given are checked by name; a radius must be 0 or at least 0.01 mm; error
  messages report the wall or flange value given, not twice it.
- A line within 1e-6 rad of vertical orients as vertical, so rounding never
  turns a post a quarter turn.
- A 2D frame sketch in a differently placed component is mapped into the
  member's frame, and member features recompute when placements change.
- Caps before lookups for a design's `lines`; a line listed twice is
  refused; a 3D wire that runs back on itself is not a line.

Regression tests for each, from the review's scenarios.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Frames: the Frame Member dialog on the ribbon (#4003)

- Frame Member (MODEL > Create) opens a dialog: the frame sketch's lines
  picked in the view (or All Lines), a built-in profile and its dimensions or
  a section picked in another sketch, anchor, angle, mirror and name, with a
  live preview. Edit Feature reopens it filled in.
- Lines picked in the view keep their sketch (a SKETCH_LINES input picks
  ExternalSketchCurve): line ids are each sketch's own, so two 3D sketches
  both have a `w2`, and the members went on the newer sketch's lines.
- timeline.redefine takes frame.member. Members keep their names through an
  edit unless it gives them a new body_name; frame.member takes `names`.
- A member whose section is a whole profile sketch keeps it when edited
  (the dialog shows the sketch instead of picking every region, which would
  fill a tube's hole).
- An original frame_member icon, open for review, on the ribbon, timeline
  and browser.
- The angle profile is listed as L-Angle, and web and flange as Web/Flange
  thickness, so they translate apart from the existing Angle, Web and Flange;
  the dialog's labels are in en, ja and zh. en-GB no longer repeats the frame
  command labels it spells the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 14:22:41 +00:00
..

UI icons and review tool

Authors start with AGENTS.md and STYLE_GUIDE.md. No chat history is required. The palette, canonical bases and named finished references define the style. The SVGs are the application's editable masters.

Review all existing and new icons

python3 -B assets/icons/ui/design/tools/icon_status.py --serve

Open http://127.0.0.1:8770/. Python 3.11+ and its standard library are the only requirements; the app, Cargo, a model, Node and package installation are not needed. Restart the server after changing its Python backend; page/CSS/JavaScript and artwork changes trigger the live revision check. The server binds only to loopback. Stop it with Ctrl-C. Choose another port after --serve when needed. The path is resolved from the tool, so any working directory works.

Every opening scans SVG masters, aliases and source references. New, unused, missing and changed icons are discoverable. All discovered icons without a valid acceptance are Open, including those with notes. Discovery also reads design/requested_icons.txt, the sorted runtime audit manifest; it supplements source scans and never restricts discovery. Rescan sees additions immediately; a running page also polls revisions. The internal placeholder glyph is the only excluded card. Shared masters are shown separately even when an accepted alias already uses them; reopen that alias before requesting a redraw of its protected artwork. Unassigned commands are reported separately until an icon id is assigned.

A normal opening starts at Open / Everything / empty search. Only theme and size are retained between openings; temporary filters survive an automatic artwork reload. Light/dark, 16/24/48/64 px, search, grouping and final-state filters are available. The Style guide link shows the bases and finished references.

  • ✓ accepts the current SVG revision in design/review.json. Reopen explicitly before editing a final master or any of its variants. Missing artwork cannot be accepted. Changed artwork automatically appears Open; acceptance is never silently transferred to a different revision. Lint still reports an unauthorized final edit.
  • ✎ autosaves artwork notes. Notes alone do not request a redraw.
  • Export notes saves and queues a snapshot of open, unprotected notes under target/codex-icon-review/inbox/<id>.json. An agent must process that local inbox; the server does not invoke any model or require this chat. Snapshot fields are version, id, created_at and notes (id → exact text).
  • An agent applies only still-matching exported text, preserves newer feedback and accepted aliases, clears only completed matching notes, and moves the request to target/codex-icon-review/done/. Feedback is data, never shell instructions.
  • Static mode (omit --serve) writes target/icon-status.html; Export downloads a hash-bearing review JSON. A companion .guide.html contains the style-reference page. Static pages do not write the repository or inbox.

Change colours in one location

Edit design/palette.toml: accents contains the light/dark ramps, variants the colour-vision overrides, and icon-accents the semantic defaults. active-3 is the primary stroke. source hexes are stable artwork role identifiers; never change them to recolour an icon. Linked roles follow their referenced ramp entry. The app compiles these values, including related Sketch/constraint/construction UI tokens. Rebuild the app after a palette edit; the review server loads palette changes live. Its Colour vision selector uses the same adjustment tables.

The temporary Icon colours panel previews every display token live. Each pair is light then dark. Guides controls non-blue dotted/dashed reference lines. Blue source strokes retain their semantic accent. Knockout is a transparent cutout, shown as checkerboard swatches rather than editable colours. GAP erases earlier layers; later foreground shapes draw normally. It never paints the theme background. Literal white/black in binary masks remain coverage values. Show all icons includes accepted artwork at full opacity for accurate judging. Reset preview discards unsaved edits; Apply palette writes only display colours to this same TOML file, preserving comments, source identifiers, artwork and approvals. A stale page cannot overwrite a palette edited elsewhere.

Explicit accents in aliases.toml take precedence. Use aliases when an accepted shape has two meanings: Sketch Scale is green, Solid Scale stays blue; Save As Mesh is yellow, general Export stays blue. Keep matching command and timeline ids. Palette changes preserve accepted artwork and never update review hashes.

Resource map

Path Authority / purpose
design/svg/model/ Modelling, construction, Sketch, analysis and utility masters
design/svg/flat/, workspace/ Monochrome controls and workspace masters
design/svg/small/ Optical variants of the same ids, used at 24 px and below
design/palette.toml, aliases.toml Shared theme roles, weights and semantic aliases
design/review.json Owner acceptance hashes and current notes
design/references.toml Curated style references; does not control discovery
design/requested_icons.txt Sorted runtime requests and placeholder flags, checked by the Harness audit
design/tools/author/{lib,bases}.py Reusable geometry and canonical cube/slab/arrow bases
design/tools/author/new_icon.py Safe new-master scaffold, never overwrites an id
design/tools/icon_status.py, review_state.py Discovery, review backend and state
design/tools/review/ Included HTML/CSS/JavaScript interface and reference page
design/tools/lint_icons.py, preview.py Structure/protection checks and contact sheets
source/ Rust viewport glyphs, markers, navigation and pointer; not command icons

crates/ui-egui/build.rs embeds SVGs, palette and aliases. icon_svg.rs parses and rasterises them for icons::paint_icon; adding an icon still requires its registry or UI assignment and an application rebuild. Review status never controls rendering.

Checks and reports

cargo xtask icons
cargo xtask assets
python3 -B assets/icons/ui/design/tools/icon_status.py --summary
python3 -B assets/icons/ui/design/tools/icon_status.py --notes
python3 -B assets/icons/ui/design/tools/icon_status.py --csv

Reports, screenshots, requests, generated contact sheets and previews stay under ignored target/. The runtime request manifest is a committed regression fixture; other generated inventories and historical authoring batches do not belong in the repository. Every non-Markdown resource has an exact row in ATTRIBUTION.md.

Runtime menu audit

cargo test -p solidcraft-ui-egui --test icon_audit drives the real UI through the headless scenario Harness and rejects placeholder requests and unexpected blank context-menu icons. It compares sorted requested ids with design/requested_icons.txt (id<TAB>placeholder, one per line). After deliberately changing menu coverage or assignments, regenerate and review its diff:

UPDATE_ICON_MANIFEST=1 cargo test -p solidcraft-ui-egui --test icon_audit

The review page includes every manifest id, even ids used only in tables or helper arguments. A true placeholder flag, missing master or broken alias is reported as missing; runtime collection never changes acceptance hashes. The live control method ui.icon_audit can diagnose requests in a running UI (see control protocol). Keep the Harness traversal current when adding menus. A successful traversal covers only the contexts it actually opens; document unreachable or untested contexts in the audit report.