64bbfe9ed3402f2fb00a95a116e4d6531c54bb21
570
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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> |
||
|
|
683535a18f |
Evaluation: a pattern of another component's body follows its own component when that moves (#8467)
A pattern of bodies copies them about an axis in its component's frame, so its copies of a root body depend on where that component is placed. placement_digest never counted a pattern's bodies, so moving the component kept the cached copies. Read each body through placed_body, as Combine does. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f595f38e1c |
Define a named parameter inline from any value input (#4071) (#7341)
* claim: #4071 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Define a named parameter inline from any value input (#4071) Any value input, typed or sent as a command's expression parameter, takes `name = expression` (or `#name = expression`): the design gets the user parameter `name` with that expression, and the input stores `name`, in the command's one undo step. - doc: the lexer skips a definition's `name =`, so until the design stores it the text evaluates as its expression and commands read and check it like any value. `Document::define_inline` then turns every stored definition (feature inputs and placements, dimension parameters, sketch pattern and text values, joint and coupling values, sheet metal and plastic rules, canvas planes) into a user parameter, the unit following how the input reads a bare number. A taken, reserved or empty name, two different values for one name, and a definition in a parameter's own expression or a configuration cell are refused; all or nothing. - engine: `Session::execute` runs it after any command whose parameters hold definition-shaped text; the reply has `defined` (the first name, as `sketch.dimension` already gives) and `definitions`. A refusal fails the command, which leaves the design as it was. - `parameters.change` with `new = expression` renames the parameter it changes (a dimension's or feature input's own, references following) and sets it; when the value is just `new`, it sets `new`. `changes` refuses definitions. `expr.evaluate` reports `defines`. - UI: lengths keep the name when the design unit is applied; sketch text sends a definition as typed and previews only its value; the box corner and offset Distance 2 use the value; fields whose command keeps no expression (sketch scale, move, chamfer) refuse a definition with the way to name it. The dimension editor says which parameter it named. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
02ac56d12f |
Feature windows choose Join, New Body or Cut from what the material touches (#6901) (#6903)
* claim: #6901 * Feature windows choose Join, New Body or Cut from what the material touches (#6901) Extrude, Revolve, Loft, Sweep, Coil and the Box, Cylinder, Sphere and Torus choose their operation by running the Join on a copy of the design off the window thread and counting the pieces: Join when the material makes one body with what it touches, New Body when it would be a separate piece, Cut when it lies inside a body (Revolve and the four primitives; Extrude keeps its own Cut). The choice changes only when a check is in, a pick in the Operation row (the shown option included) stops it for good, and OK waits for a running check. Hidden bodies take no part: with some hidden, the shown ones become the feature's targets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Operation row: a pick in Extrude stops its own choice at once; ja/zh strings, gallery entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Operation check: contact test first, mesh volumes for Cut, OK takes the evaluated Join Material touching no body is a New Body without running the Join (the contact test costs 0-240 ms where the Join costs seconds on a large body). Inside is told from display-mesh volumes instead of exact ones (8 s on a 400-hole plate). The check evaluates the Join through Session::ahead, and OK of the same commands takes it (Session::prime) rather than computing it again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Preference: Choose the operation automatically (on by default) Preferences > Design gets "Choose the operation automatically" (auto_operation, on by default). Off, feature windows don't choose Join, New Body or Cut from what their material touches: each keeps the operation it opens with (Extrude its own Join or Cut), no check runs and OK doesn't wait for one, as before Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Arabic, Hebrew, Vietnamese and Turkish strings for the operation choice and its preference Arabic, Hebrew and Vietnamese are complete catalogs now, and Turkish has a full catalog, so this change's three strings get them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Operation check: a closed window's check stops; the icon audit doesn't choose A window's operation check kept running after the window closed, a Join on the design for nothing, and the test harness waited for it after every step: the icon audit, which opens every window, took ~30 min instead of ~1. The check now runs under a Progress, and closing the window (or one that doesn't choose) abandons it: its evaluation stops at the next feature and nothing waits for it. The icon audit turns auto_operation off, as it only looks at icons (75 s again). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Box placement test: the window keeps its New Body The test #6248 added places a box that overlaps Base and expects a second body; with #6901 the window would join or cut it. The test is about where the box goes, so it turns auto_operation off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Join pieces: read the target lists leniently 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> |
||
|
|
bcdee6e0bb |
Sketch on a face: a round's edges that end a hair apart still close (#8284) (#8386)
* claim: #8284 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Sketch on a face: a round's edges that end a hair apart still close (#8284) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Sketch on a face: test both ends of a rounded loft end to end (#8284) A square lofted to a circle with its side edges rounded, as in the report: a sketch on either end face takes the whole face. Without the fix the circular end fails with "face projection has a branched boundary". Also drops a redundant term from the join tolerance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
14acdc2a6d |
Render: one sRGB transfer function (#7161) (#7162)
* Render: one sRGB transfer function, geom::srgb, for the hand-written copies (#7161) Twelve places wrote the sRGB encode or decode formula out by hand (doc's glass recipe, engine's render library, glTF import, the PNG film, photographic and presentation output, the ray tracer's image, the stage, the surface decoder, texture normalisation and the theme's contrast check). They now call solidcraft_geom::srgb: encode/decode on 0..1 values, encode8/decode8 for 8-bit codes. render::surface::srgb8_to_linear stays as a re-export, so its callers are unchanged. Same results: the module's tests compare it bit for bit with the formula as the callers wrote it, over all 256 codes and a dense sweep of linear values plus the knees, out-of-range values, infinities and NaN, for each way the callers clamped (after encoding, before it, or not at all), and decoded values either side of the decode knee, where no 8-bit code falls. One change: glTF import encoded in f32. Over every f32 in 0..1, 218 of 1,065,353,217 values sit on a rounding tie that f32 got wrong and now give the neighbouring code (f64 gives the nearer one). Left as they are: render/job/image.rs (replaced by exact tables in its own change), the tests and the starter-pack validator that keep their own copy as an independent reference, and the WGSL shaders (they can't call Rust). Fixes #7161 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Tests: the sRGB codes of five callers that had no test of their output (#7161) The glass swatch, a library surface applied as a plain appearance, glTF's fallback for a colour channel that isn't a number, a stage panel and an empty pixel in presentation output each get an assertion with their sRGB codes worked out by hand. A planted wrong conversion at each is now caught by that test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
be2deb8c6f |
Create Sketch: a face of a combined Mirror's copy keeps its own attachment (#5779) (#8278)
A mirror's or pattern's copy of a face carries its seed's construction certificate, and on a combined body that certificate finds the seed's face. Capturing an attachment never checked that the certificate finds the picked face, so a sketch on the mirrored half sat on the original. The capture now falls back to the face's exact history name when the certificate names another face, as docs/face-attachments.md describes. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
cecb1d8b66 |
Naming: a long history of one body no longer overflows the stack on reorder (#7587) (#8159)
* claim: #7587 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Naming: name a long history of one body from the oldest up (#7587) A body's face names are worked out from the names of the body it was made from, recursively. After a few hundred features in a row whose names nothing asked for, reordering or moving an earlier feature re-evaluated them all and the first name lookup (a fillet at the end) recursed once per feature, overflowing the 1 MB window-thread stack on Windows. Name every 16th earlier version oldest first so no lookup recurses through more than 16 of them; the names are the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
9bcb2ffe68 |
Drawings: first landing from the drawings branch (#8249)
* Drawing sheets: sizes, the ISO 5457 border and its marks (#3875) (#5108) * Drawing sheets: sizes and the ISO 5457 border (#3875) A sheet is a paper size and an orientation: ISO A0 to A5, Letter, Legal, ANSI A to F, architectural A to E1, or a custom size (finite, above 0 and at most 5,000 mm a side), landscape by default and either way for every size. A border profile is the rule for its border, and layout() works it out for a sheet: the frame inside the margins, and the reference fields with their labels. The ISO profile has a 20 mm filing margin on the left and 10 mm elsewhere, a 0.7 mm frame, fields of 50 mm out from the centre lines with the corner fields taking what's left, rows lettered from the top without I and O (AA, AB and on past Z), columns numbered from the left, and an A4 sheet labelled on its top and right only. A profile can divide the frame equally instead, or have no grid. The records sit in geom, next to the section records, so saving, rendering and export can all use them. Nothing is saved or drawn yet: there is no command and no format change. Margins that leave no drawing space, values that aren't finite, fields outside 1 to 1000 mm, more than 200 equal fields and unknown JSON fields are refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing sheets: ISO 5457's centring and trimming marks (#3875) A drawing border profile now also holds the grid reference border and the centring and trimming marks, either of which can be left out. The ISO profile follows ISO 5457:1999 (read in its identical adoption, IS 10711:2001): - the grid reference border 5 mm outside the drawing border on every side, with the field labels between the two; - four centring marks on the sheet's centre lines, from the grid reference border to 10 mm inside the drawing border; - at each corner a trimming mark of two overlapping 10 x 5 mm rectangles, in the margin outside the grid reference border. The labelled sides are now a rule worked out for each sheet: ISO 5457's (the top and right of A4, all four sides of the others) or fixed sides. So one profile labels every size correctly. validate() checks what doesn't depend on the sheet, for when a profile is read; layout() calls it, then checks the rest against the sheet. Refused: - a grid reference border that isn't finite, is negative or is wider than a margin; - a centring mark that isn't above 0, would reach past the sheet's centre lines, or is on a drawing border those lines miss; - a trimming mark that isn't above 0, is wider than it is long, is wider than the margin left outside the grid reference border, or is longer than half the sheet's shorter side. The grid rule's JSON is now externally tagged ("none", {"from_centre": {"field_mm": 50}}), as the sheet size is, so an unknown field is refused in every form; the internally tagged "none" ignored one. Nothing is saved yet, so the shape change costs nothing. The names follow the glossary, and ISO 5457's "drawing sheets": the module is drawing_sheet (was sheet, which means sheet metal elsewhere here), DrawingBorderProfile and SheetLayout (were BorderProfile and BorderLayout), sheet_border and drawing_border (were paper and frame), and Sheet::size_mm (was paper_mm). The first part of S1 is still a draft, so the renames are made here rather than in a commit of their own. The extra centring marks ISO 5457 asks for on sheets larger than A0 aren't here yet. Still nothing is saved or drawn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing sheets: a lighter built-in border, the filing margin a choice (#3875) Cameron's decisions after seeing the sheet in the app, 2026-10-23: - No trimming marks in the built-in profile: the filled corner blocks take a lot of ink. trimming_mark_mm stays, so a profile can still ask for them. - Centring marks stop at the drawing border: from the grid reference border to the drawing border, never into the drawing area (on A4 they crossed the tables). centring_mark_mm keeps its meaning, how far a mark reaches inside the drawing border, and now takes 0, the built-in value, as grid_border_mm already takes 0 for "on the drawing border". A mark of no length (a reach of 0 with no grid reference border) is refused. - Margins of 10 mm all round. ISO 5457's 20 mm filing margin on the left, for drawings that get bound, is a named choice: filing_margin, off when not given. On, it stands in for margins.left_mm, which is kept, and still checked, for when it's off again. The 20 mm is FILING_MARGIN_MM, and validate() and layout() both take the margins from one helper, laid_out_margins(). A3 landscape is now 400 x 277 at (10, 10), with eight 50 mm columns. With the filing margin it is 390 x 277 at (20, 10) again, the same as a 20 mm left margin set by hand. A profile with all three choices on (ISO 5457's full border) lays out exactly as the built-in profile did before, and the tests keep the old hand values for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Drawing W23a workshop plate oracle fixtures (#4950) (#4962) * test(oracle): reviewer-aligned parameterized workshop plate fixtures (#4950) Independent analytic W23 expected values and seven verified models, including four R10 corners and the 2 mm tangent top chamfer. Document accepted Drawing states and commit regenerated docs/oracle.md from successful workflow run #29 (90/90 pass). * fix(oracle): correct W23 chamfer centroid and clarify drawing session ownership * Paper scene: plain records of what is drawn on a sheet (#4890 A1) (#5513) geom::paper holds what a sheet shows as plain data: groups of strokes and fills, each group tagged with the object that drew it (an opaque id) and its kind, with one validation pass over a bounded record count. Seg2's checks and the coordinate rule move into profile.rs so section and paper share them, and drawing_sheet takes its side and line limits from paper, so each limit is written once. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Drawing sheets: centring marks across the whole margin (#3875) (#5554) The built-in sheet's centring marks now run from the trimmed sheet's edge to the drawing border. From the grid reference border, as before, a mark was the same length as a grid field mark, and on A3 it sat on one (the sheet's centre falls on a field edge), so it no longer read as a mark once the grid reference border's outline is left out (Cameron, after the prototype on #3875). - DrawingBorderProfile.centring_mark_start: sheet_edge (the built-in's, and when not given) or grid_border (ISO 5457's figure 5); ISO's full border in the tests asks for grid_border. - A mark still needs a length: one that stops on the drawing border needs room outside it on the side it starts from, every margin for sheet_edge, the grid reference border for grid_border. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Drawing sheets: no centring or trimming mark longer than the largest sheet's side (#3875) (#6410) A border profile capped every length at 5000 mm (the largest sheet's side) but two: a centring mark's reach inside the drawing border and a trimming mark's length. A file could give either a huge whole number, such as 18446744073709551615. The read's number check passes whole numbers, so the profile took it as 1.8e19 mm, and saving wrote it as a decimal the next read refused: a drawing that saved but didn't open again. K2's fuzz test of drawing files (#3890) found it. Both now take the cap the margins have, `MAX_SIDE_MM`, in `validate`, so the file is refused when it's read. Layout's own checks against the sheet are unchanged, so a 5000 mm mark still validates and is refused only on a sheet too small for it. Tests: the hostile-profile test refuses 5000.000001 mm and 1.8e19 mm for each mark, and takes 5000 mm on its own; 4 planted faults (each cap removed or made one short) are all caught. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Bill of materials types: phantom, reference, purchased and inseparable (#3874) (#5107) * Bill of materials types: phantom, reference, purchased and inseparable (#3874) A component's bill of materials type is a part property (`bom_type` in its metadata, set with component.metadata.set and read by component.metadata, as part_number is), so older releases keep it and no format change is needed. It isn't a design property: the Design Properties dialog doesn't list it and document.metadata.set refuses it. A word this build doesn't know reads as normal and is kept. assembly.bom counts by type: a phantom has no row and what it holds counts where it is placed, in the same rows as the same parts there; a reference counts nowhere, and nothing inside it does; purchased and inseparable components are one row, and in parts only an inseparable component's purchased parts are listed too. Rows of one part number but different types are different rows. Rows and children carry bom_type. With no types set the rows are as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Glossary: bill of materials and bill of materials type (#3874) The bill of materials types are a new idea, so the glossary gets their term, with the five types, and "normal" gets its fourth meaning in the table of words with more than one meaning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Bill of materials types: a plain line for each (#3874) The guide's table and the glossary entry say what each type is for in plain words: something you make, something just to group, something to use as a reference, something you buy, something made as one piece. The names stay the five standard ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Bill of materials: kits fold together only when their contents' types match (#3874) With group_children, two kits with one part number share a row when what they hold reads the same. That reading (kit_key) compared each child by part number and count, but not by its bill of materials type, though rows themselves are told apart by type. So a kit holding a made bolt and a kit holding a bought one, both KIT, folded into one KIT x2 row listing the first kit's bolt twice: the other type was lost, and which one depended on creation order. 0xlillith found it in review of #5107. kit_key now includes each child's type. Equal part number, type and contents still fold. Test: two KIT kits each holding a BOLT fold into one row of two; once one bolt is purchased they are two rows, each listing its own bolt. Planted fault (the type left out of the key): caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Drawing files: a drawing saved as a container or as plain JSON, never read as a design (#3890) (#7098) * File format families: drawings share the design format's versioning (#3890) The format code works for a family of files: its own tag, its own numbers and its own folder of change files, with one reading of a file's format, one refusal of a file a newer build saved and one upgrade for every family. Designs (solidcraft/N) are one family and keep everything they had: FORMAT and FORMATS are as they were, and pending_names, format_string, version_of and read mean what they did. Drawings (solidcraft-drawing/N) are the other, with format 1 as their first record and each later change one file in crates/doc/src/drawing/format/pending/, as design changes are. Nothing saved changes. A design tag never reads as a drawing's or the other way round, and a file that names no format is a design from before format strings, never a drawing. Every refusal names its family; a design's read word for word as before. A design listing a pending change this build doesn't have is now refused as a newer build's before its content is checked, as a newer number already was, so a newer build's fields never read as damage. The list reader is take_names(v, key, noun), the shape #4811 uses for its own list. For the maintainer, the release step changes: scripts/fold-format-pending.sh now folds every family that crates/doc/build.rs lists (FAMILIES), each into its own next number: designs into crates/doc/src/format/v<N>/ as before, drawings into crates/doc/src/drawing/format/v<N>/ from 2. With nothing pending in a family it says so and moves nothing. Its test folds a drawing change into v2 beside the design changes. docs/releasing.md, CONTRIBUTING.md and AGENTS.md say so. build.rs lists each family's changes from its own folder, each folder's versions contiguous from its own base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing record: format 1 of the drawing family (#3890) A drawing is now a record of its own (crates/doc/src/drawing.rs): its name, the designs it draws (sources: an id and the design file's path, relative to the drawing's folder as a linked design's is), its properties under the design metadata's rules, its units (each design's own, or one length unit of the expression unit table), its content language (a BCP 47 tag) and its sheets. A sheet holds its paper, a copy of its drawing border's profile, the resolution its pictures are rendered at (300 dpi unless it says, 25 to 2400), the component it documents and whether it is left out of the sheet count or of printing. This is format 1 of the drawing family; each later kind of record adds one file in crates/doc/src/drawing/format/pending/. The rules: one id counter for every object, raised above the largest id when a file is read and never rewound; every reference is an id that must resolve, or the file is damaged and refused, never patched; 1 to 1,000 sheets, at most 64 sources, names of 1 to 256 bytes, paths of 1 to 4,096 bytes without NUL. The same drawing always saves as the same bytes. Drawing::from_json reads at most 16 MiB of text, then runs the family's format check, the number check, the upgrade, the typed record (unknown fields refused everywhere) and Drawing::validate. The number check is now one function every family calls, Family::check_numbers, told which field holds other tools' data; a design's refusals read as before. Nothing saves or opens a drawing yet: the container is the next step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing ids: random and collision-free from format 1 (#3890) A drawing's objects now take random ids, the form jyviko chose on #3890 from #1017: no counter, so objects added on two branches never share an id and never edit one line. The allocator is one module for drawings now and designs later (#626 Phase 3), crates/doc/src/ids.rs: an IdSource gives nonzero u64s by splitmix64 from a seed, each checked against the ids in use and drawn again when it is one, or when it is 0. A run never draws a number twice, so at most one draw per id in use comes before a free one, and a seeded run over a file the same seed made still gets a new id. IdSource::seeded gives the same ids for tests and replays; IdSource::from_entropy seeds a session from the standard library's hash keys, the time and a count, with no new dependency. In a file an id is 13 characters of Crockford base32, lowercase (0000000000001 to fzzzzzzzzzzzz): ids::encode writes it and ids::decode reads only that spelling, case-sensitive, so an id has one form to search for. Anything else, 0 included, makes the drawing damaged. The drawing loses next_id (a file that holds one is refused), and Drawing::new and allocate_id take the IdSource. Messages name ids as the file writes them. The component a sheet documents stays its design's own number until designs move over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing record: a drawing too large to reopen isn't saved (#3890) from_json reads at most MAX_DRAWING_BYTES (16 MiB), but to_json had no limit. Other tools' properties are kept as they came, and indenting them can grow a drawing read in at about 4 MB past 16 MiB (two million zeros in one array), so the next read refused what the save had just written. 0xlillith found it in review of #3891. to_json now returns a Result and refuses JSON longer than a read takes ("drawing too large to save (at most 16 MiB)"), so every drawing saved opens again. Nothing writes drawing files yet, so the error reaches the future file writer before it publishes anything. Test: that case is refused, and a smaller compact drawing saves and reopens unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing files: a drawing saved as a container or as plain JSON, never read as a design (#3890) K3 of the drawing storage plan (W11.2): the file a drawing is saved in. Nothing writes one from a command yet; opening and saving come with K5. - A drawing container is a design container holding `drawing.json` (Deflate, as `document.json`) in place of `document.json`, and `container.json` says so: {"content": "drawing", "format": "solidcraft-container/1"}. A design's `container.json` is as it was, with no `content`. The plain JSON form is the drawing's own text. Both give the same bytes every save, so a drawing can live in version control as text. - `io::file_kind` tells a design from a drawing by `container.json` or by the JSON's format. The design reader refuses a drawing ("this file is a SolidCraft drawing, not a design: open it as a drawing") and the drawing reader a design; plain JSON only asks when it isn't a design, so reading a design costs nothing more. A container's content this build doesn't know, or a drawing container that also holds a design's `document.json`, is refused. - `read_drawing` (bytes, either form), `read_drawing_file` (one seekable handle, the design reader's checks) and `write_drawing_container`; `DRAWING_EXT` (`scdwg`) and `is_drawing_path` beside the design's. - The container writer's set-up and finish, the file opening and the container sniffing move into one function each, which designs and drawings both use. The container's own checks (budgets, entries, the ZIP directory) are the design container's, word for word. Tests: a drawing round-trips through both forms byte for byte, and the container holds exactly `container.json` and `drawing.json`; `file_kind` on both forms of both kinds; each reader refuses the other's file; unknown content, a stray `document.json`, a missing drawing, an unknown container version and a damaged drawing refused; both forms from disk, and a directory refused; mutation fuzz of both forms (an error or a drawing, never a panic). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Paper scene: SVG of a sheet, its lines, arcs, cubics and fills (#4890 A3a) (#7032) The first export of a paper scene, as SVG first (jyviko and 0xlillith on #4890), from the research in the plan's §16. A3b adds ellipses, hyperbolas and Béziers above degree 3, which this refuses as "not supported yet". - `geom::paper::Prepared`: writers read a scene through `Scene::prepare`, which checks it first, so none reads one unchecked. Clipping goes there too, once (A8). - `geom::paper::arc_pieces`: an arc's ends in pieces of at most a quarter turn, the last its own end. A half turn drawn from its ends is ill-conditioned: rounded to the nanometre (six decimals of a millimetre) its centre moves up to 1e-2 mm, where a quarter turn's stays under 1e-6 mm. - `io::paper::paper_svg`: one user unit a millimetre, the size in mm on the root; y flipped by writing the height less y, so the file's numbers are page coordinates and an anticlockwise arc has sweep flag 0; lines `L`, arcs `A` (never large-arc), cubics `C`, parabolas `Q`; fills black and even-odd; one path per item; groups as `data-object` and `data-kind` (object ids can't be XML ids). No background, so cutters see only the marks. - Numbers are whole nanometres (six decimals of a millimetre): no exponent, no "-0", the same bytes every time. They are the writer's own state too, so a joint is written once and a closed path ends exactly on its first point. Numbers are written straight onto the document, with no text made per number. A width under half a nanometre is written as one, and a piece too short for the grid is merged into the next, both counted in the report; a path's last piece has no next, so it is kept however short (unless it has no length). Output over 64 MiB is refused. Tests: the A3 drawing border's whole document; quarter, 270°, clockwise and whole-turn arcs, and a circle of two halves giving the same four quarters; the quarter-turn boundary both sides; cubics and parabolas, and the conics refused; the number format; a closed path whose start and end round apart; a sliver merged; an open path's short last line and arc kept, and one of no length dropped; read back through our own SVG reader (lines exactly, the arc as an arc); the scene's JSON mutated into the writer (never a panic). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Drawing W17a: view definitions as data (#4816) (#4817) * claim: #4816 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views as data: named views, scales and the map onto paper (#4816, W17a P1) What a drawing view is, before anything draws it (geom::drawing_view): - NamedView: the six principal views and the isometric views from the four upper corners, each an exact basis (a Plane whose normal points back at the viewer), never taken from a camera, whose pitch clamp would tilt a top view, with no -0 to write out; `iso` reads as the front-right one. - basis_looking: any other view from its direction, an up and an origin (paper x = direction x up, paper y = x x direction), refusing a zero direction, an up along it, or an origin that isn't finite or within 1e12 mm. W07's {direction, up, origin} view reads through it. - Scale: paper : model as two positive numbers, read and written as "1:2", from 1:100000 to 1000:1; Scale::fit picks the largest ISO 5455 preset (50:1 to 1:10000) at which a view fits a space (W07's "fits the page" default), compared as size x paper <= room x model so an exact fit at a reduction isn't lost to rounding. - ViewFrame: a view's basis, scale and place on paper, the point of its plane at `centre` landing at `position_mm`. Its paper map moves the view's curves and their accuracy onto paper (paper error = scale x model error); `boundary` maps a box of its plane onto paper from its four corners. In geom, where Seg2 lives: - Similarity2 and Seg2::similar (new): scale, turn and shift a segment exactly, an arc staying an arc. Similarity2::new refuses a scale that isn't above 0 and works the turn out once, not per point; - Seg2::map_controls: a segment's control points mapped by any function. It was doc's sheet::map_controls; its four callers in doc use the method now, unchanged. CurveAccuracy::scaled gives a curve's accuracy at another scale. Tests: each named view's basis and viewer side, and the same bases from a direction and up; a 50 mm cube in every principal view at 1:1 and 1:2, and in isometric (edges 50 x sqrt(2/3), outline 50 x sqrt(2)); the view's centre on its position (W07's 100 x 20 front view on A3 at 2:1); scales read, written and refused; the fitted scale, an exact fit at 1:5 and ISO's smallest; no -0 in any named view's axes; an origin refused by its own message; hostile bases, centres and positions; every segment kind moved by a similarity, and the similarities refused; scaled accuracy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drawing views: the bottom view pinned, square near parallel, bounded scales and boxes (#4816) From DevonHope's review of #4817: - The tests pin all six principal views exactly. The direction-and-up test uses literal ups, so a bottom view turned half round now fails it. - basis_looking squares x to the direction before normalising. Near the 1e-9 threshold the normal was up to 8.8e-9 rad off; now it is about 1e-16. - Scale::fit fits nothing for a size or room that is negative or not finite. A size of 0 still sets no limit that way. - Each side of a scale is 1e-6 to 1e6, so a scale writes at most 49 characters. - ViewFrame::boundary returns a Result. It refuses a box that is inside out or not finite on paper, instead of dropping a corner. - paper_map, boundary and seg_to_paper say which coordinates they take. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Drawing W18 S2: title blocks as data (#3875) (#3877) * Title blocks: what a cell shows and where its text goes (#3875) geom::cell holds a title-block cell's content: parts of text and fields (component, drawing, sheet, revision or prompt, by key, with an optional unit and decimals kept as written for the resolver to check), at most 64 parts and 4096 bytes of text, with no control character but a line break. Beside it are a resolved value (live, overridden and drifted, or missing, with "-" for each part that couldn't be read and why), an override with the value it replaced, and the projection a drawing's views use (first or third angle), which the title block's symbol will read. A fit warns and never cuts: a count of characters, not bytes, with its own count for text in Chinese, Japanese, Korean or Yi characters. The cell text rule places a label and a value: the label's baseline 1 mm plus its cap height below the cell's top, the value box under it inset by 1 mm, one line centred in the box, and wrapped or several lines down from its top at the font's pitch, with a warning when the last falls below the box. Wrapping by width, width warnings and glyphs a font lacks need the text measured, so they wait for the paper scene's text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Title blocks: definitions and their place on a sheet (#3875) geom::title_block holds a title block's definition: its size (1 to 1000 mm a side), its outline and cell line widths, and up to 64 cells. Each cell has a snake-case name of its own, a rectangle measured from the block's lower-right corner, an optional one-line label with its cap height, and a value: text from cell content, with its cap height, alignment and fit, or the projection symbol, which reads the drawing's projection and is never fixed in the block. validate() checks a definition on its own, as when one is read: cells inside the block and not overlapping (touching is fine), label and value cap heights that fit, and the content's own limits. layout() puts the block on the drawing border's lower-right corner of a sheet, refusing one that doesn't fit, and gives each cell's rectangle, its label's place and its value box by the cell text rule. On A3 landscape a 180 x 54 mm block runs from (230, 10) to (410, 64); it fits A5 landscape and every larger sheet, but not A5 upright. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Cell text: a value box lies within the paper's coordinates (#3875) place_lines took any finite, ordered value box, but centring one far out (min x 1e308, max x 1.1e308) overflows: the anchor came back infinite, with no warning. 0xlillith found it in review of #3877. The paper scene already bounds every coordinate it holds by MAX_COORDINATE_MM (twenty times the longest sheet side). That limit is now public, and place_lines keeps its box inside it, so its anchor is always finite: one rule for what a paper coordinate may be. Tests: the hostile-box test refuses both overflow cases from the review and a box just past the limit on each side, and places lines in a box the size of the whole paper limit. The fuzz test's numbers now include values past the limit (1.1e5, ±1e308). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Title blocks: padding from the lines' inner edges, one label rule, nothing unread (#3875) A cell's text is padded from the inner edge of its lines: each side of a cell moves in by half the line drawn on it (the outline's on the block's edges, a cell line's inside), so a wide outline never covers the text. Before, the padding ran from the line's centre. The label's one-line rule lives with the cell text rules (`cell::check_label`), where parts lists will find it. The cell types nothing read yet (`Override`, `Resolved`, `State`, `Problem`, `Reason` and `MISSING`) wait for the resolver that will read them. The tests check the exact thresholds inside the lines (a label that leaves no room, a value that just fits), pick each of the lines, alignment and wrapping on their own so every combination comes up, and lay fuzzed blocks out on every standard sheet, either way, with and without the filing margin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Title blocks: the drawing border's line, descenders, room where the block sits (#3875) From DevonHope's review of #3877: - Each cell's lines are clamped to the inner edge of the drawing border's line. That line runs along the block's right and bottom edges, and along any other edge it reaches, as when the block fills the border. Aabb2::intersection, the 2D twin of Aabb3's, does the clamping. - layout checks each cell's room again where the block sits (place_cells, which validate runs at the origin), so rounding at the real corner can't turn a cell inside out. - The cell text rule counts descenders, at 3/10 of the cap height (ISO 3098's lettering B). They may reach into the padding under a value box, never past it to a line. place_lines warns Height when they would, and validate asks it whether one line fits. - The module doc no longer links to a private function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Drawing W06a: exact orthographic hidden lines for the analytic subset (#2455) (#2457) * Drawing W06a: exact orthographic hidden lines for the analytic subset (#2455) crates/geom/src/hlr (L0): prepare once per body, then hidden_lines for a scene of placed bodies. Edges and face silhouettes are projected from their exact curves, split where projections cross, and each piece is classified by rays toward the viewer against the trimmed faces: visible, hidden or explicitly uncertain, never guessed. Planes, cylinders, cones, spheres and tori are supported whether stored as analytic records, revolutions or spline patches; freeform faces are reported and make what they could hide uncertain. Screen geometry is Seg2 with the W01a accuracy vocabulary: exact lines and conic arcs where the projection is exact, bounded chords otherwise. docs/drawing-hlr.md holds the contract and its limits. * geom/hlr: handle the brep records main gained in #3093 Main's exact model storage (#3093) added Curve::SurfaceIntersection, Surface::PlaneThrough and Surface::PlacedRevolution, and the HLR matches on the records no longer compiled. A plane through three points is a plane: it is trimmed and intersected as one, and a box stored that way draws the same bits as one with axis-stored planes. The procedural intersection curve and the placed revolution (whose affine placement may scale it unevenly) are refused by prepare as not supported yet, until the kernel adapter handles them. The records' positions move with the body's centre like the others. * geom/hlr: pad plane faces' boxes, so a plane record off by rounding still hides Plane faces took the box of their boundary chords unpadded, flat along the normal. When the plane record and its edges disagree by rounding (a unit cube's top plane one ulp above its edges, a 100 mm cube's 1e-11), the ray toward the viewer reached the plane just outside that box, the slab test culled the hit, and the back edges came out Visible with no doubt. Every face's box is now padded by 1e-6 of its size, as curved faces' boxes already were. Reported by DevonHope on #2457. * geom/hlr: limits from review: trim samples, scene extent, crossing pairs, surface groups From DevonHope's review of #2457: - Options::trim_samples must be 1 to MAX_TRIM_SAMPLES (4096). - Placed bodies must stay within MAX_COORDINATE (1e12 mm, as section and brep bound stored numbers). Placements 1e200 apart made the scene's size infinite and every tolerance taken from it with it, so everything came out Visible. - The crossing search counts its candidate pairs before it starts and meets each pair only in the first grid cell the two segments share, instead of keeping a set of the pairs met, which could outgrow wasm's 4 GB before the 500 million pair budget tripped. The same pairs in the same order. - prepare groups faces on one quadric or torus by comparing each face with the faces of its kind whose size agrees to the tolerance (sorted), not with every face; at most 50 million comparisons. prepare_cancellable polls a cancel callback between edges, faces and comparisons. * geom/hlr: boundary chords on a grid, and no fine pass over coincident curved chords The cost items of DevonHope's review of #2457: - Every ray hit asked how far it lies from its face's boundary by scanning all of the face's chords (4096 per circle; a plate's face with 256 holes has about a million). The chords are now bucketed on a uniform grid over the boundary's box, cells at least as long as the longest chord, and the test looks only at the cells around the point. It finds exactly the chords the scan finds. - Chords of two curved curves that lie on each other end to end (aligned holes seen along their axes) were cut into 16 by 16 pieces and intersected, to find crossings that are only noise within the curves' tolerance. They are now skipped; visibility changes where a coincident run starts or ends, and chords that only partly overlap still find those. - Fixtures: a plate with holes, coaxial cylinders seen along their axis, and 300 placements. * geom/hlr: pad boxes by the body's coordinates too; coincident chords only to rounding Review of the previous commits found two holes: - The padding grew with the face's size, but rounding grows with where the body was modelled: a 0.001 mm cube 1e7 mm out, its top plane one step (1.9e-9 mm) above its edges, still had its hit culled. The pad now adds 1e-12 of the body's offset. - Two chords were taken for coincident when their ends lay within each other's sag, which in a coarse scene can hide real crossings: an arc can bulge across a line 1 mm off its chord twice. Only chords that coincide to rounding are skipped now; identical projections, the costly case, still are. * geom/hlr: coincident curves meeting at shared sample points do not cross Timing the review's scenes showed that skipping coincident chords was not enough: chords of two coincident curves also touch end to end at every sample point they share, and each touch was a crossing to refine and split at. 64 coaxial cylinders seen along their axis gave 8.3 million crossings (19 s), 64 cylinders one behind another along the line of sight 4.2 million (214 s; before these commits the crossing budget refused it). A touch at a shared sample point is now dropped when the two curves also coincide, to rounding, on both sides of it. Where a coincident run starts or ends one side differs, and the touch is kept. * geom/hlr: the own-face margin allows for rounding where a body was modelled The far 0.001 mm cube of the previous commit showed a second effect of records rounded at large coordinates: its top plane, one ulp (1.9e-9 mm) above its edges, hid the top edges themselves, because a ray leaving an edge met its own face 3.2e-9 mm along, past the own-face margin of 1e-6 of the face (1.4e-9). The margin now also covers 1e-14 of the body's offset (about 45 ulps of its coordinates), which only matters for parts far smaller than their distance from the origin. * geom/hlr: no parity test for a hit on the boundary, where it is uncertain anyway * docs/drawing-hlr: the fixtures of the review's second round --------- Co-authored-by: MateuszSychXpl <151755914+MateuszSychXpl@users.noreply.github.com> --------- Co-authored-by: CamWight <91156642+CamWight@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Benny1496 <163034806+Benny1496@users.noreply.github.com> Co-authored-by: Mateusz Sych <151755914+SychPL@users.noreply.github.com> Co-authored-by: MateuszSychXpl <151755914+MateuszSychXpl@users.noreply.github.com> |
||
|
|
b86c75544e | Appearance: read the look chain and replace a look everywhere in one undo step (#6428) | ||
|
|
0b2efd60b9 | Render browser: scene tree with Environment, Lights, Shots and Objects rows, resolved appearances and a Browser selection (#6427) | ||
|
|
54f613e4dd |
Preserve linked component materials and appearances (#7609) (#7616)
* Fix linked component materials and appearances (#7609) * Linked components: the cached link read carries the source properties Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update Links: a link without recorded inherited properties is read again Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Preserve authored linked-face overrides and apply cached source properties --------- Co-authored-by: bherbruck <brennen.herbruck@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
9fb41f8378 |
feat: Start a new selection's preview without waiting for the obsolete one (#7167) (#7261)
- Leave the running preview behind when the selection moves to another setup, asked to stop - Keep at most two obsolete previews running; streaming, tools and other inputs wait as before - Keep no result of a cancelled watched evaluation in the shared evaluation cache - Test the detaching, the cancel reaching the spawned job, and the cache guard Co-authored-by: P'tite Tête <asso@ptitetete.com> |
||
|
|
2cdfe050db |
Extrude to Object: a Join leaves the body it runs to alone when that body is in another component (#7975)
#6471 joined the body a To Object extent runs to into the tool, whatever its component. A connector's boss extruded up to an enclosure's face (each in its own component) merged the enclosure into the connector, and features referencing the swallowed body failed after it. The body it runs to now joins only when it is in the feature's own component, or when the feature names it as a target. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
03d0342469 |
Release 0.25.0: version bump, design format 41 (#7916)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
7fad8dbec0 |
Fix feature creation at timeline end (#7620)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
ca75f86947 |
Sketch: deleting a dimension in a rolled-back history no longer rebuilds the features after the marker (#7253) (#7425)
* claim: #7253 * Sketch: deleting a dimension in a rolled-back history no longer rebuilds the features after the marker (#7253) The check before a delete evaluated the whole history twice when the timeline was rolled back. Removing a sketch constraint changes the later features' cache keys, so on a long history Delete on a dimension took minutes. When the design differs only in sketch constraints (and model parameters nothing uses any more) and each changed sketch solves to the same geometry, profiles and ends, the features after the marker see the same inputs: compare the live models only. Anything else still gets the full check, so the report is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
d1398e2c52 |
Evaluation: keep a sketch's frame bodies across evaluations that move nothing (#7814)
A sketch on a face of a placed component is evaluated in that component's frame, so the evaluator moves (and meshes) the bodies placed differently into it. FrameBodies keeps those moved bodies, but every evaluate started a new generation and dropped what neither it nor the evaluation before it used. Evaluations that reuse every result never touch the cache, so two of them in a row emptied it: Delete refreshes the model three times (selection.delete's nested refresh, its own, then execute's), and the confirmation's dry run more, and an undo answered from the cache is another. The next edit of the sketch then moved and meshed every placed body again: in a design of ~3,500 imported bodies each sketch edit after a Delete took 46 s, 34-43 s of it tessellation. The generation now starts on the evaluation's first use of the cache, so an evaluation that moves nothing leaves it alone. It still holds at most two generations of moved bodies. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
98abb249c4 |
Cylinder: place by distances from reference edges, like Hole (#6380) (#6381)
* claim: #6380 * Cylinder: place by distances from reference edges, like Hole (#6380) A Cylinder standing on a flat face can take up to two straight edges of that face as references, each with the distance of its base centre from the edge's line, measured in the face's plane, as a Single hole does (#37). `solid.cylinder` takes them as `references: [{edge, distance}]` with a numeric `base`; the edges are found again by their persistent names, else their points, so the cylinder follows them when the part changes, and each distance is a parameter (an input of Inspect Feature). A cylinder without references stays at its base, as before. In the Cylinder window, started on a picked face, Reference 1 and 2 take the edges, each with its Distance measured from the pick, so it works with the mouse alone; the canvas shows each distance with a box to type it in, and Edit Feature picks the edges again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Cylinder: Edit Feature shows each reference edge input once (#6380) A face selected when Edit Feature opened the window had already added the reference inputs; the edit added them a second time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Cylinder references: the measured-once cost test's cylinder has none (#6380) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Cylinder: pick the face it stands on in its window, then the edges (#6380) The Cylinder window took its place only from a face selected before it opened, so started first it stood at the origin and offered no reference edges. It now has a Face input before Reference 1 and 2, as the Hole window does: start Cylinder, click the face, click the edges, OK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Glossary: reference edge, and "Reference" among the words with more than one meaning (#6380) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Cylinder edge references: the Cone dialog (#6250) gets the references field too The Cone primitive landed on main after this branch began; its dialog initialisers lacked the `refs` field the Primitive kind gained here. The dense form check for Cylinder fills only its fields: its face and reference edges place it, which the reference tests cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Cylinder: declare references in its contract; reference-placed cylinders are not placement-independent 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> |
||
|
|
38820658fa |
Body appearance replaces imported STEP face colours (#5769) (#5775)
* claim: #5769 * Let body appearances replace imported STEP face colours (#5769) A body appearance assigned in the design now replaces the face colours the body was imported with; face appearances set in the design still win over it. |
||
|
|
d14dbe5e39 |
Move: a copying Move can be edited from the History (#7741) (#7761)
* claim: #7741 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Move: a copying Move can be edited from the History (#7741) Editing a feature runs its command on a scratch session with the marker right after it. For the last feature that marker sits at the end of the timeline, and place_feature pushed the new feature after it, rolled back, so a copying Move found no copies and refused the edit. A marker right after the last feature now moves on past a feature added there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
98658142c0 |
Delete: deleting one instance of a component takes its joints with it (#7749) (#7782)
* claim: #7749 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Delete: deleting one instance of a component takes its joints with it (#7749) Deleting an occurrence while its component had other instances dropped only the occurrence: the joints on it, their motion links, joint origins, contact set places and exploded moves stayed, so a joint stayed in the Browser naming an occurrence that was gone. The clean-up that remove_component_tree did is now Document::remove_occurrences, used by both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
d245541075 |
Reuse placement-independent model results (#6525) (#6527)
* claim: #6525 * perf(eval): reuse local geometry across placement changes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(engine): preserve recovery journal through shared refresh The shared evaluator retains the document Arc, so refresh and body-name pinning can copy it after command_done recorded its address. The next read then mistakes that copy for an outside edit and discards the replay. Record completion after refresh, name pinning or failed-command restoration. Add a minimal journaled box/inspect regression in the existing crash suite. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
388266ca37 |
Rename: an imported body with numbered siblings is renamed without evaluating (#7274) (#7277)
* claim: #7274 * Renaming an imported body with numbered siblings evaluates nothing again Since #2467, Model::rename_body evaluates the design whenever another body's name is worked out from the renamed one's (`X (2)`). Every STEP import whose solids share a label has such names (`Part`, `Part (2)`, ...), so renaming one of its bodies re-read the import and meshed every body again. body.rename keeps the names of a body's siblings and of later bodies named after it, so for a body no later feature changes (the same mesh from the feature that made it to the end), renaming it in the model gives the names evaluating the renamed design gives. That case is followed again, as before #2467; bodies later features change still take #2467's checks. |
||
|
|
17339cf65c |
Redefine: the features after the edited one are computed once (#7076)
timeline.redefine evaluated every later feature in its trial session, then again in the session: the evaluation cache keeps only the last few states of a design with large bodies, so the trial's results were gone by then. The trial keeps them in the session's kept results (or its own), and the session's evaluation takes them from there. EvalCache::with_budget gives tests a small cache. |
||
|
|
dc32cff620 |
Release 0.24.1: version bump, design format 40 (#7653)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4afd93331f |
Patterns: a body of a moved component is copied where it is shown (#4763) (#4969)
* Patterns: a body of a moved component is copied where it is shown (#4763) A pattern of bodies made outside the bodies' component (a screw's body patterned from the root) moved each body's stored geometry, which is in its component's frame, by transforms in the pattern's frame. The copies landed where the body sits before its component is placed: near the origin, for every pattern kind. As Mirror does, each copy is now moved as the pattern moves the body in the world and kept beside its source, in its component. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Pattern test: unground the placed component before moving it Upstream now grounds a design's first part when it is made. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3ad5a360f2 |
Engine: keep the model and placed world across appearance-only edits (#7396)
Evaluation and placement never read appearances, yet an appearance edit re-evaluated the model and placed every occurrence again. A whole-document proof that only appearances changed now takes the existing render-only refresh, which keeps the model and retargets the world-placement cache. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
4e07b6c4b7 |
Assembly: name placed bodies without rescanning the design (#7380)
Naming a placed body scanned every occurrence and body of the design, so the world state and every caller naming all placed bodies grew with bodies times design size. WorldNames indexes the design once and names each body in time proportional to its occurrence path; one naming routine serves both it and the single-body scan. Names are unchanged (a test compares them with the scanning implementation). Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
622a392a83 |
Extrude to Object: a Join extrude also joins the target body (#6424) (#6471)
* claim: #6424 * fix: a join extrude also joins the body it targets (#6424) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e8eb7ee11a |
Components: copy and paste bodies and components between designs and components (#3390) (#3390)
Squashed for the rebase onto main. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
56bcd872cb |
Cone primitive: solid.cone with base and top radius (#5641) (#6250)
* claim: #5641 * Cone primitive: solid.cone with base and top radius (#5641) A cone or truncated cone placed like the cylinder: base centre, axis, base radius (or diameter), top radius (0, the default, is a full cone) and height, with the new body / join / cut / intersect choice. It is built from what the kernel already exposes, a revolve of its half section about +Z through the origin, moved into place. Toolbar entry after Torus, a Cone dialog that also places it on a picked face, Edit Feature, a timeline icon, pending UI strings and attribution, and one pending design-format change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f077f48318 |
Sketch: a changed length dimension keeps its start point, so a side grows from its first corner (#6070) (#6139)
* claim: #6070 * Sketch: a changed length dimension keeps its start point, so a side grows from its first corner (#6070) Changing a dimension's value re-solved its sketch as the smallest move from the stored positions, which splits the change between both ends: a rectangle side set from 40 to 60 mm grew 10 mm each way. parameters.change now first solves a sketch whose length dimension (distance, horizontal or vertical distance, line length) the parameter drives with that dimension's first point held, and stores the result, so evaluation has nothing left to move. Where holding it can't solve (a symmetry moves both ends), evaluation solves as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
bd44f6f496 |
Reference features by id everywhere: Pattern/Mirror seeds and construction planes (#1134) (#6858)
* claim: #1134 * doc: key pattern/mirror seeds and construction planes by feature id (#1134) * engine: resolve seed names the way evaluation did; keep timeline.edit name input (#1134) * fmt/clippy cleanups (#1134) * ui: resolve construction-plane names by feature id in plane_description (#1134) * fmt: sketch_attachment_ui after rebase adaptation * engine: timeline.add resolves legacy name-keyed seeds and plane names (#1134) * chore: re-trigger CI (GPU runner timeout flake) * doc: replayed_sources walks id-keyed pattern seeds (rebase adaptation) --------- Co-authored-by: Dahak Builds <dahakbuilds@users.noreply.github.com> |
||
|
|
0b2d3ecd44 |
Release 0.24.0: version bump, design format 39 (#7394)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
64ba396c05 |
Part properties: one table of keys (#4784) (#4786)
* claim: #4784 * Part properties: one table of keys, each with its scope, check and label (#4784) SolidCraft's part-property keys (project, part number, revision, author, organization, description, licence) were declared once but listed again by hand in each command, error, dialog and window. They are now one table, metadata::KEYS: each row has the key, where it may be set (Scope: the design, a component or both), how its value is checked and the message id of its label. A new key is one row. Metadata::set is told whose metadata it changes (Owner::Design or Owner::Component), and a key is taken where its scope covers that owner. is_well_known, both set commands, document.metadata, component.metadata, the refusals, the Design Properties dialog and the Bill of Materials window read the table; the hand-written lists are gone (WELL_KNOWN, the label match whose fallback named any unknown key "License", the window's three labels). metadata::BOM_KEYS names, in column order, the keys a bill of materials lists for each part: component.metadata returns them, component.metadata.set takes each as a parameter of its own and the window edits them; a test keeps each one a row of the table that a component takes. Free properties use the keys' text rule (metadata::check_text) instead of a copy of it. The params docs point to document.metadata's properties instead of repeating the keys. Every key accepted before still is, on the design and on a component. Two things change: - a refused key or a full metadata on a component says "part property" ("`bogus` is not a part property: …", "part properties are limited to …"), not "design property"; - changing the design's own properties no longer evaluates the model. The fields that change no geometry are named once, Document::with_part_properties_of: the design's metadata, and each component's metadata and free properties. It compares them first and copies the design only when one differs, as before. The shortcut is for a session's own edits only. A command that gives the session another design (doc.open, file.new, doc.recover: through Session::replace_design, which now counts them) is refreshed in full, however little the new design differs from the one before, so its joints are solved and its occurrence state pruned. Before, opening a design that differed from the open one only in render settings or component properties skipped that; with the design's properties in the list it would have for two revisions of one part too. Tests: the table (one row per key, the dialog's order); the bill of materials' keys (rows a component takes, in column order); each scope on each owner, and refusals that name the owner (the empty key, an unknown key, a 256-byte key shown cut); the text check at 4096 bytes, line breaks, tabs and control characters; hostile keys and values refused without a change; only-part-property changes in each scope, and changes beside them (units, a component's name, an added, removed or swapped component); document.metadata.set, remove, undo and redo evaluate nothing; opening a revision that differs only in its author solves its joint; the component wording, the shortcuts and the limits; the dialog's and the window's labels from the table. What the tests can't reach: every row is Scope::Both, so a known key refused for its owner (the wrong-owner branch of check) can't happen yet. It becomes live with the first single-scope row, bom_type, a component-only key. Left for later (not this topic): - Metadata::others() ignores scope, so a component-only key stored on the design would be neither a dialog field nor listed under other tools' data. It matters from the first single-scope key (bom_type). - assembly.bom's rows, its CSV columns and the window's grid headers still name the three keys by hand; the bill of materials module's rewrite will read BOM_KEYS. - The bill of materials types (P1, #5107, into drawings) still use WELL_KNOWN and the two-argument set: once this is on main, bom_type is rebuilt on it as one KEYS row with Scope::Component, set through Owner::Component. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
2863b80574 |
Sketch: 3D arc command (#5681) (#5682)
* claim: #5681 * sketch: exact circular arcs on drawn 3D wires (#5681) Add WireArc (centre, unit normal, radius, start/end) as an optional analytic form on drawn 3D sketch wires, with arc_from_3_points, arc_sweep and sagitta-bounded arc_polyline; add_drawn_arc_in stores the arc, its three defining fit points and its samples; move_drawn_point re-derives the arc atomically and refuses collinear points; validate_wires checks saved arcs. * engine,ui: sketch.arc3d exact 3D arc command (#5681) sketch.arc3d draws an exact circular arc through three world points in a 3D sketch, stored analytically beside its fit points and samples; sketch.move3d rebuilds it, sketch.inspect reports centre/radius/sweep; placement mapping (map_wire, now shared with the engine's world state) transforms the arc. One pending design-format file records the new field. The viewport's 3-Point Arc tool draws a 3D arc when clicked off the sketch plane, with a live arc preview; the SKETCH panel offers sketch.arc3d. * ui,engine: 3D Arc button starts an interactive tool (#5681) sketch.arc3d now maps to a Draw(3) tool handled by sketch3d: three world clicks (start, end, through - same order as the 2D arc tool) run the command, with the live arc preview and snapping. The command is only enabled while a 3D sketch is open, so the toolbar never offers a tool that could only fail. Locale labels for the command. * ui: cargo fmt --------- Co-authored-by: RayGalt <RayGalt@pm.me> |
||
|
|
47285ccb88 |
Thread: right- and left-handed direction (#4414) (#4415)
* claim: #4414 * feat: persist right and left thread handedness (#4414) * fix(thread): verify handedness with referenced holes and complete locales * test: verify handedness with merged tapped thread catalogues * test: retain tapped thread depth when changing handedness (#4414) * test: restrict Unix symlink coverage to Unix targets * test: inspect hole thread depth inside edit command parameters (#4414) * test(doc): initialize cylinder radius in handedness fixture |
||
|
|
13cd45d1f1 |
Apply complete feature transactions off the window thread (#3133) (#3135)
* claim: #3133 * Apply complete feature transactions off the window thread Evaluate dependent history and prepare reference and GPU display caches before accepting a guarded result. Preserve the evaluated original model for safe editor cancellation and journal only accepted commands. * fix(ui): preserve original marker across sketch-to-feature edits * test(ui): verify edit-sketch cleanup and guard Unix link fixture * test(ui): fix texture disposal and unreachable assertion in feature tests * fix(build): compile CLI link inspection only on Unix |
||
|
|
2755c9ccfb |
Pin auto-generated body names (#6402) (#6403)
* Pin auto-generated body names Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Fixed body counter Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Fixed formatting Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Altered test behaviour to reflect new pinned body names Co-authored-by: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
e063a7778e |
Axes and points from circular edges and round faces (#3128) (#4610)
* Axes and points from circular edges and round faces
In 3D, a round edge or face stands for its circle wherever a command
takes an axis or a point.
Revolve, Surface Revolve, both Circular Pattern dialogs, Plane at Angle
and Move -> Rotate take a circular edge (through its centre, along its
normal) or a cylinder, cone or torus face (its axis). The features keep
the pick as a model reference, so they follow the model when a parameter
moves it. Straight edges work as before; flat faces are refused.
Every 3D point input takes a circle's centre: construction points (which
follow the circle), To Object, patch points, hole placement, and Move's
pivot and points. Hovering shows the axis as a dashed construction line
or the centre as a star, and the dialog's chip names what the pick
stands for ("centre of edge 10", "axis of face 3").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Format the round-pick hover check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Selection chips: name a round pick as a circle centre or axis
The chip has room for little more than the body and a word or two:
"Shaft · circle centre", "Shaft · circle axis", "Shaft · face 2 axis",
and "Shaft · point" for a point of the model.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Move: a circle's centre in a placed component is where the component shows it
Move's pivot and points read a picked circle from the model in its
component's own frame, while the pick is in the world. They now read it
from the world state (and, editing a Move, from the state before it,
placed the same way), as the viewport and the other round picks do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Plane at Angle on a planar face about a model edge: test that it follows both
Upstream #1956 made a planar face a base for Plane at Angle; this branch makes a model edge an
axis. The rebase keeps both in one PlaneRef::AtAngle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
3bcf77ee32 |
Expressions: a number and its unit are one value (10 mm / 2 mm is 5) (#6331)
* Expressions: a number and its unit are one value (10 mm / 2 mm is 5) A unit written after a number was multiplied in at the precedence of `*` and `/`, so `10 mm / 2 mm` was (10 mm / 2) mm = 5 mm² and `90 deg / 1 rad` a value in angle², reported as a unit error. The number now takes the unit after it before `*` and `/` apply; a fraction of numbers before a unit stays one value (`1/2 in` is half an inch), and an exponent stays a plain number (`2^3 mm`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Expressions: after a division, a fraction before a unit only when closed up `width / 10 / 2 mm` read the `10 / 2 mm` as the fraction 5 mm and gave width / (5 mm) = 8 instead of (width / 10) / 2 mm = 2. After a `/` the fraction rule now needs the fraction written without spaces (`1 in / 1/2 in` is still 2); elsewhere `1/2 in` and `10 / 2 mm` are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4d06daf87b |
Patterns: one before the feature it copies follows that feature's parameters (#6726) (#6727)
* Patterns: one before the feature it copies follows that feature's parameters (#6726) A pattern or mirror of features made with the timeline rolled back comes before its sources and replays them from their definitions. Its fingerprint chained only the features before it and its own inputs, so a change of a source's parameter left its result in place: the box grew, its copy kept the old length, also after rolling forward. The chain fingerprint of a pattern or mirror of features now also takes the fingerprint of each feature it replays (and of their sources, for a pattern of a pattern), wherever they are in the timeline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Patterns: a test for a later feature taking a deleted source's name (#6726) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Patterns: fingerprint the replayed sources with the document, as fingerprint now takes it (#6726) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e6fb3793dc |
design: a whole-boundaries loop loads in any curve order (#6499) (#6516)
* claim: #6499 * Design: a whole-boundaries loop loads in any curve order (#6499) --------- Co-authored-by: Framewrk CI <ci@framewrklabs.ai> |
||
|
|
82cd5cc52e |
Sketch Dimension: value box in the document's units (#3812) (#3878)
* claim: #3812 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SBN24y2TcqRcm2zn8Gkj27 * Sketch Dimension: value box in the design's units (#3812) A dimension added without a value restated what it measured as "<value> mm", whatever the design's units. In an inch design the Dimension tool's value box therefore opened at "25.4 mm" next to a dimension whose text read 1.000 (inches). Document::design_length writes a measured length in the design's units ("1 in"), with enough decimals to keep it to the micrometre, so a dimension that restates the geometry still moves nothing. The Dimension tool, AutoConstrain's dimensions and Toggle Driven (making a driven dimension driving) use it. Millimetre designs are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SBN24y2TcqRcm2zn8Gkj27 * Move the design-units dimension tests into sketch_ux_tests (review) The #3812 tests go in the existing sketch dimension test file rather than a new file of their own (AGENTS.md, #3226). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SBN24y2TcqRcm2zn8Gkj27 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
cd66495e14 |
Preserve plastic rules and hidden bodies through renames (#4421) (#4425)
* claim: #4421 * Fix body metadata and visibility across renames (#4421) |
||
|
|
daecea6edf |
Evaluation cache: charge each state only for the bodies it made, so setting a parameter back restores (#6897)
The evaluation cache's 64 MB budget charged every cached feature result the whole model, though a state shares every body it did not change with the state before it. A design whose model is a few MB kept only its last few dozen results, so setting a parameter back recomputed what had dropped out. Each result is now charged for the bodies and sketches it does not share with the state it started from. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
710b7a664e |
Save a mesh larger than the design file once it is compressed (#6600) (#6701)
* claim: #6600 Co-authored-by: Cursor <cursoragent@cursor.com> * Save an imported mesh that only fits after compression (#6600) The design file limit was applied to the mesh before Deflate, so a mesh that had already loaded could not be saved or autosaved. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: validate and version large mesh saves (#6600) --------- Co-authored-by: Colin Faulkingham <colinfaulkingham@Colins-Mac-mini.local> Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
fa961eaa31 |
Sheet metal: a pattern of a cut made in the flat is kept like the cut (#6841) (#6853)
* claim: #6841 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PsiqyXWBFGTCX9J51bhysc * Sheet metal: a pattern of a cut made in the flat is kept like the cut (#6841) A rectangular, circular or path pattern of an extrude cut through sheet metal was refused ("this sheet machining cannot be preserved in its flat material"), though the cut itself is kept as a cut-out of the flat pattern. The pattern replayed its copies through the generic boolean, whose sheet check refuses any change the sheet model can't keep; the cut goes through the sheet's flat machining first. Each copy of an untapered extrude cut is now machined into the sheets the same way, in its moved sketch plane (a moved copy keeps the extrude's prism certificate), and then cut from the other targets. A copy that meets a folded bend is refused as the cut is there. Mirrored copies (the sketch plane turns over) and patterns of an intersect (which cut with the union of their copies) keep the generic path. Fixes #6841. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PsiqyXWBFGTCX9J51bhysc --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3afcd69a5c |
Joints: a loop whose axes are a hair out of parallel still moves (#6211) (#6602)
* claim: #6211 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Joints: a loop whose axes are a hair out of parallel still moves (#6211) Holes picked on parts are rarely exactly in line. A closed loop through axes a few hundredths of a microradian apart (a lever, link and a rod on a cylindrical axle) can't close exactly: it closes to nanometres, and the gap grows as it turns. The loop solver wanted 1e-7 mm, so it threw such a closure away (the loop stayed open, its parts at 0 dof) or stopped a drive or drag after a fraction of a degree. The conflict check is now 1e-4 mm / 1e-6 rad (it was below what its message can show), and joint.drive / motion and joint.reach close the loop at each step as at the start: to the tight tolerance where they get there, otherwise within the conflict check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |