fd4b7a7bc0e5d2de4eadf682eb2aee9510a5fc66
84
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d01de87552 |
Merge main into drawings (Oct 30)
Brings the 1,270 commits on main since the drawings branch last met it,
including the first drawings landing (#8249), into drawings.
Merged with the drawings snapshot that #8249 landed (
|
||
|
|
a09c24e9bf |
Drawing dimensions: a circle's or an arc's radius and diameter (#4896, W20a) (#8959)
* Drawings saved inside the design's file, in both forms (#3890) K3b of the drawing storage plan, after #7098: a drawing lives in the file of the design it draws (bherbruck's proposal, Cameron's choice), so the separate drawing file goes. - `Document.drawings`: the design's drawings, each its own record of the drawing family (`solidcraft-drawing/N`), each behind its own `Arc`. Every reader and writer of a design now carries them: save, Save As, autosave and recovery, crash copies, the CLI. - A design container keeps each drawing in its own entry, `drawings/<id>.json` (Deflate), beside `document.json`, which holds nothing of them: its bytes, and the model cache keyed to them, are the same with drawings or without. A plain JSON design keeps them inline under `drawings`. - Each drawing is read by its own family's rules, taken out of the design's JSON before the design's own checks. One a build can't read (a newer number, a change it doesn't know, damage) refuses the whole design, never dropped. So does an entry under `drawings/` that isn't a drawing's, one whose record has another id, drawings inline in a container's `document.json`, two drawings with one id, or more than 1,000 (counted before any is read). A design is never saved with two drawings of one id. - Drawings are listed by name, then id: no stored order, nothing to merge when two people add drawings. - A drawing has an `id`, unique among its design's drawings (`Drawing::new` takes the ids already taken). Its source is the design it is in: at most one, an id and no path. - One pending design change, `drawings`: the last release refuses a design saved with it, so it never opens one and saves it without its drawings. One pending drawing change, `in-design`, for the record's new shape. - Gone: `read_drawing`, `read_drawing_file`, `write_drawing_container`, `file_kind`, `FileKind`, `DRAWING_EXT` and `is_drawing_path`. `read_document`, `read_design` and the container writer are as they were before #7098, with the drawings added. Tests: a design's drawings round-trip through both forms byte for byte, with `document.json` and `container.json` the same with drawings or without; their order; every refusal above; a drawing's properties kept as other tools wrote them while a sheet's number out of range is refused; the drawing's id among its objects', a new drawing's id none of the design's; a design with two drawings of one id not saved; mutation fuzz of a design with drawings in both forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing commands on the design's own drawings, each drawing its own undo (#3890) K4' of the drawing storage plan, on K3b (a drawing lives in its design's file): make, list, open, close and delete a design's drawings, and read and change the open one's settings and properties. It replaces #3891's drawing sessions, which held a drawing as a file of its own. - `drawing.create {name?, language?, units?}` adds a drawing of the design (one ISO A3 landscape sheet with the ISO border, the design its one source) and opens it; refused on an empty design. `drawing.list`, `drawing.open {drawing}`, `drawing.close`, `drawing.delete {drawing}`. `drawing.inspect`, `drawing.set`, `drawing.properties`, `.properties.set`, `.properties.remove` work on the open drawing. Labels in en, ja and zh. - The open drawing is the session's (`Session::open_drawing`, kept in checkpoints), and the part gate keeps the parts apart: a command says the part it works on, the model unless it says otherwise (`.in_drawing()`, `.any_part()`). While a drawing is open the model's commands wait ("a drawing is open: close it to change the model"); the drawing's run only while one is. Files, recovery, undo and redo, checkpoints, selection, diagnostics, the command list and choosing a drawing work either way. `CommandSpec::allowed` is the one check running a command, running it inside another and listing it make. - `Session::drawing` and `Session::edit_drawing` are the open drawing's one way in: an edit is kept when it changed something and still keeps the record's rules, in a new design whose other drawings are shared. - A change that only touches drawings evaluates nothing: `Document::differs_only_in_drawings` joins the render-only path, as render settings and part properties do. A model edit shares every drawing, so it pays nothing for the check. - Undo per part: a step records the part it changed (`Snapshot::part`: a drawing, or the model and its list of drawings). Undo and redo go through the open part's steps only. A drawing's step puts back only that drawing; the model's step puts back the design as it was, keeping each drawing it had as it is now. Making and deleting a drawing are the model's steps. A new step ends what could be redone in its own part only. `Snapshot::of` is the one place a step is taken. - An agent's message that changed several parts keeps their steps apart, rather than merging them into one step that would undo only one part. - `cmd::metadata`'s rules for reading, setting and removing properties are written once (`reading`, `setting`, `removing`) and used by the design's and the drawing's commands. - `drawing::sort` is the one place the drawings' order (by name, then id) is kept; `Document::put_drawing` adds or replaces one in that order. Tests: making, listing, opening, closing and deleting; what making one refuses, at the cap too; the gate both ways, inside another command and in the command list; drawing edits as undo steps that evaluate nothing over 100 rounds; undo and redo per part with model and drawing steps interleaved; redo ended per part; the order by name, then id, after renames; delete and its undo; refused changes; checkpoints; save and open in both forms; properties; hostile values for every command that runs with a drawing open, from the registry; a fuzz of the steps in any order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Unknown-command tests: the closest id first (#3890) drawing.open now joins doc.open in the suggestion for `file.open`, as the rule says: both end in the same word. The engine's and the CLI's tests check that doc.open comes first and let other close ids follow, as the `solid.extrud` line beside them already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Model bodies: their extents seen on a plane, for a drawing view's size (#5866) ModelBody::mesh_bounds_in(plane) is the box of a body's mesh in a plane's own coordinates (Plane::to_local), beside mesh_bounds and in the same way: a body meshed already is measured from its own mesh, and a placement of a part from its definition's shared mesh, with the placement folded into the plane's two axes once (two dot products a point), so no moved copy is made. W07's drawing.view measures a view's extents with it. Tests: a 100 x 50 x 20 block seen on the three principal pairs of axes and from an isometric corner (150/sqrt(2) by 190/sqrt(6), worked by hand), a plane away from the origin, and every placement in the shared-mesh test against its moved mesh, still without a moved copy, and the same again from its own mesh once it is meshed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views: projected views in first or third angle, lined up with their parent (#4816, W17a) W17a's second slice: the principal views derived from a base view. - `ProjectedSide` (left, right, above, below): the side of its parent a projected view sits on. - `projected_basis(parent, side, projection)`: in third angle a view shows the side of the model it sits on (one to the right looks from the right), in first angle the side away from it (ISO 5456-2). It's the parent's basis turned a quarter turn about one of its paper axes, through its origin, with no -0. From the front view it gives exactly the named views: right, left, top and bottom in third angle; left, right, bottom and top in first. - `ViewFrame::aligned(side, projection, centre, position_mm)`: a projected view at its parent's scale, lined up with it, so it moves only along the free axis. - The projection is S2's `cell::Projection`, the value the title block's symbol reads, so a drawing has one first-or-third setting. Tests: the front view's projections are the named views in both angles, with no -0; from every named view and a leaning one, a projected view looks from its side and keeps the parent's other axis and origin, four turns or a turn and its opposite bring the parent back; a box's corners line up across aligned views in both angles; hostile parents, centres and positions refused. Corner (isometric) projected views wait for one convention check on first angle. The derivation graph (projected from, aligned to, cycles refused) moves to the view record in the drawing file, where the view ids live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing dimensions: measurement on view frames (#4896, W19a) `geom::drawing_measure` is what a dimension on a view reads, in model mm or radians, from model points and edges and the view's basis: one rule for every dimension. The view's scale and place on the sheet never enter. - `linear`: horizontal and vertical along the view's paper x and y, aligned as the view shows the segment, or along a direction picked on the view; a true reading is the segment's own length (aligned only). - `angle`: from the view's horizontal or vertical, a model axis as the view shows it, or another edge, from 0 to π as each line is oriented; a true reading is between model lines. - `foreshortened` says a measured line isn't parallel to the view's plane. - Refused with a reason: points that aren't finite or are past 1e12 mm, an invalid basis, a zero-length segment, a line seen end-on, a zero direction, a zero reading, parallel lines, and a true reading where there is none. `drawing_view`'s `PARALLEL` and `require` are shared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * drawing.view.snapshot: a view's scale, place and boundary on its sheet (#5866, W07 V2) The first slice of W07: one orthographic view of the design, worked out and returned as data, before any line is drawn, so scripts can lay views out by their boundaries. - `drawing.view.snapshot` takes the view's settings, the sheet it goes on (A3 landscape at 300 dpi when not given) and where its centre goes (the sheet's centre when not given). With no scale it takes the largest ISO 5455 scale at which the view, centred there, lies inside the sheet's drawing border. It returns the resolved view, the scale (and whether it was fitted), the extents on the view's plane, the boundary on the sheet and what it was drawn from. Read-only and not undoable; it opens nothing and saves nothing. - Every body the design places is in the view, wherever its occurrences place it; the browser's eye counts for nothing (`engine::drawing_view::extents`, from P2's `mesh_bounds_in`). A design whose assembly walk stops at its limits (deeper than 64 levels, or past 100,000 placements) is refused rather than drawn with parts left out: `Document::placements_complete`, beside the walk, says whether every placement it holds had its occurrences walked. - `doc::drawing_view::ViewSettings` is the view's one parameter set: the view (named, or a direction and an up), the scale, the two visual styles, the reference settings and tangent edges. A saved view (W12) keeps the same fields; no scale is written as none, not null, so what it writes reads back as the snapshot's parameters. - `render::VisualStyle` names the five styles: visible, visible_hidden, shaded, shaded_visible and shaded_visible_hidden. The shaded ones are refused as not supported yet until the drawing renderer (#5624). - The command has a typed contract (input and output schemas). Its handler reads the contract's own type through `schema::read`, in the contract check's own words, so the check's levels give one message for one mistake and an unknown field is refused by name. The reply includes the sheet, its defaults filled in. Tests: the 100 x 50 x 20 block's boundary in the front, top, right and isometric views at 1:2, worked by hand; the fitted scale on A3 and A4 and near the border; scale, position and margin; the browser's eye ignored; the design untouched; each hostile setting refused; the walk's depth limit one level either side; the contract's keys the same as the settings' own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views in the drawing record: base and projected views, and the projection (#4816) E4 of the view-boundary plan, with #4816's derivation graph (plan on #4816). A drawing now saves its views, as one pending drawing-format change (`drawing/format/pending/sheet-views.rs`): - `Drawing.views`: each view an object of the drawing, on one of its sheets. A base view draws a source from a direction (`ViewDirection`, as `drawing.view.snapshot` takes it); a projected view sits on one side of its parent. Its place is a point of the sheet, or, lined up with its parent, only how far along the free axis, as the other comes from the parent. A projected view's source and basis come from its chain, so neither is saved. - `ViewOverrides` beside V2's settings: what a view sets itself, each setting on its own (scale, display style, reference style, reference parts hide the model, tangent edges); none is written when left out. Each view has its own reference margin. - `Drawing.projection`: first or third angle (S2's `cell::Projection`). Third angle is the type's own default (Cameron, 2026-10-26), for a drawing that doesn't say and for a new one until a template or a preference chooses. - The rules, checked on reading and after every edit: a view is on one of the drawing's sheets; a base view draws one of its sources, has a scale and a direction that makes a view; every parent is a view, no chain of parents loops, and a chain is at most 32 views; a lined-up view is on its parent's sheet; a place is on paper; at most 4,096 views. A view's id is the drawing's, never another object's. - `Drawing::resolve_view`: one rule for every reader. It turns the base view's basis down the chain (`projected_basis`, in the drawing's projection) and takes each setting from the nearest view that sets it, then the default, saying who gave it. - geom's `is_paper_coordinate`: the one rule for a view's place on paper, now used by `ViewFrame::new` and the record. The record tests' seed drawing has views, so its round trip and mutation tests cover them; their unknown-field examples no longer use `views`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Engine tests: one temporary folder helper and the schema check for every test module (#4816) The view tests use the drawing tests' temporary folder and the schema tests' `conforms`, which were private to their modules. `Folder` moves to the engine's test module and `conforms` is open to the crate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views: inspect and edit a saved view (#4816, W17c) E5 of the view-boundary plan (plan on #4816): what the view's window reads and writes, for the views of a drawing (E4). Both are drawing commands with input and output schemas, and neither evaluates a model. - `drawing.view.inspect {view}`: its kind (base or projected), sheet, source, parent and side, its direction as resolved (named only when it is exactly a named view), its place, and each setting as {value, from, parent?, set}: where the value comes from (the view, a parent by id, the default) and what the view saves itself. A projected view says whether its display settings follow its parent (`linked`: true, false or "partly"). `choices` gives the display styles and the preset scales, so a window keeps no list of its own. - `drawing.view.edit {view, set}`: one undo step. Each setting takes a value, or null to follow the parent (a base view keeps a scale); the margin, a base view's direction and the place change too. `linked: false` saves the display settings at the values they have, `linked: true` clears them so they follow. The reply names the fields changed and the views projected from it whose settings changed with it. The record's rules hold after every edit; an edit that changes nothing is no step. The contract test keeps the edit's fields and the record's (ViewOverrides) one list. The view's boundary comes with the next slice, which works out where each saved view sits on its sheet from its design's extents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views: where a saved view sits on its sheet (#4816) `Drawing::view_centre` gives a view's centre on its sheet: its point, or, lined up with its parent, its own place along the free axis and the parent's centre across it. The free axis is one rule on `ProjectedSide` (`along`, `on_free_axis`), which `ViewFrame::aligned` uses too. `engine::drawing_view::on_sheet` puts a saved view on its sheet: its design's extents on its plane, grown by its reference margin, at its scale, round its centre. The snapshot and saved views share `measure` (refusing an assembly past the walk's limit or one with no bodies) and `boundary`. With nothing to measure (the design has no bodies or places more than a view walks) a view gets a 20 x 20 mm placeholder round its centre. A view's source is the design the drawing is in, so the session's own model is what it measures. `drawing.view.inspect` adds `boundary_mm` and `extents` (status `placeholder` and why, when there is nothing to measure). It still evaluates no model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Projection of new drawings: a preference, and drawing.set takes the projection (#4816) A drawing's views follow its projection, first or third angle (third when nothing chooses). `drawing.inspect` now shows it and `drawing.set {projection}` changes it as one undo step. Preferences > Design gets a Drawings section with "Projection of new drawings" (First angle / Third angle). A new drawing takes it as a new design takes "Units of new designs": the app sets it after `drawing.create`, with no undo step of its own. A saved value this version doesn't know reads as third angle; asked for over the control channel, it is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing sheets: one edit, one lookup, a border that lays out, and schemas (#3875) The sheet commands change the drawing through `Session::edit_drawing`, so the same settings or order again leave no undo step, and answer from one reply type. A sheet is looked up by id or name on `Drawing` (`sheet_index`), where later commands that name sheets find it too. A sheet's border must lay out on it: the record's check runs the border's own layout, the one rule drawing uses, so a 15 x 15 mm sheet with the ISO border is refused when it is made, not when it is drawn. `excluded` must be an object of `count` and `print`: a mistyped key changed nothing unseen. A new sheet documents nothing and leaves nothing out unless told, and the add's parameter documentation says it takes `documents` and `excluded` too. The drawing's properties sit behind an `Arc`, as its sheets do, so an undo step shares them. Each sheet command has an input and an output schema (#4035). A flattened part of a contract reports its keys as the parent's own (`schema::flattened`, which `FeatureCommon` now uses). The tests add the missing cases: 1000 sheets and the 1001st, `after` by id and unknown, the resolution's bounds, a name two sheets share, the same order and settings again, an undone delete in place, and the add's reset of what it documents and leaves out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing ids: one id source per session, its seed kept for replays (#3890) The drawing commands drew ids from a fresh random source each time, so a crash replay of a drawing could never find what an earlier command made by its id. A session now has one id source (`Session::ids`), kept across a file change, from which `drawing.create` draws its drawing's, sheet's and source's ids: seeded alike and run alike, a session gives the same ids, and a failed command draws none, so a replay of what succeeded draws the same. The crash journal keeps the seed at each base and `replay.json` carries it, which `solidcraft-cli crashes replay` seeds the replay with (`Session::seed_ids`). Tests: two sessions seeded alike make a drawing with the same ids, another seed other ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing sheets: add, change, reorder and delete a drawing's sheets (#3875) W18 S4: the sheets of a drawing, on the drawing session K4 made (#3890). Each command is one undo step of the drawing and names a sheet by its id or, when only one has it, its name. - `drawing.sheet.add {after?, name?, size?, orientation?, dpi?}`: a new sheet after the one named (the last when not), taking that sheet's paper, border and resolution, with a name of its own ("Sheet 2") and nothing documented yet. - `drawing.sheet.set {sheet, name?, size?, orientation?, dpi?, documents?, excluded?}`: one setting at a time, the rest kept; `documents: null` clears what it documents, and `excluded` changes only the flags it gives. - `drawing.sheet.reorder {sheets}`: every sheet's id once, in the new order. - `drawing.sheet.delete {sheet}`: a drawing keeps at least one sheet. - Every change goes through the drawing's own rules (`Drawing::validate`), so what a saved file would refuse is refused here. Changing a sheet's paper changes only the paper: regrowing its border and moving what is on it is S5's. Labels in en, ja and zh. Tests: a new sheet copying the paper it follows, after a named sheet too, and undone; each setting changed with the others kept; nine refusals (resolution, sizes, orientation, name, an unknown source, a flag, an unknown sheet, no sheet named) with the drawing unchanged; reordering, and four orders that aren't every id once; a name two sheets share refused in favour of the id; the last sheet kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing sheets: a new sheet's id from the session's id source (#3875) `drawing.sheet.add` draws its id from `Session::ids` (#3890's one id source per session), so a crash replay of "add a sheet, then change it by id" finds the sheet: seeded alike and run alike, a session adds sheets with the same ids, and a failed add draws none. Tests: two sessions seeded alike add the same sheet ids, another seed others, a failed add none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views: move or copy a view to a sheet (#4816) `drawing.view.move_to_sheet {view, sheet, position_mm?, break_alignment?}` puts a saved view on another sheet as one undo step, keeping its id, direction, source and settings. The views lined up with it go with it and keep their places beside it; a view placed apart stays. Without a position it keeps its place. A view lined up with its parent moves only with `break_alignment`, and is then placed apart: at the position, else the sheet's centre. Its own sheet changes nothing. `drawing.view.copy_to_sheet {view, sheet, position_mm?, with_linked?}` makes new views, each following none of the views it was copied from (Cameron's rule). A view with views lined up with it needs `with_linked`: true copies them too, lined up with the copy; false copies it alone. A projected view copied alone becomes a base view, looking the way it did (by name when it is exactly a named view) with the settings it had as its own. The copy goes to the position, else the sheet's centre. A lined-up view's centre comes from the places alone: its place along the free axis, and its parent's centre across it. So the views that travel with a view are shifted along their free axis, and nothing needs the design's extents. `descendants` takes which views it follows, so the edit's followers and the views lined up with a view are one walk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views: move and copy take a view's centre from the record (#4816) Moving or copying a view to a sheet worked out a view's centre with its own copy of the lined-up rule. It now uses `Drawing::view_centre`, and a lined-up view's place moves along its free axis by `ProjectedSide::along`, so the rule is written once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing sheets: a change of paper lists the views it leaves outside, and moves none (#3875) W18 S5, its first part. `Sheet::drawing_space` is where a sheet's drawing goes: inside its drawing border, or the whole paper with none. Nothing on a sheet is saved against the border, so a change of paper regrows the border and its zones by itself. `engine::drawing_view::outside` lists the views whose boundary (`on_sheet`) leaves their sheet's drawing space, sides included. `drawing.sheet.set` lists them after a change of paper (size or orientation; nothing else moves the space, so nothing else is measured), and moving or copying a view to a sheet lists those it puts outside there. None is moved: where a view goes stays the author's choice. A view with nothing to measure is listed by its placeholder, with why. Tests: the drawing space with the ISO border, a filing margin and no border, and margins that leave none; A3 to A4 either way up listing the right and top views with their boundaries and moving nothing; a border through a view's edge leaving it inside, 0.1 mm less paper putting it outside; a change of name checking nothing; undo; a move to a smaller sheet listed and a copy that fits not; a placeholder listed as `past_walk_limit`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing ids and the sheet border: the tests the slices left out (#3890, #4816, #3875) What the slices' planted faults found untested, now each caught by a test: - a file change keeps the session's id source: a drawing made after `file.new` draws the same ids in two sessions seeded alike; - a copied view's ids come from the session's id source, seeded alike giving the same copies; - a crash report's replay carries the session's id seed, from a caught panic (the seed when the command started) and from the journal of an unclean exit (the seed at its base); - a view short of the sheet's border by less than a rounding is still inside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views: listed by id, whatever order they were added in (#4816) The record's rule says a drawing saves its later records by id, never in the order they were added in. Views were kept, and saved, in the order they were added, so the same views added in another order saved as other bytes. - `Drawing::add_views` adds views where their ids put them. It is the one way views are added: `drawing.view.copy` uses it, and so do the test fixtures. - `Drawing::validate` checks the order, so every edit keeps it. - Reading puts a file's views in id order before it checks the record. The order means nothing, so a file in another order (saved before views went by id, or edited by hand) isn't damaged: it opens, and saves by id. - What a command lists in the drawing's order (the views a change of paper leaves outside, an edit's followers) now comes by id. No format change: no release has saved a view (the views change is still pending). Tests: - views added out of id order are listed and saved by id; - the same views added the other way round make the same drawing and the same bytes, which read back as saved; - a file that lists them the other way round reads by id, as the same drawing, and saves as those bytes; - an edit that leaves them in another order breaks the record's rule; - the existing tests now index the file by id order, and the engine's lists are by id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing dimensions: the dimension record, saved by name on a view (#4896, W19b) A drawing saves its dimensions: each on one of its views, measuring named corners or edges of the view's model (a linear distance between two corners, a straight edge's length, or the angle between two edges), with the direction and reading W19a measures with, how far its line sits from what it measures, where its text sits on paper, its decimals and any text shown instead of the number. A reference names its body, the feature that made the body and its occurrence path, never a picked point. Nothing worked out is saved. - Dimensions are listed by id, read in that order whatever order a file has, as views are: one helper pair (add_by_id, in_id_order) now keeps both lists. - One cap for the names a saved model reference keeps (MAX_REFERENCE_NAME_BYTES, used where 512 was written three times), and the corner's edge cap shared with construct's vertex references. - LinearDirection and Reading save as snake_case words; a direction along a line saves as its two coordinates. - A direction along a line is at most 1e9 each way (format::MAX_REAL, the limit the file's number check holds every real number to): a whole number past it passes that check, reads as a real, and would save as one the next read refuses (found by the mutation test). - One pending drawing-format file (dimensions.rs). Tests: what each dimension saves and reads back as the same bytes, a file in another order reads by id, an older drawing has none; every rule on both sides of its cap, unknown fields at every level, the id rule, and the count cap; the plate fixture carries one dimension of each kind, so the existing round-trip and mutation tests cover them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Edges and corners by name: the matching step and the shared ends, each in one place (#4896, W19b) A dimension finds an edge by name the way a fillet does, but never takes the piece nearest an old pick, and finds a corner where its named edges meet, refusing to choose between two. Both steps are split out of the code that already does them, so there is one rule each: - BodyEdges: a body's edge and face names, worked out once for every name looked up on it, and `matching(name)`: the edge with that name, else the one edge between the faces it names, else the pieces of it. locate_edge now calls it and then takes the piece nearest the pick, as before. - construct::shared_ends: the ends every named edge has, each once. named_vertex keeps the one nearest its point, as before. No behaviour change: every caller of locate_edge, find_edge and the vertex references gets the same results. The existing naming, joint and construction tests cover both paths; three new ones pin what they left open: a vertex only where every named edge ends, the piece of a split edge nearest the pick, and a lone match through the stem of a face taken as a piece, with the warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * A body's frame through an occurrence path, in one place (#4896, W19b) Document::body_frame_at(body, path): the placement the path leads to, then the body's offset, without expanding every assembly instance. It is what EmbossFace::body_frame composed for its saved path; that now calls it, and drawing dimensions use it for the occurrence path they save. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing dimensions found again in the model, strictly (#4896, W19b) Document::resolve_dimensions(model, drawing, ids) works out each dimension as the model has it now: - An edge by its name, or the one edge between the faces it names (BodyEdges::matching), never the piece nearest an old pick. A corner is the one end all its named edges, or their pieces, share; two shared ends are ambiguous, never "the nearer one". - The body by its name and the feature that made it, placed through the saved occurrence path (Document::body_frame_at). A same-named body made by another feature isn't it. - Status: ok; overridden (the text given is shown, the value still worked out); ambiguous (the candidates, at most 16, none chosen); suppressed (its feature is suppressed or rolled back, read from the evaluation's own skipped mark); lost (why); unmeasurable (found, but the view can't measure it so, in W19a's words, such as a line seen end-on). - The value comes from W19a on the view's basis. An angle is the smaller one between the two lines, or pi minus it on its other side, whichever way the kernel runs the edges; a split edge's pieces on one line are still that line. A split edge's length is ambiguous. - The text: the override, else length_number in the drawing's unit (or the design's) with the dimension's decimals, or degrees for an angle. - The cost: each body named is looked up once per call, and its edge names worked out once, however many dimensions name it. A body none names isn't touched. Not saved: nothing here changes the drawing. The last good value of a lost dimension needs the session, so it comes with the commands (W19d). Tests (engine, an 80 x 40 x 30 box, values by hand): front and right view values, foreshortening and text, the drawing's own unit, several at once and an unknown id; a change and its undo; a chamfer's 45 and 135 degrees, and end-on in the front view; lost after a fillet and back on undo, suppressed and back, a path to no occurrence, a new box with the same body name; a notched edge's length ambiguous with both pieces while its end corners still read 80 and its angle to the left edge 90 degrees, neither exact; an angle on a piece of an edge whose slot is then suppressed still reads 90 degrees, found through the stem of the face it was cut from, so not exact; one edge named twice gives two corner candidates; an override shown while the value follows the model. Not covered by a test here: a part placed twice through real occurrences (only a path to no occurrence is); the once-per-body cost (not measured). A drawing unit outside display_units' five (um, yd, km, mil, nm, inch, µm) shows millimetre numbers, the formatter's existing fallback; named as its own follow-up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing sheets: a sheet with anything on it goes only with it, when asked (#3875) drawing.sheet.delete refuses a sheet with anything on it, and its error names what is there: its views and the dimensions in them, the first few ids of each. With `contents: "delete"` the sheet goes with everything on it as one undo step, which an undo brings back whole. What is on a sheet is said once, in the record (Drawing::on_sheet), and Drawing::remove_sheet takes the sheet out with exactly that; each later kind of record on a sheet (a sheet's own sketches) adds itself there, so delete covers it with no change here. drawing.sheet.set's list of a sheet's views uses the same function. Nothing on another sheet goes with it: a view there projected from one of the sheet's views would lose its parent, so the delete is refused naming those views, to be moved or deleted first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views: a view found by id by halves, in one place (#4816) The views are listed by id, so Drawing::view and Drawing::view_index find one by halves instead of walking the list. Every lookup by id uses them: a view's chain of parents (so resolving a view no longer walks the list once for each parent), the views' rules (which no longer build a map of every view to check each chain), a dimension's view, and the engine's view commands and outside check. The rules check the id order before anything looks a view up, so a file with its views out of order is still refused as before. Measured on a drawing of 4096 views (1024 chains of a base view and three views projected one from another), median of 30 runs: 4096 lookups by id took 6.85 ms by a linear find and take 105 us by halves; the rules' check took 1.77 ms and takes 1.45 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views: a damaged chain names the view whose parent is missing (#4816) A view whose chain of parents breaks further up was refused with "its parent X isn't one of the drawing's views", naming a view that isn't its parent. Further up the chain, the refusal now names the view whose parent is missing: "its chain of parents reaches view Y, whose parent X isn't one of the drawing's views". A missing parent of the view itself reads as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing dimensions: add one to a view, and read it back (#4896, W19d) drawing.dimension.add puts a dimension on a saved view of the open drawing; drawing.dimension.inspect reads one back with what it measures now. Adding is one undo step of the drawing; neither evaluates the model. What a dimension measures is picked and saved by name, never by the point picked. Document::edge_reference and corner_reference turn a pick into the record's names: an edge is a point on it in the design's frame or {body, index} (its index among the body's edges as the model lists them, as an ambiguous dimension's candidates are given), and a corner is a point or the edges that meet there, each with the occurrence path its body is placed through. A pick that doesn't name one thing is refused, saying what it found: no edge, a point on several edges, a corner of more than one body, edges that don't meet. Each body's edges are placed in the design's frame once per pick, and only the body picked has its edge names worked out. The kind is given as the record saves it ({linear: {a, b, direction?, reading?}}, {length: …}, {angle: …}), read by the record's own types, so a command and a file read the same words. A new dimension's line is 10 mm from what it measures (until a dimension style gives it), shows 2 decimals, and its text is centred on its line; the text's default place at its centred point (Q58) comes with the layout on paper. The inspect reply has the record, the status (ok, overridden, ambiguous, suppressed, lost or unmeasurable, with why), the value (model mm, or degrees for an angle), whether it is foreshortened, the text, whether every name was found by exact history, and an ambiguous dimension's candidates. One rule, one place: the corner rule's point tolerance is construct::point_tolerance, shared by the picks; a dimension by id is Drawing::dimension, which the resolver uses too. Not here yet: edit, the view's list of its dimensions, the layout on paper and the last good value (the next slices); delete waits with view delete for the drawing UI's choice of one delete command or one for each kind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing dimensions: change a dimension's settings (#4896, W19d) drawing.dimension.edit {dimension, set} changes what a dimension shows and where, as drawing.view.edit changes a view: the offset of its line, its text's place, its decimals, the text shown instead of its number (null shows the number again), and its kind's direction, reading or other side. The reply names the fields that changed. The same values again change nothing and add no undo step (the drawing is put back only when it differs). What a dimension measures isn't a setting: to measure something else, add a new one. A setting its kind hasn't got is refused (an angle has no direction, only an angle has an other side); every changed record passes the check a file read runs, so an edit can't save what opening the file would refuse. A dimension's place in the list is Drawing::dimension_index, which Drawing::dimension now uses too, as a view's is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views: inspect lists a view's dimensions (#4896, W19d) drawing.view.inspect answers `dimensions`: the ids of the view's dimensions, in id order, so a caller can find them and read each with drawing.dimension.inspect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views: a copied view takes copies of its dimensions (#4896, W19d) drawing.view.copy_to_sheet copies each copied view's dimensions with it, each with an id of its own on the copy, in the same undo step: they are part of what the view shows (the W19d plan's question 1, its recommended answer). A dimension's text placed `at` a point is from its view's centre, so it keeps its place on the copy. A moved view keeps its own dimensions as they are: they name the view by id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing dimensions: the last good value, in memory (#4896, W19d) A dimension that can't be measured now (its edge filleted away, its corner gone) gives `last_good`: the value it last read this session, as `value` gives it (model mm, or degrees for an angle). Each value a dimension reads is kept by drawing and dimension in the session, and a scratch copy keeps the session's. It is never saved (the W19b plan's question 3), so a design's drawings don't change with every model edit, and after reopening a lost dimension shows no number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing dimensions: hostile values anywhere in the commands' params (#4896, W19d) A hostile value in each place of drawing.dimension.add, .edit and .inspect's parameters, at every depth (the kind, its picks and paths, a corner's edges, the edit's settings), with 1 000-item lists, the largest index and 600-byte text besides the engine's shared hostile values: no panic, and the drawing keeps its rules. The engine's own hostile test sends only its list of key names, none of which these commands read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing dimensions: a new dimension's defaults, tested (#4896, W19d) The offset (10 mm), the text's place (centred) and the decimals (2) a dimension is added with when not told. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * A plane carried by a transform, in one place `assembly::map_plane` is public and gives `None` for a transform that flattens the plane; its two copies (the occurrence mapping, which keeps the plane as it was, and the face anchor's, which refuses) now call it and keep their own fallback. W20a's radial dimensions use it to carry a view's plane into a body's frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing dimensions: a circle's or an arc's radius and diameter (#4896, W20a) A radial dimension saves its edge by name and whether it shows the diameter. It reads the edge's exact circle in the view's plane through the edge (`Body::planar_edges`, as the view draws it), so a view that doesn't see the circle face on can't measure it; its text is R or Ø before the number. `drawing.dimension.add` takes `{radial: {edge, diameter?}}`, a diameter by default for a whole circle or half a turn or more (a hole's rim is two halves), and refuses a dimension of any kind its view can't measure; `drawing.dimension.edit` switches `diameter`, keeping the id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4a781b8cd8 |
MCP: --param-check checks calls to the running app (#9072) (#9073)
* claim: #9072 * MCP: --param-check checks calls to the running app (#9072) `mcp --connect` (and `mcp` once it bridges to an app) took `--param-check` and forwarded every call unchecked, while the app's own session is always off. `Remote` now checks each `engine.execute` and `engine.batch` against this server's command contracts before sending: `strict` refuses a call, or a batch with such a step, without sending anything, and `warn` adds `param_warnings` to the app's reply (each step's result in a batch). A command with no contract here goes to the app unchecked. `Auto` carries the headless session's level over when it bridges to a late app. `batch_preflight::contracts` is the contract half of the existing preflight, for a runner in another process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
2356a63aea |
CLI: run takes --param-check (#6921) (#6924)
* claim: #6921 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * CLI: run refuses unknown options and takes --param-check (#6921) `solidcraft-cli run` now checks its options through `known_args`, so a mistyped option fails instead of being ignored, and takes `--param-check off|warn|strict` with the MCP server's words and default `off`. `warn` prints each unknown key with a suggestion on stderr and runs the step; `strict` stops at that step and writes nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * CLI: run's option check takes --param-check; warn on timed runs as steps complete `run` keeps #6919's (#6918) unknown-option check, with `--param-check` among the options that take a value. `Session::run_script_timed` now takes the same per-step callback as `run_script_each`, so `run --timings` or `--profile` at the warn level reports a step's warnings even when a later step fails, instead of after the script (and not at all on a failure). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
5f11d92458 |
Opening a design pins its body names, so the first undo evaluates nothing (#8939)
Problem: a design saved before body names were pinned (#6403) is pinned by its first command that changes it, as part of that command. Undoing that command went back to the unpinned design, whose fingerprints no evaluated result matched any more, so the first undo after opening evaluated the whole timeline again: 63-72 s in the SELENE rover (5,484 features) when opened from the command line or headless (`Session::opened_at`), 0.08 s with this change. `doc.open` pinned at the end of the command instead, which kept undo fast but left the design with unsaved changes on opening. Solution: `Session::opened_at` pins the names as it opens the design, with the names the file's bodies have (no result changes, so nothing is evaluated), and takes the pinned design as the saved one: opening is no change. Claude-Session: https://claude.ai/code/session_013WUFq6QFBqmZjxwaKy2J1M Co-authored-by: Markus Kaltenbrunner <kaltenbrunnermarkus@users.noreply.github.com> |
||
|
|
cb05e1e0f7 |
GPU path tracer: run on Metal on macOS (#7183) (#7185)
* claim: #7183 * GPU path tracer runs on Metal on macOS, not only Vulkan (#3217) |
||
|
|
e6dc105134 |
Point clouds: insert PLY, XYZ and PTS scans as a modelling reference (#5151) (#5381)
* Point clouds: insert PLY, XYZ and PTS scans as a modelling reference (#5151) A point cloud is kept in the design as a reference, drawn as depth-tested dots and never a body. - io: a PLY reader (ASCII, binary little/big endian; x, y, z of any numeric type, optional colours, other elements skipped; counts checked against the file) and XYZ/PTS text, thinned evenly past max_points. PLY meshes with faces can also come in through file.insert_mesh. - doc: Document.point_clouds (shared f32 points relative to an f64 origin, colours, units, rigid placement, size and colour), stored as a binary container part; format change in pending/point-clouds.rs. - engine: pointcloud.insert / edit / delete / list; doc.open opens a cloud as a new design; selection.delete takes point_clouds; view bounds include them. - gpu: an instanced point-sprite pipeline (16 bytes a point). - ui: Browser Point Clouds folder with eyes, menu and an Edit Point Cloud card; drop, Open, Insert and file dialogs take .ply/.xyz/.pts; a CPU viewport fallback; messages in en, en-GB, ja, zh, de and ko. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Point clouds: colour by the file, one colour or height, from the UI (#5151) The Edit Point Cloud card gets Color By (File Colors, Single Color, Height). Height is a blue-to-red ramp over design Z, between the cloud's own two heights or, by default, a range worked out from the points (all but the lowest and highest 2 %, from an even sample). pointcloud.insert and pointcloud.edit take color_by and height_range; pointcloud.list reports them. The colour of each point is worked out in one place (PointCloud::shade) for the GPU and CPU viewports. Also: the card's dropdowns compare the picked index (a dropdown's response doesn't report the pick, so File Units did not change either). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Point clouds: integrate format registration and viewport caches (#5151) * Point clouds: satisfy current UI audits and document comparisons (#5151) Route model RGB data through the theme conversion boundary, provide a compact ribbon label, and include point clouds in the new document comparison. Gate the Unix-only CLI-link helper and test so Windows all-target checks remain buildable after the rebase. * Point clouds: isolate translations for current main (#5151) Move the existing 74 messages unchanged into one pending locale file and attribute it through a pending row, following the current repository workflow. Repository checks, 50 tooling tests, final workspace Clippy, wasm and generated-catalog equality checks passed after the rebase. * Point clouds: fit the rebased code to main's GpuTarget and Frame Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Compare point clouds when reusing placement-independent results Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Point clouds: complete command help and required translations (#5151) * Point clouds: size the save cap from the raised limit after the rebase 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> |
||
|
|
dd2e44bb12 |
Raise the largest file SolidCraft opens with a setting or launch flag (#4086) (#7565)
* claim: #4086 * Raise the largest file SolidCraft opens with a setting or launch flag (#4086) * Translate the file size limit strings * Size limits: design files are .sc now, .solidcraft still read |
||
|
|
e181015fd1 |
MCP save: a folder the agent opened or saved a design in stays in scope (#7181) (#7216)
* claim: #7181 * MCP save: a folder the agent opened or saved a design in stays in scope (#7181) The agent's default folders held the open design's folder only while that design stayed open there, so after a new design, an opened STEP file or a save-as elsewhere a save beside the earlier design was refused, while the same save through the control port worked. The MCP server now keeps, for the rest of its run, the folder of every design file a call opened or saved (open, save, and doc.open, file.save, file.save_as through execute or batch, path given in full) and, headless, of every design open in its session. Such a call only succeeded because the folder was already in scope, so naming a path adds nothing. The folders get the open design folder's terms (inside home or temp, not hidden, hidden entries unreachable), at most 16. Bridged, they go to the app as design_folders, which it judges the same way. The save tool description and docs/mcp.md say how to add a folder with --allow-path. * MCP scope: a design's folder is the folder its file resolves to (#7181) A link in another folder to a design inside the agent's folders passes the scope check, which follows it, but its own folder was what got remembered (and, for the open design, what counted while it was open). Take the folder of the file as the check resolves it. * Control test: a hidden file the export format accepts (#7181) --------- Co-authored-by: MateuszSychXpl <151755914+MateuszSychXpl@users.noreply.github.com> |
||
|
|
03b8f4138b |
New designs save as .sc; .solidcraft files still open (#7325)
* claim: new designs save as .sc Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * New designs save as .sc; .solidcraft files still open and keep their name on Save DESIGN_EXT is now "sc"; DESIGN_EXTS lists sc, solidcraft and solvecraft and every open path (dialogs, drag-drop, recent files, CLI, MCP, links, the web picker) accepts all three. Save of an opened .solidcraft file writes that file; Save As, autosave, recovery and crash reports use .sc. Windows, macOS and Linux register .sc alongside the older extensions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update UI tests for the .sc default extension Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
9a7b657fdc |
Assistant: connect the last-used agent on startup (#7009) (#7124)
* claim: #7009 * Assistant: connect the last-used agent and open the panel at start (#7009) Two Settings > AI options, off by default: when SolidCraft starts, connect the agent started last (once the installed agents are known; a missing one is not swapped for another) and open the Assistant panel. Not for runs started with --control. A connection that never gets ready (no agent, start error, the agent ends while starting) is a new Failed state: the header reads Connection failed and Connect reads Retry. The control channel reports it as "failed" and takes connect_at_start / open_at_start. * Assistant: keep the start-up agent when a design replaces the blank one (#7009) Opening a design over the blank design SolidCraft starts with reset its chat and stopped the agent connected at start. A chat not asked anything yet now starts over in place and keeps its agent. Turning AI features off also drops a start-up connection still waiting for discovery. * i18n: Arabic, Hebrew and Vietnamese for the start-up options (#7009) ar, he and vi are complete catalogs on main now, so every new English message needs them. --------- Co-authored-by: MateuszSychXpl <151755914+MateuszSychXpl@users.noreply.github.com> |
||
|
|
a7c1909766 |
CLI: evaluate scripts on the input design (#6861) (#6872)
* claim: #6861 eval scripts on input designs * fix(cli): evaluate scripts on the input design (#6861) * fix(cli): validate eval options before opening inputs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
03bf992bc1 |
Keep linked components valid through Undo after Save As (#6860) (#6877)
* claim: #6860 * fix: preserve linked component targets across Save As history (#6860) |
||
|
|
189b47c750 | Chamfer and Fillet refuse a point where several edges meet (#5173) (#5177) | ||
|
|
b3cbbe7bd5 |
CLI: reject incomplete and unsupported run/eval options (#6918) (#6919)
* claim: #6918 validate run and eval options * fix(cli): reject invalid run and eval options (#6918) |
||
|
|
dfde1e032d |
mcp setup: add SolidCraft to the AI clients on this computer; plain mcp finds a late app (#6379)
solidcraft-cli mcp setup (alias install) and Help > Connect AI assistants edit each installed client's own configuration in place, with this program's absolute path: OpenCode, Claude Desktop, Claude Code, Cursor, Codex, Gemini CLI, Copilot CLI, Windsurf, Zed and VS Code. Only the solidcraft entries change; a stale path is refreshed and an entry the user changed is left alone. Plain mcp keeps looking for the app while its headless session has no work, and says on every tool result that it is headless when the app was not found. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
0520910bfd |
Control: name the token file and spot a stale one when a call is unauthorized (#4664) (#4670)
* claim: #4664 * Control: name the token file and spot a stale one when a call is unauthorized (#4664) When the app refuses a token that the MCP client read from a token file, the error now names that file, when it was written and how long ago, without printing the token. The app also writes `<port>.pid` beside the token file (its process id and, on Linux, its start time) and removes both at exit; when that process has exited, the error says the token file is stale. The process check runs only after a refusal, and the token file itself stays one line, so existing clients keep working. Document force-quit leftovers and the MSIX AppData redirection. * Bench assistant: read the token out of the new ClientToken Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: bherbruck <brennen.herbruck@gmail.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
9e6e0b8df1 |
Render workspace: complete experimental ribbon, resources and effects integration (#5493) (#5494)
* wip(render): reconcile completed material and image pipeline source with 0.20 (#5493) Source-only integration reference for staged review, not a merge-ready aggregate. Donor: 0xlillith/solidcraft@aea20b0115. Upstream: |
||
|
+33 |
b7b25f9e2b |
Render workspace: first basic delivery to main (#6050)
* Normalize UI container violation paths across platforms (#5599) Report repository-relative paths with forward slashes so diagnostics and the existing nested-package regression assertions agree on Windows and Unix. Keep the container detection rules unchanged. Validation: official ui-containers gate and all seven focused xtask tests passed; rustfmt and diff checks passed. Only xtask/dependencies were compiled; no application build or heavy tests. (cherry picked from commit |
||
|
|
5e0e7a4c6a |
CLI: --help on each subcommand prints its usage and exits 0 (#4538) (#4545)
* claim: #4538 * CLI: --help on each subcommand prints its usage and exits 0 (#4538) Every command now answers `--help` and `-h` with its own usage on stdout and exit 0, the way the top level has since #1828. Before, each subcommand answered differently: `fuzz --help` started a fuzz run with the default seeds and ran until it was stopped, `recipe --help` took the flag for a file name, and `snapshot`, `render`, `oracle`, `run`, `eval`, `script` and `crashes` answered with an error on stderr and exit 1. The help is read before the command runs, so `--help` never starts work: no fuzz run, no MCP server, no file read. `fuzz` also refuses an argument it doesn't take, as `snapshot` already did: a flag it doesn't know and a stray word are errors, not arguments to ignore while a hundred seeds run. The usage lives in one place now: each command's lines are a constant, and the top-level usage is composed from them, so the two cannot drift apart. The top-level usage is unchanged, byte for byte. # Conflicts: # apps/solidcraft-cli/src/main.rs |
||
|
|
0dffb206b1 |
Assembly: ground the first part; drag free joint chains (#2804) (#2805)
* assembly(feat): ground first parts and drag free joint chains Ground the first top-level part when it is created and let face dragging reposition free occurrences or any member of a floating joint chain in one undo step. Preserve exact repeated-placement frames, joint values, modifier selection and Escape cancellation. Keep the accumulated fixture, viewport layout and documentation integration fixes from the existing PR. Signed-off-by: Karl Von Richter<karl@embeint.com> * assembly(fix): update movable fixtures for first-part grounding Accept the documented grounded override in component creation, explicitly free movement fixtures, and keep linked clipboard pastes movable even in an empty document. Cover first and reused linked pastes, default insertion grounding, and single-step undo in the existing link tests. Signed-off-by: Karl Von Richter<karl@embeint.com> * assembly(test): keep the motion-cost crank free Unground the first component in the document-level joint-face measurement fixture so its motion samples can rotate after first-part grounding. Preserve the rotation and shared-measurement assertions that caught the Linux CI failure. Signed-off-by: Karl Von Richter<karl@embeint.com> * assembly(test): free the frame placement fixture Create the frame-member placement fixture ungrounded before moving it above its root sketch. Keep its world-space member assertions while respecting first-part grounding in the frame tests added on main. Signed-off-by: Karl Von Richter<karl@embeint.com> --------- Signed-off-by: Karl Von Richter<karl@embeint.com> |
||
|
|
98c4f335e8 |
Control channel and MCP on by default, with a setting to turn it off (#5561)
The app opens its localhost control channel on port 27878 (or the next free one) unless Preferences > Assistant turns it off; --control and SOLIDCRAFT_CONTROL_PORT still win. A current.port discovery file lets solidcraft-cli mcp find the running app with no arguments. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
e33c371e99 |
Model cache: thin the checkpoints of a design too big for its file instead of leaving the cache out (#3220) (#4882)
* claim: #3220 * Model cache: keep fewer states of a design too big for its file instead of none (#3220) A model cache over the container's budget keeps the final state, then the slowest features' states while the bodies they add fit (a body several states hold counts once), and is left out only when not even the final state fits. Opening evaluates just the features whose state the file left out, each from the state before it, so the model is whole afterwards. * Model cache: keep each encoded body apart, copy only what a cache stores Encoding a model too big for its file no longer copies every distinct body into one buffer before thinning: the payload is copied from the encodings once its size fits, so saving holds no more than before. * Model cache tests: canonical runs in the timeline fixture; rustfmt * Model cache: count the records a thinned cache keeps; always try the final state Thinning counted only the bodies, so a model of many copies of one part (records, not bodies, filling the room) shrank its budget to nothing and saved no cache although its final state fitted. The choice now counts the records of what it keeps, always keeps the final state, and says what it counted, so each retry keeps less and the final state alone is always tried. * docs: a thinned model cache counts its records and always tries the final state * Model cache test: the slowest feature's state holds bodies 16 to 23 * Model cache: thinned opens with fingerprints that read the state before a feature Since #3397 a feature's fingerprint reads where the bodies before it lie. After a state the file left out, adopt takes the saved fingerprint and the evaluation that works the state out checks it. A result evaluated ahead is never taken as one the file left out. The thinned round trips include the placed components' design, whose cut reads those placements. --------- Co-authored-by: MateuszSychXpl <151755914+MateuszSychXpl@users.noreply.github.com> |
||
|
|
dad28abecf |
solidcraft-cli bench-assistant: the standard Assistant model test (#4851) (#4930)
* claim: #4851 * solidcraft-cli bench-assistant: the standard Assistant model test Runs the eleven v1 tasks of #4851 against a desktop app that is already running with a control port. Each task starts a new design and a new chat with All permissions, runs only the prescribed setup, sends the prompt once and waits for the turn. The result is checked on the design (document.inspect with measurements): body count, volume within 1% (0.3% for the fillet), bounding-box size in any orientation, the lowest corner, the body name, live feature kinds, and changed or unchanged content; the volume question is checked on the reply. Failures get the issue's categories from the conversation's items. Prints a table, and writes the issue's comment template (--markdown) and the raw results with each conversation (--json). |
||
|
|
c54b711345 |
CLI: --help prints usage to stdout and exits 0 (#1818) (#1828)
* claim: #1818 * claim: #1818 * fix(cli): --help, -h and help print usage to stdout and exit 0 (#1818) 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> |
||
|
|
93a2922c5e |
Display plans and the model cache for large STEP assemblies (#2814) (#4021)
* STEP import: mesh band faces that wrap around a closed surface correctly Fixes two related bugs that caused SolidCraft to fail to mesh a face wrapping all the way around a closed, non-periodic surface (a revolved ridge band, or a tube-shaped B-spline surface): a missing face, a folded/self-overlapping triangulation, or a hole in the rendered body. 1. Ring edges that run slightly off their surface. STEP files write a surface and the curves bounding it to the file's own declared uncertainty, so a ring edge can legitimately sit a few micrometres off the surface it bounds. The code finding where a ring edge crosses the planned split line compared against the edge's raw (off-surface) point using a hardcoded tolerance far stricter than the file's own precision, rejecting a valid cut. Now matches against the point on the surface directly below the ring crossing, respecting the file's declared tolerance. 2. Closed B-spline surfaces, their slits and their slivers. truck only treats the rotation of a revolved surface as periodic; a face on a B-spline surface whose control net closes on itself (a tube) wasn't recognized as wrapping around at all. This produced a folded face, a hole (a boundary loop landing a full period away from where it should cut), and one near-zero-width sliver face costing the entire body its tessellation plan. Adds periodicity detection for closed B-spline surfaces, period- aware hole-loop alignment, dropping of zero-width slit boundaries, and isolating a too-thin-to-triangulate face so it no longer takes the rest of the body down with it. The GPU shader's periodic wrap mirrors the CPU math so the two don't drift apart. Regression tests: band_faces_split_when_ring_edges_run_off_their_surface, band_face_with_a_zero_width_slit_is_still_meshed, a_sliver_face_too_thin_to_triangulate_does_not_cost_the_body_its_plan. Ablation-tested: disabling either mechanism in (2) reproduces its target test's original failure message while leaving the other test unaffected. * STEP import: mesh the band's split faces, not just split them jyviko asked whether a band wall missing from the interactive app's render was a shading issue or a genuinely missing face. It was missing: the ring- edge split fix made the band's topology correct, but plan_face still produced zero triangles for the two new sub-faces. Two causes, both in plan_face (crates/kernel/src/tess/mod.rs): 1. The tolerance for how far an imported boundary may lie off its surface was tied to the requested mesh's chord tolerance instead of to the body's own size. A finer display tolerance could then reject a boundary a coarser one had just accepted, so the face would drop out exactly when zooming in on it. 2. Near a sharp corner of this flat-panelled band, several boundary points that are legitimately a few micrometres apart (within the STEP file's own declared precision) all projected onto the same surface point. The boundary loop then repeated a point in (u, v), which a triangulator can't follow, so the face's plan failed outright. One face without a plan costs the whole body its plan, and the fallback mesher can't handle a closed B-spline surface either, leaving both halves of the split band with no triangles at all: present in the topology, invisible in every renderer, and absent from the body's volume. Fix: scale the off-surface tolerance to the body's own extent (new Rules::extent), and collapse a run of boundary nodes that land on the same surface point to one (drop_collapsed) before triangulating. Regression test additions to band_faces_split_when_ring_edges_run_off_their_surface: the body's volume now matches the analytic pentagon prism (was a third of it - only the top cap - before this fix); display_plan leaves no face without triangles from coarse to fine tolerance; and the actual tolerance and facet angle the viewport draws with gives the split band its full lateral area on both halves. Confirmed on review_band_big.step, the fixture behind the review screenshots: volume's relative error against the analytic pentagon prism drops from 1.4e-4 to 4.1e-6, and the band wall now occludes the floor grid behind it in a snapshot the same way the top and bottom caps always did. Full kernel suite: 739 tests, 0 failed. * STEP import: hold an imported boundary to the file's own tolerance, not the part's size jyviko: the off-surface acceptance added in the last commit (rules.extent * OFF_SURFACE) scaled with the part, so a 2 m part silently accepted a boundary 2 mm off its surface while a 20 mm copy of the same part accepted only 0.02 mm. A STEP file's own declared uncertainty does not grow with the part, so the bound shouldn't either. Body gains boundary_tol: Option<f64>, Some(file's declared tolerance) for a body read from STEP (crate::step_in::Units::tol, already used by the ring-split fix in split.rs), None for anything this kernel built. It's set before the import's own unmeshed-face check runs, and carried over by the two face-split operations that re-cut an imported surface (splitface.rs, outline.rs), since the file's uncertainty still describes those boundaries afterward. plan_face's accept now reads: the file's own tolerance when the body declares one, or the old chord-tolerance/extent bound otherwise. The old bound's tol * 10.0 term had to go too, not just the extent term: at a 2 m part's typical display tolerance that term alone is ~20 mm, nearly ten times the extent bound jyviko objected to, so keeping it would have left the exact 2 m/2 mm example still silently accepted. Two new tests in step_in/tests.rs: - band_faces_split_when_a_scaled_copy_runs_off_its_surface: the same band fixture at a realistic 2 m scale with the same absolute slop and declared uncertainty as the small one, meshes the same way at every chord tolerance from coarse to fine. - off_surface_budget_follows_the_file_not_the_part_size: the actual regression. The same off-surface error is accepted or refused the same way whether the part is 20 mm or 2 m; a 2 mm error against a 1 µm declared uncertainty is refused at both sizes now (accepted at 2 m under the old bound, refused at 20 mm - that asymmetry was the bug). Checked at both a coarse and a fine display tolerance. Known gap, not fixed here: a STEP-imported body saved into a .solidcraft design and reopened loses boundary_tol (native.rs's decoder has no field to read it from) and falls back to the old extent-based bound on reload. Today's design format has no concept of this value at all; persisting it is a real format change, out of scope for this fix. Full kernel suite: 776 tests, 0 failed. clippy -D warnings clean. * Display plans for STEP threads and pointed ends (#3847) Three faces cost a threaded or pointed STEP part its whole display plan, so it was drawn from the reference mesh: cracked, faceted, and never refined up close. - A loop through a pole (a cone's apex on the boundary) seemed to wind around the surface: the jump at the apex, unwrapped to the nearest copy, was arbitrary. The loop is turned to end where it leaves the pole, so the step that closes it is an ordinary one (`seam::close_through_pole`). - Projection onto a spline with hundreds of spans (a helical flank) restarted from a 16 x 16 grid and settled on another turn; it now starts from two points per span, capped. - Sag refinement no longer inserts a point exactly on a boundary side, which split the side and failed the face. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tess: a refused face's edges are divided finer and it is planned again (#2814) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * tess: sliver faces plan empty; a face no method plans is filled flat from its nodes (#2814) A face whose boundary runs out and back along itself (two edges between the same vertices, a rounding apart, as STEP files write slivers) encloses nothing and is planned with no triangles. A face still refused after its edges are divided finer (a cusp, a sliver whose sides sag across each other, a small cap at a pole) is filled flat from its shared boundary nodes, so the rest of the body keeps its display plan instead of falling back to the reference mesh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * display mesh tests: a rim the chord tolerance leaves a line is divided again (#2814) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * portable B-rep: up to 8192 control points along a spline direction (#2814) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * solidcraft-cli: --debug logs what the engine reports to stderr Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * STEP import: a spline written over a tiny parameter range is read over one (#2814) Some writers parameterize splines over a few millionths (a humanoid robot's edges span 5.4e-6). The kernel tells parameters apart only to 1e-6, so over such a range it evaluated the curve's end wrongly, and trimming an edge to its vertices dropped a control point: the bodies could not be stored exactly and the whole model cache was left out of the design. The knots are now stretched to span one; the curve is the same and edges are trimmed by their vertices, so nothing read from the file refers to the old parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * model cache: a body keeps its file's declared accuracy (#2814) A body restored from the cache dropped the accuracy the file it was read from declares, so the planner held its boundaries to the kernel's own bound and a reopened design drew differently from the import. It is stored with the body's runtime values, and only when there is one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * tess: a boundary within a hundredth of its body lies on its surface, at every quality (#2814) #1721 held a body read from a file to the accuracy the file declares. A writer declares what it aims for, not a bound its edges keep: a 251-body robot assembly declaring 0.01 µm has boundaries 10 to 30 µm off their surfaces, and 95 of its bodies lost their display plans. The bound is a hundredth of the body again, what Normal quality always allowed, and now the same at every quality, so zooming in still never drops a face (#1721's point). A file declaring more raises it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * STEP import: keep faces whose edge vertices sit slightly off their curves Some exporters write an edge's vertex beside the end of its curve, further off than the accuracy the file declares (a surface export declares 0.01 mm and puts a vertex 0.19 mm off two spline ends). The reader refused such edges and left the face, and with single-face bodies the body, out. A vertex may now sit up to the file's tolerance or 1/1000 of the model's size (the diagonal around its VERTEX_POINTs), whichever is larger, never more than the existing 1 mm ceiling. Spline and open-conic edges have the end control point moved onto the vertex, so every such edge meets its vertices exactly. The file's declared accuracy still governs closed-curve, seam and circle checks. * tess, io: review clean-ups (#2814) - A sliver face is one whose loops are all slit: drop_slits finds it in the retry after a failed plan, so the pre-check on every face (folded) is gone. - The flat fill uses cdt::triangulate (a lenient fill that leaves out sides crossing one already kept) and its flood-fill inside test, and the plane from geom::Plane. - Refinement only builds its indexes when a face was refused, takes the faces to plan again from edge_faces, and re-samples edges on the pool; Rules::finer for the finer rules. - One PackageWriter::fits for the model cache, the preview and the thumbnail. - The band split's ring tolerance lives in split.rs; comments say what the off-surface bound is now. - The CLI logger prints Level::as_str(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM --------- Co-authored-by: David Lackovic <lackovicdavid1234@gmail.com> Co-authored-by: bherbruck <brennen.herbruck@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com> Co-authored-by: Ray <raykholo@users.noreply.github.com> |
||
|
|
9e78e86b92 |
perf: renaming a body evaluates nothing (#3044) (#3095)
A body rename changes names only, but committing it went through the general "design changed" path: the whole timeline was evaluated again. On an imported assembly that means reading the STEP file again and meshing every body (about 100 s on the Prusa Core One, and the same again for undo). When the only change from the previous design is one body rename (the features' stored body names and the body-keyed maps the rename updates), the model now renames the body in its results instead: every body keeps its geometry and meshes, and the fingerprints are set to the renamed design's so the next evaluation reuses everything. Undo and redo of the rename take the same path. A rename the model can't follow that way (the body is changed or named by a later feature, sheet metal, threads) still evaluates the design as before. `bench-open --ops script.json` times commands and their undo on an opened design, with the view work each leaves. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e98e065584 |
Open saved designs from the model they were saved with (#3053) (#3102)
* WIP: adopt the saved model on open (#3053) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP: tests * WIP: bench-open opens as Open does * docs: opening from the saved model * Tests: an edit after opening evaluates from the feature it changes * clippy * Read SOLIDCRAFT_NO_MODEL_CACHE through the env helper * Open: no picture from the model when the model itself opens; cancel test evaluates * Saved model: bodies passed through found without writing their record; states list runs of bodies * Adopted results go into the evaluation cache: an undone edit, or the marker rolled forward, takes them again * Model cache size guard: the saved model's writer --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
953fd7d5f8 |
Typed parameter contracts and JSON Schemas for solid.box and solid.extrude (#2829) (#2611)
* Spike: typed parameter contracts and JSON Schemas for solid.box and solid.extrude The schema RFC's spike (plan/schema-spike.md). solid.box and solid.extrude get typed contracts with generated JSON Schemas (2020-12), checked in front of the unchanged handlers by a per-session level: off (the default, which changes nothing), warn (the call runs and gains param_warnings) or strict (the call is refused and the design left alone). Also engine.describe and the MCP tool describe_command, `solidcraft-cli mcp --param-check off|warn|strict`, a FeatureResult type for feature replies, and an env-var audit recorder (SOLIDCRAFT_PARAM_AUDIT) used to check the contracts against every test. Local spike branch; not for upstream as is (see the results report). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Parameter contracts: put the audit recorder behind a feature; drop two ignored test keys The audit recorder is now on only in a build with the engine's `param-audit` feature and `SOLIDCRAFT_PARAM_AUDIT` set. Its code is still compiled, linted and tested without the feature. `scripts/param_audit.py` summarises a test run's audit logs, and the schema module's docs give the steps for converting a further command. Two tests passed keys their command ignores, which the audit found: `position` on `solid.box` (`hole_face_tests.rs`) and `symmetric` on `solid.extrude` (`face_tests.rs`). Both are removed, so the tests build what they always did. Comments no longer call the contracts a spike. 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> |
||
|
|
d0afc31632 |
Save the evaluated model with every design: exact, stored once, scaled caps (#3053) (#3093)
* Model cache written by default: exact bodies, stored once, scaled caps (#3053) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * bench-open: say why bodies were not kept * Exact planes and revolutions; budgets for large bodies (#3053) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Native B-rep: rebuild shells as the kernel made them (closed and seam edges) (#3053) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: the model cache and the exact native B-rep (#3053) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * bench-open: time a save without the cache too * Model cache entries are Deflate-compressed (#3053) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Model cache: one that does not fit the design file is left out, never a failed save (#3053) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
803ae6d5be |
Script replay keeps a feature name another feature has (#1990) (#1997)
A sketch and the feature built from it may share a name, and the sample and oracle designs do. `timeline.add` refused such a recorded name, so a design's own exported script failed to replay. `Document::insert_feature` now keeps the name, as `add_feature` does; a blank name still gets a fresh one. Co-authored-by: bherbruck <brennen.herbruck@gmail.com> |
||
|
|
31b41978fc |
Construction geometry on model vertices follows them when a parameter moves them (#568) (#2409)
Thanks @rlartot. |
||
|
|
26f42ae09b |
Snapshot: draw a see-through appearance see-through, and show a tool body inside its target (#2329) (#2330)
* Snapshot: draw a see-through appearance see-through, and give the CLI --body, --tool and --section A headless picture dropped a body's opacity: the scene carried only a colour, so a design with a translucent appearance was drawn opaque by `solidcraft-cli snapshot`, by MCP screenshots and in a design's thumbnail, although the window has always drawn it as glass. There was then no way to look at the body a cut would remove inside the material it meets: only a volume to measure and reason about, which hides exactly the errors a picture makes obvious (a tool that stops short, or lands in the wrong place). - `SceneMesh` carries the body's opacity; `view::build_scene` takes it from the design (`model_body_opacity`), and a selected body stays solid so the selection colour reads. - The GPU capture routes a see-through body into the scene's glass at its own alpha, as the viewport does; the CPU rasterizer draws the solid bodies first (they own the depth buffer), then the see-through ones blended over them, far sides before near sides and without writing depth, so what lies inside shows and a line between the two is not hidden. - `snapshot --body NAME:opacity=0.3,color=#rrggbb`, `--tool NAME` (that body solid in the tool colour, the rest see-through) and `--section z=27` run the commands the app itself runs (`appearance.assign`, `inspect.section`): the options are shortcuts, not a second renderer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Tests: measure the tool colour as it is drawn through a see-through target The tool-colour filter was derived on paper and demanded a red more than twice either other channel, which the target in front of it tints away (measured: (200, 108, 85) through opacity 0.3); and the colour check painted the tool, which a solid target hides. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fmt * Snapshot options: strip the colour's # rather than slicing it; README Slicing `value[1..]` on an input-derived string is what the house rules ask us not to write, even where a length check has already made it safe. The error a failed assignment reports now names the body rather than claiming it came from --body, since --tool reaches it too. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * --tool: assign the bodies around the tool in groups, not one command at a time Each appearance.assign is an undo step with a document snapshot behind it, so one per body made --tool cost grow with the size of the design for no reason: the bodies around the tool all get the same opacity, and the ones that share a colour can be named in one call. A design whose bodies all wear the default grey now costs two commands whatever its size. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Rasterizer: say where its glass and the GPU's differ Splitting each see-through body by facing orders its own two layers; it does not sort across bodies, which the GPU does. Worth stating rather than leaving a reader to find it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: bherbruck <brennen.herbruck@gmail.com> |
||
|
|
6f93e7a851 |
fix(examples): cut both mounting holes in the bracket (#1515)
Co-authored-by: bherbruck <brennen.herbruck@gmail.com> |
||
|
|
f3505f0db6 |
World placement on all cores (#3053) (#3123)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
7ad5130cd2 |
refactor: geom::UnitVec3 for unit axes and normals (#2603)
* geom: UnitVec3; a face's analytic axes and normals are unit by type Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * geom: UnitVec3 adds to and subtracts from a Vec3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * kernel, doc, engine: cylinder axes and measured normals held as UnitVec3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * kernel, engine: functions that take a unit axis or direction say so by type Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * doc: a face's normal goes to Plane::from_normal as is Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * kernel, doc: main's new cylinder helpers take the face's axis as a UnitVec3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
9eb1540a34 |
Docs: describe SolidCraft as independent CAD (#2768)
Reword comments, docs and package descriptions so they describe SolidCraft's own behaviour instead of comparing it to another product. The trademark notice, the commercial-CAD rule and the navigation preset name stay as they were. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
bc68e14c3e |
Mutation testing: judge kernel mutants by the black-box suites (#2660)
The kernel will move from truck to solidcore (#1597). The tests that must catch regressions across that switch are the ones that don't depend on the kernel: the reference tests and the robustness goldens. cargo-mutants checks whether they would notice a change in the kernel's behaviour. - apps/solidcraft-cli/tests/oracle_cases.rs: the reference tests as a cargo test (ignored; CI keeps replaying them through cargo xtask oracle), run over one process per core. - .cargo/mutants.toml: mutants are judged by that test and the pull-request sample of the robustness goldens, not by the kernel's own unit tests. - A mutants profile (ci with incremental builds): about 15 s to rebuild after a kernel change instead of about 3 minutes. - docs/mutation-testing.md: how to run it, its cost, two cargo-mutants 27.1 problems and the pilot's results (15% of sampled kernel mutants caught). Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
83c31d77c4 |
surface.boundary: surfaces through boundary curves and curve networks (#763) (#2129)
* feat(geom): surfaces through curve networks, and spline spaces to build them Adds spline_space (clamped B-spline spaces, Hermite interpolation, exact embedding by Bézier degree elevation and knot insertion, a monotone cubic for reparameterising) and network (loft, Coons and Gordon surfaces through curves in one or two directions, with G1/G2 cross-boundary conditions against a neighbouring face). Part of #763. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(kernel): boundary surfaces from sketch curves, 3D curves and edges kernel::boundary_network turns sketch chains, 3D sketch polylines and edge chains into network curves, gives G1 frames of the faces along open edges (EdgeFaces), builds the B-spline face (sides split at chain vertices so a join shares the body's edges) and joins it into a surface body by stitching. G2 is refused for now (not supported yet). Part of #763. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(kernel): second derivatives of B-spline surfaces in the vendored truck-geometry BSplineSurface::uuder and vvder multiplied the second differences by p instead of p·(p − 1), as BSplineCurve::der2 does, so every surface of degree p ≥ 3 (NURBS too, through its homogeneous surface) reported 1/(p − 1) of its second derivative: a cubic surface's curvature read as half. This is why a G2 boundary surface on a cylinder measured half the curvature it carries (#763). New tests hold both to finite differences for degrees 2 to 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * feat(kernel): G2 boundary surfaces against a body's face The network always carried the face's curvature across a G2 edge; the refusal came from measuring it with truck's halved surface second derivatives (fixed in the previous commit). EdgeFaces now reads the face's second fundamental form from the exact second derivatives instead of differencing the normal. A new test holds the curvature across a cylinder's edge to the cylinder's within 0.1%, also with a sheared far curve; G3 is refused (a network holds up to G2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * test(kernel): a boundary patch with straight corners measures its own area A stadium's arcs meet its lines at 180°, so the Coons patch is singular at its corners. From such a corner the reference mesher's boundary walk ran onto the B-spline's extrapolation past its domain (a planar spline passes through every point of its plane there), and the face measured 289 mm² for its 158.5 (#763). The vendored mesher's bounded projection (nearest_projection, #2043) keeps the walk on the domain; this holds it there, by the faces, the measuring mesh and the display mesh. The display path (#1653) was never affected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * feat(geom,kernel): three-sided boundary surfaces (one side collapsed to a point) A network curve may be a PointCurve: the apex where the two sides beside it meet. The curves through it cross it at the point itself, its row of the net collapses there, and the kernel's face leaves that side out of its loop (three edges, one vertex at the apex). One point per patch, as a side; refused elsewhere, when it moves, or with a continuity condition. Tests: a triangle and a quarter disc filled flat with their analytic areas (40 mm², 25π), by geom and by the kernel's faces and meshes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * feat(doc): boundary surfaces through curve networks and loops of three or four FeatureKind::SurfaceNetwork saves a network as `u` and `v` curves, each a sketch chain (planar or 3D), a chain of a body's edges with an optional G1/G2 continuity, or a point (the apex of a three-sided patch), and an `operation` that can join the surface into the body of its edges. A SurfaceBoundary of three or four sketch curves, refused until now, builds as the flat Coons patch of its loop (three collapse the side opposite the first curve). The format change is one pending file; feature-walk goldens record the new variant's sketches, bodies and points. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * feat(engine): surface.boundary through loops of three or four and curve networks The command keeps its loop form (two to four curves of one sketch; three and four now build the flat patch of the loop, crown refused there) and gains a network form: `u` and `v`, each curve a sketch curve id, a {sketch?, curves} chain (planar or 3D), a {body, edges, continuity?} edge chain (g1/g2 with the face beside it) or a {point} for a three-sided patch, with `operation` new or join. Edits may move between the two forms (timeline.redefine accepts the command now that it has a dialog). Tests: analytic areas of loop patches and of a hyperbolic paraboloid bounded by four 3D lines (every mesh vertex on z = xy/10), a loft across two sketches, G1 and G2 measured across a cylinder's edge with inspect.continuity (angle < 0.1°; curvature jump 1e-16 with G2 against 0.027 with G1), 26 hostile networks refused without panicking, and u/v added to hostile_params_never_panic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * feat(ui): Boundary Surface dialog Curves and Cross curves take sketch curves and edges (picks that meet end to end in one sketch or body are one chain); Continuity and Operation (New Body or Join). Two to four sketch curves of one sketch with nothing across are the loop patch; anything else is a network. Edit Feature brings either back (per-side orders, crown and stations the dialog does not show are kept). Strings in en, ja and zh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * docs: ROADMAP M8 and the bridge patch's notes for boundary networks (#763) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * test(oracle): a boundary surface through a loop, thickened (#763) Case 83: four sketch curves (a square's three sides and a half circle for its top) make one boundary surface, thickened 2 mm; analytic values from tools/oracle-analytic/cases_surfaces.py (V = 2A, area 2A + 2P, centroid by moments). Recipes gain boundary_surface, thicken and remove. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM * refactor: boundary surfaces, review cleanups Project onto the face once per derivative evaluation (the frame is passed to natural() and reused by scale()), keep each track's finite-difference step instead of rescanning its table, export the kernel's edge-pick and chain caps and the default station count for the engine, doc and dialog to share, map TooLarge spline errors to KernelError::TooLarge, reuse the engine's operation parser, and skip the dialog's sketch lookup when the picks are no loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGeCa5jWWdroMWvXxN3LLM --------- Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: bherbruck <brennen.herbruck@gmail.com> |
||
|
|
b04e0801d6 |
Per-command timings for script runs and batches (#1868)
Thanks @DuBearte. |
||
|
|
64966bab88 |
Implement the reviewed UI icon system and durable review workflow (#853)
Thanks @Nathan-Dane. |
||
|
|
bf4551159e |
Split Body and Combine Intersect keep their faces' sources, so sketches attach (#565) (#1732)
Thanks @SychPL. |
||
|
|
3087363c44 |
test: three ignored tests pass again and run in CI (#679, #562) (#1663)
Thanks @PhilippBischoff0. |
||
|
|
1a0b33fcf3 |
Headless pictures draw on the GPU, with the viewport's pipelines (CPU rasterizer as last tier) (#1555)
Thanks @jyviko. |
||
|
|
b3df2c382b |
snapshot --camera and saved views; grid: false / axes: false for headless renders (#1313)
solidcraft-cli snapshot takes --camera JSON and --view with a saved view name (through view.apply, as the MCP screenshot does), plus --no-grid and --no-axes; the MCP screenshot and ui.render take grid/axes, the headless render skips a hidden origin axis, and the app's ui.render follows the Grid and Origin switches. Closes #1245. |
||
|
|
1473893b08 |
MCP: a bridged server starts without the app and connects once it runs (#1298)
The bridged MCP server starts when no app is listening, says so in its instructions and in each tool error, and connects on the first call after the app starts. A batch that could not be sent says the app is not running. docs/mcp.md describes it. |
||
|
|
96356dc544 |
CLI snapshot takes --in; an unknown command suggests close ids (#1301)
snapshot starts from --in (a design or STEP file) with the script on top, as run does, and refuses options it doesn't take; an unknown command id names the closest registered ids. |
||
|
|
9eddb1cbd3 |
Preferences ▸ Graphics ▸ Display quality (Coarse/Normal/Fine/Ultra) (#1287) (#1319)
* Preferences ▸ Graphics ▸ Display quality: Coarse, Normal, Fine, Ultra (#1287) A viewing preference that sets how finely the viewport tessellates curved faces and edges: chord tolerance relative to each body's size (3e-3, 1e-3, 3e-4, 1e-4) and the most a facet may turn (30, 20, 12, 7 degrees). Normal is the tolerance the viewport has always used. Bodies keep a display plan per level, so switching is a re-plan the first time and instant after; the reference mesh the model reads (picks, holes, measuring) and exports are unchanged. Away from Normal the model scene builds edges, and faces on the CPU path, from the plan at that level, so silhouettes and edges get finer with the faces and a highlight still lies on the displayed triangles. The preference is saved with the others, set over the control channel (`ui.prefs` `display_quality`), labelled in en/de/ja/ko/zh. `solidcraft-cli bench-open --display LEVEL [--edit NAME EXPR]` times the plans at a level and after a parameter edit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Highlighted edges follow the display quality too Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
1ec33fcdc7 |
Extrude: a symmetric distance is the total thickness (#1260)
A symmetric solid extrude of 10 mm is now 10 mm thick, 5 mm each side of the sketch plane, and switching from One Side to Symmetric keeps the thickness entered. Under format 21 the extent records its convention; designs saved without it keep the per-side reading, so their geometry and parameters don't change. Fixes #1236. Co-authored-by: Karl-VonRichter <Karl-VonRichter@users.noreply.github.com> |
||
|
|
5c2fa3e9ca |
Action matrix regressions of #1255: knuckle rounds, thin holes, a 45° flange hole, an axis after an edit (#1280)
* Action matrix regressions of #1255: knuckle rounds, thin holes, a 45° flange hole, an axis after an edit - Curve blends: past the end of a curved edge the run of sections along the end tangent wrapped round the ring of centres; it is shortened while it still crosses the end face (the hinge knuckle's cap rounds at 0.728 mm). - Boolean retry guard: each body's volume is measured finer than its smallest radius, and a volume out of bounds is measured again ten times finer before it refuses (a 0.133 mm drill measured -30272 mm³; a plastic part's coarse mesh was off by more than the slack). - Sheet metal: a drill cap's certificate allows the evaluation noise its fitted tilt shows (a hole square to a 45° flange). - Construction geometry on a named face uses the face found by name, not a second pick at its nearest point (an axis through a corner round after a parameter moved it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Retry guard: measure the target, tool and result at one tolerance Measured at different tolerances, the chords' error on the faces they share didn't cancel: a blind hole in a long D-profile bar measured 20 mm³ more than the bar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Action matrix baseline from this branch's full run: 37 actions pass again, none fewer Blessed with cargo xtask action-matrix --from DIR --bless from the 16 shards of run 38673859774. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |