To pick a view or a dimension on a sheet, something has to say which one is under the pointer.
drawing_scene::hit takes the objects a sheet's scene lists, a point and a band: of the boxes that
hold the point within the band, the smallest, then the topmost, and whether the point is on the
box's edge. A view's box is its boundary, so one that can't be drawn can still be picked; the
drawing border is never hit. It is one pass over the objects, cheap enough for every hover.
drawing.scene.hit answers it for scripts and agents, from the sheet as drawing.scene draws it:
read-only, with input and output schemas, its label in a pending locale file and an EXEMPT line.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Paper scene: kinds of line and their widths by ISO 128-20 (#4890 D2a)
A line's kind (visible, hidden, centre, thin) and a line group give its width in one place:
the standard's series of widths, and a group's wide and narrow lines two steps apart. Nothing
reads it yet; the next commit draws every line on paper from it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Paper scene: every line on paper takes its width from its kind and line group (#4890 D2d)
A view's lines and a dimension's lines are drawn in a line group: a visible edge is its wide
line, a hidden edge, a reference part's edge and a dimension's lines its narrow one, and a
hidden line is dashed 12 line widths on and 3 off. The five width constants that waited for
this go. Every caller draws in the default 0.5 mm group, so today's sheets are unchanged; a
drawing, a sheet and a view choose their own group next.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A saved view now keeps the occurrences it draws and the ones it leaves out,
as the snapshot takes them. drawing.view.base, edit and inspect take them; each
follows the parent until a view sets its own, and a copy made alone keeps what
it showed. Boundaries, fitted scales and lines all read them through one rule.
A path whose occurrence was deleted never refuses the file: a hide path goes
quiet, and a view with nothing left is a placeholder that says why.
Replayed onto drawings fd4b7a7bc: the fit and the lines take reference_shown_percent
(the rename of reference_margin_mm in #7316) through shows(); the path limits now live in doc.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A dimension or balloon whose edge, corner or face is lost now lists up to 16 leads, offered and never taken: the
blend face named after a filleted edge, that face's edges, then the faces the same feature made. Lookup still never
writes the record, so undo brings a lost reference back.
drawing.dimension.repair {dimension, slot, pick} and drawing.balloon.repair {balloon, pick} point a lost or
ambiguous reference at a pick of the same kind, on the reference's own occurrence path: same id and paper place, one
undo step, through one shared helper. Only a reference that no longer finds the one thing it names is repaired, so a
dimension's other, still-found reference is kept, and silhouettes repaired onto one cylinder are refused as add
refuses them. A pick takes the forms add takes, so a lead of the slot's kind from inspect passes back as it stands.
The saved format is unchanged.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
#12152 put an SVG's text back under `svg` in drawing.export's reply and
missed two readers: the delete test that selects a drawing's objects and the
pictures test that draws an image under the views.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
fit works inside the sheet's free space by the same rule as leaves (drawing_view::Room): it takes the
largest preset the border allows, then steps down until the view's box is off the block. A sheet with
no block fits as before; the snapshot, with no sheet, passes none. The default position stays the
sheet's middle.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
#10681 renamed the reply's `svg` key to `text`, and that broke the commands'
existing readers: three tests on drawings read `svg` and failed. The SVG goes
back under `svg`; a PNG's base64 stays under `data`. The output schema and the
params doc follow, and #10681's own export tests read `svg` again.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
drawing.dimension.add, with no offset_mm, puts a linear, length or chain
dimension 10 mm on paper to the side of its line away from the material
beside it: it looks half a paper millimetre either way across the line, in
the view's plane, at the depth of what it measures, and asks each shown
body's B-rep exactly (Body::classify_point; inside or on its boundary is
material). With material on both sides or neither, it goes away from the
middle of the view's model box; on that middle, the fixed rule is above or
to the left (+10). Radial, angle, cylinder and silhouette dimensions keep
+10, and an offset given keeps its sign.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing export: a sheet as PNG at a chosen dpi and colour, and one reply shape (#4890 EX1)
drawing.export {format: png, dpi?, colour?} writes the sheet's scene
through the sheet PNG writer: 25 to 2400 dpi (300 when not given), grey,
black and white, RGB or transparent (grey when not given). dpi and
colour are refused on an SVG. A path must end in the format's extension,
which ExportFormat::extension gives for every format.
One reply shape for every format: text (SVG) or data (base64 PNG) when
no path is given, in place of svg; report.pixels gives a PNG's size. A
PNG held for the reply stops at 64 MiB, as an SVG does, and the refusal
says to give a path; a file may be as large as the sheet needs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing export: a sheet on blue paper, in SVG and PNG (#10679)
One rule for the two papers and their ink, used by both writers. White stays the default, byte for byte. A blue paper's PNG is rgb; the other colours are refused by name. A picture keeps its own colours.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A drawing view's setting for how it is drawn (visible lines, with hidden lines, shaded)
was display_style while the viewport calls the same idea its visual style. The field,
its command parameters, its schemas and its replies are now visual_style, on a view's
settings and on its own overrides. display_style is refused as an unknown field, as
drawings haven't shipped and no saved design holds it.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A table's column can be left off paper (printed: false, saved only then): the
layout places the printed columns only, while filters and overrides still read
every column. No printed column may read the ballooned row field, and a table
prints at least one column.
A new parts list gets a seventh column, ballooned, not printed.
Drawing::balloons_by_list works out once which list each balloon reads, and
balloons_by_row counts one list's balloons row by row, every row listed, 0
included; drawing.inspect gives parts_lists with each
list's counts. Worked out on each read and never saved.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The view lines' errors were the view DXF's, remedies included, so a drawing
view could say "DXF export cancelled" or "increase tolerance". The module now
answers a Refused (cancelled, over the work or memory limit, across the eye
plane, invalid) that says only what happened. The view DXF adds what to do in
a DXF's terms (hide bodies or sketches, increase tolerance, zoom out), and a
drawing view in a drawing's (raise chord_mm, or choose a smaller scale).
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing templates: the built-ins carry SolidCraft's title block again, so a new drawing starts with it (#3875)
Every built-in template, ISO A4 to A0, is one sheet with the ISO border and
the built-in title block, so drawing.create with no template (iso-a3)
gives a drawing with the block. #7208 made them the border only; the
decision since is that a drawing starts with SolidCraft's block, and a
user replaces or changes the default template.
- A drawing saved as a template is the user's own: a copy of the built-in
with a company's name in the block and its tolerances typed in starts
drawings that keep both (tested through drawing.template.save and
drawing.create).
- The built-in block by name stays, for a sheet without one.
- The general tolerances stay empty, and the five names (iso-a4 to
iso-a0) and the one drawing_template setting stay: the part and
assembly versions would be the same.
- The tests that gave a new drawing the block first no longer do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing templates by kind: a part starts on A3, an assembly on A2, each with its tolerances note (#3875)
Ten built-ins, iso-a4-part and iso-a4-assembly up to iso-a0-part and iso-a0-assembly, each with its kind's general
tolerances note typed over the title block cell. template::default_for(assembly) is the one rule for the default, and
template::is_assembly says a design that places components is an assembly. drawing.create with no template uses it,
and drawing.template.list marks the design's default and says whether each built-in is an assembly's. The older names
iso-a4 to iso-a0 still read as that size's part template.
Preferences gets one setting per kind in place of the one; a saved name of the other kind reads as the kind's default,
and the old drawing_template key is ignored.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A saved view or a snapshot's scene in visible_hidden now draws its hidden lines,
0.25 mm wide in ISO 128's dashed line, under the visible ones; a reference part in
visible_hidden draws its hidden lines the same way. Paint order from the bottom:
hidden lines, reference parts' visible lines, the model's. The sheet no longer fails
for that style, so it exports; only shaded styles with lines still refuse.
The paper scene's output schema takes a stroke's dash pattern, so a reply
with hidden lines still matches it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Issue a revision: drawing.revise (#3874 R1)
drawing.revise appends a copy of a row to the issued history: an existing row as
it reads, or a new revision with the texts given, in one undo step. A row is
issued once. The copy keeps what it read through an edit, a hide or a delete, and
nothing is filled in: no date, checker or approval.
Issuing used to make a drawing unreadable, as a copy has its row's id and the
drawing's check refused any id seen twice. Each id now counts once, and issued
ids are unique among themselves.
model_version becomes {path, change}, on issued copies only. One function on the
session answers it, and answers nothing until version control exists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing revisions: numbered 1, 2, 3 (#3874)
A drawing's new revisions are numbered 1, 2, 3, never lettered
(@CamWight, 3 Nov). drawing.set's revision_numbering is {start: 0 or 1},
the first number. A revision typed by hand is kept as typed; the next one
follows the highest number, and drawing.inspect says where numbering
starts. A record in letters is refused (drawings haven't shipped).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Revision tags on a sheet: add, edit and delete (#3874 R3)
A tag gains the sheet it sits on and its place there. drawing.revision.tag.add,
.edit and .delete keep them, inspect and every revision reply list them with what
each shows, and a sheet's delete counts and takes the tags on it. A deleted row
still leaves its tags showing the revision they had. Tags draw on paper once scene
text lands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Saved tables on a sheet: drawing.table.add, .edit and .delete (#3874)
A drawing saves its parts lists and revision tables, each on a sheet with its
definition and place. Rows are never saved. A parts list starts at the top right
listing what its sheet documents, else the design; a revision table at the bottom
left; headings on top, QTY, rows of 7 mm.
Placing a list saves the numbers its view shows, once per view, so what is printed
doesn't move. Numbers are the design's: undoing the placing puts back only the
drawing, as every drawing step does, and the numbers stay. That one command changes
both, and the proof that nothing needs evaluating now allows it.
The tables are a ById list, as the balloons and images are, and keep its rules: at
most 1000, listed by id. Revision tags take their own id type.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* A balloon reads its row in a parts list (#3874 L1)
A balloon can name the parts list it reads; else it reads its sheet's only list,
else the drawing's only one, else none, with the choices listed. Its row's item is
worked out on each read and never saved: drawing.balloon.inspect gives item and
row_status (ok, no_list, reference, no_row or not_found). A lost row never removes
the balloon. A list's delete reports the balloons that named it and clears their
links.
Bom::item_of cuts a path from the top of the design to start below the assembly
listed, and row_of is no longer test-only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Notes on a drawing: the record and commands (W19e, #4896)
A note sits on a sheet, a view, or an edge or corner of a view's model, saved by
name as a dimension's is, with the title block's text and fields, its place and
its text height. drawing.note.add, .edit and .inspect, one undo step each, no
model evaluated. Its one leader is worked out, never saved: a lost reference keeps
the note and its text, with no leader. Anchor is one type so other symbols placed
on a sheet can use it.
A view's notes go with its copy and delete; a sheet's with the sheet. The plan left
delete for later, but selection.delete now handles a drawing's objects, so notes
join it. Balloons and notes share Lookup::middle. Drawing them waits for text in
the paper scene (slice 12).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Labelled measurements on a view's snapshot (#5866)
measure: linear, aligned, angle from model points, radius from an edge, with
units and decimals for the labels. No new maths: drawing_measure's rules, and
a dimension's radial rule through one Lookup::whole_arc. Labels go through one
function, reading_label, which dimensions' text now uses too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pieces on one circle are that circle, and one piece is that edge (#4892)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* A dimension between two flat faces (#4892)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* A suppressed or failed feature's references say so, not lost (#4892)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Labelled measurements on a view's snapshot (#5866)
measure: linear, aligned, angle from model points, radius from an edge, with
units and decimals for the labels. No new maths: drawing_measure's rules, and
a dimension's radial rule through one Lookup::whole_arc. Labels go through one
function, reading_label, which dimensions' text now uses too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pieces on one circle are that circle, and one piece is that edge (#4892)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The raster walked a triangle's whole box, testing every sample, and the pixel budget counted that box.
A plain plate's few long triangles have boxes that are mostly misses, so a view at 2:1 counted 18 tests
a sample. Now each row of the box tests only the span the triangle can touch there, and the budget
counts those spans (an empty row costs one unit, as the walk does).
row_span works the span out from each edge's weight along the row, allowing for the test's own
tolerance and the rounding of its arithmetic, so it is never short; sample_weights is the raster's test
pulled out unchanged. Pictures are the same to the byte. A product image shares the raster and the
count, so its 128 M admits more; the tests built on its old count hold more triangles.
With the misses gone nearly every counted test paints, and a painted surface costs about 240 ns a
test on one thread, so a picture's limit falls from 400 M to 250 M to stay near a minute at worst.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each dimension of a view on the sheet is one group, ObjectKind::Dimension,
after the views: extension and dimension lines and filled arrowheads
(Terminator::place, #9466), laid out by dim_layout_sized in paper millimetres, so it is the same size at any
view scale. All seven kinds draw; a chain is one line of frames at one offset
with each extension line once, an angle sits where its lines meet on the view,
and a cylinder's line runs across its silhouettes at the end on its offset's
side.
drawing.scene and drawing.export list each dimension: its status, whether it
is drawn, and why not. A lost one, or one on a view that isn't drawn, has no
lines and leaves the sheet and the file written. The provider keeps each
dimension's group by its record, world state, view drawing and units: a moved
view moves them unread, and an edit reads that dimension alone, in one short
step after the views. Text joins with B1.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* claim: #10994
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Compare Bodies: input and output schemas (#10994)
inspect.compare gets a typed contract and reply types in
schema/compare.rs and leaves unconverted.txt. Each key reads as the
handler reads it, with its message; `color` checks each colour with the
handler's own color_param, now pub(crate) and re-exported from cmd. The
reply is built from Comparison and its parts, with the same JSON.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Compare: drop the json import the typed reply no longer uses
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Compare schema: colour strings carry the hex pattern
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
* claim: #11455
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render stage: input and output schemas for Ground, Backdrop and Clear (#11455)
The three handlers' strict parameter types move to schema/render_stage.rs as
GroundParams, BackdropParams and ClearParams, with descriptions and
JsonSchema, and become the contracts; the handlers read the same types. The
handlers build the shared StageSaved reply instead of json! literals, and the
saved setup is serialized with an error instead of json!'s panic path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* claim: #7896
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Isolate a body: other components are hidden as components, in one step (#7896)
Isolating a body hid every other body one by one: browser.visibility with `items` writes only
hidden_bodies, so every other component's Browser row kept an open eye and normal text, and
its eye could not bring it back (the first click hid an already invisible component).
browser.visibility takes `isolate: true` with `items` (bodies), as it does with `paths`. The
picked bodies' own placements stay open, their other bodies (and the root's) are hidden one by
one, and every other placement is hidden as a placement. Isolate in the Browser and the view
runs that one command, so it is also one undo step instead of two.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Isolate a body: a hidden Bodies folder or group it is in shows again (#7896)
Isolating a body inside a hidden Bodies folder or group left that folder or
group hidden, so the picked body stayed hidden. Isolate now shows the
folders and groups (with the groups they are in) that hold the picked
bodies; their other bodies are hidden one by one as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Isolate a body: look for hidden folders only when some are hidden, and find body owners once (#7896)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
document.metadata, document.metadata.set and document.metadata.remove
get input and output schemas: contracts in schema/metadata.rs, checked
in front of the unchanged handlers, and reply types the handlers now
build their replies from. Their lines leave unconverted.txt.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A cut that leaves a body in pieces names them after their faces
(`order_lumps`): the piece whose least face name sorts first takes the
first name, and so on. It moved the names but left the pieces where the
kernel put them. The session then pinned the feature's body names in
that state order, and the next full evaluation (opening the design, or
editing a parameter upstream) handed them out again in a different
order: two pieces swapped names, and a later feature that named one met
the other. Found by a local model fuzzer.
The pieces now also take the family's places in name order, so the
names pinned are the order the next evaluation hands them out in. A
design saved before keeps the names a fresh evaluation gave it.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A through-point 0.0000001 mm from the start made an infinite line whose
direction nothing held, and a Line that short had both ends connected to
the origin, a line of length zero. Both now refuse points closer than the
distance at which a new point is connected to an existing one.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* claim: Recovery: the save test waits for the autosave worker before it checks
* Recovery: the save test waits for the autosave worker before it checks
saving_drops_the_entry_and_a_clean_close_leaves_nothing marked the
session saved right after the tick that started an autosave. Under load
the worker was still writing, so the next tick found the write running,
took nothing up and dropped nothing; the file landed afterwards and the
check that it is gone failed (seen in CI on #9021).
The test now ticks, bounded, until the autosave has caught up
(Autosaver::caught_up), as the app's own frames would, before it marks
the session saved. A small helper in the test module does this. The
app's behaviour is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* claim: #10437
Co-authored-by: Cursor <cursoragent@cursor.com>
* Lip: say Shell first when the face is not a rim (#10437)
A solid box top left OK disabled with a vague shelled-body hint. Name Shell and the rim-around-an-opening requirement in the refusal, the dialog tip, and the command help.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Lip: keep the dialog hint as it was, match the new refusal text in the test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* claim: #10981
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Match Surface: input and output schemas (#10981)
surface.match gets a typed contract in schema/surface_match.rs and the
shared FeatureResult as its output, and leaves unconverted.txt. Each key
reads as the handler reads it, with its message; like solid.scale it
declares `name` and `participants` itself, since a match makes no body.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Follow main's kernel merge: world_state and the shared continuity reader
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Surface match schema: Vec3 comes from solidcore_record now
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
* claim: #11036
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Physical material property commands: input and output schemas (#11036)
material.properties.validate and material.properties.directional get
typed contracts and reply types in schema/material_properties.rs and
leave unconverted.txt. The card stays the handler's to check; the
direction has the handler's messages. The replies mirror the document's
Validation and DirectionalModulus, destructured in full.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Feature editor: a roll back's re-solved placements are not a changed design
Rolling the marker solves the joints again and stores where that puts each occurrence, so the
editor's pinned original differed from its source there and OK was refused with "the original
editor model does not match its source design". The check now takes the placements as the roll
leaves them.
* Feature editor: also accept the ratio and lift of coupled joints that rolling the marker works out
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* claim: #11051
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Clearance: input and output schemas (#11051)
inspect.clearance gets a typed contract and reply types in
schema/clearance.rs and leaves unconverted.txt. Each key reads as the
handler reads it, with its message; MAX_CLEARANCE and MAX_NEAREST move
to the schema module so both read one limit. The reply is built from
Clearance and its item types, with the same JSON as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* claim: #6173
* Inspect: center of mass reports the same volume as measure (#6173)
inspect.center_of_mass measured each body's display mesh, whose flat
facets cut curved faces short, so its volume and centre differed from
inspect.measure's (a sphere of radius 10: 4183.10 vs 4188.49 mm3). It now
takes both from the same cached kernel measurement Measure uses, and like
Measure it leaves out bodies that enclose no volume, counting them in
open_bodies_skipped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Centre of mass tests: read the skipped list that main now returns
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Tyler Chiriboga <18270301+Tyler-Chiriboga@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
* Modeled threads: run down to a flat shoulder so a nut can bottom out
An external thread running the whole face stopped with its groove clear of
a shoulder, leaving up to a turn uncut above it. The groove now runs on past
the plane of the face's end and is trimmed there, so its root reaches the
shoulder at every angle and nothing past the plane is cut.
A shoulder rising back along the face keeps the square stop, as do internal
threads, tapers, runouts and lengths stopping short. Where the kernel refuses
the trimmed cut, the groove also keeps the square stop and the feature warns.
Closes#11610
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Kernel ladder: record the thread cases that now reach their shoulder
Six cases gain the faces of the trimmed last turn; every other case is
unchanged apart from its timing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Thread at a shoulder: review fixes, and a test of the fallback
The shoulder check starts just off the face, as the free-end check does, so
a slope rising from the face counts. A groove the trim leaves nothing of now
falls back to the square stop too. A test forces the fallback and reads its
warning. The ladder's order and report go back to main's, changed only for
the cases this moved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Thread at a shoulder: check all the radii the groove cuts
The check for a shoulder rising along the face looked a fixed distance out,
which falls short of the groove on an undersized shaft. It now covers the
groove's reach. A test reads how each kind of shoulder is classified.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Thread at a shoulder: test the trim that leaves nothing of the groove
The test now reaches the path where the half-space keeps nothing, which is
the one that must fall back to the square stop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Thread at a shoulder: say so when the shoulder can't be checked
If the kernel can't make the rising-shoulder check, the groove keeps the square
stop as before, and the feature now warns that its last turn is left uncut.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* SMLib wrapper: a swept or mitred turn for constant rounds (Turn)
Brep::blend_dropping takes a Turn: Mitre (the default, as before) or Swept,
which sets solidcore's FilletSession::set_swept_turns before the corners are
made. A swept turn solidcore refuses at CreateFilletCorners comes back as
Error::TurnRefused with its reason and place (NoRoom at a concave side edge,
else CornerUnsupported). Swept is for Blend::Round only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* Kernel: fillet rounds turn in a mitre or swept (FilletTurn)
fillet_removing, fillet_max, fillet_max_each and fillet_each take a
FilletTurn and hand it to SMLib, through the reblend of earlier rounds at a
later corner too. A swept corner solidcore does not build is refused as
invalid input with its reason and place: no smaller radius builds it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* Design: a fillet saves its turn, mitre (default) or swept
FeatureKind::Fillet gets `turn` (FilletTurn: mitre, the default and not
saved, or swept), one pending format file. Evaluation hands it to the kernel,
pattern copies included, and refuses a swept turn with a style, fit, corner
or setbacks the kernel's swept corner does not take (SWEPT_TAKES).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* solid.fillet: the turn parameter, and the command's input and output schemas
`turn: mitre|swept` on solid.fillet, refused when unknown or with options a
swept corner does not take. solid.fillet now has its contract (FilletParams)
and reply type (FilletResult), registered with checked!, and leaves
schema/unconverted.txt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* Fillet dialog: a Turns choice, Mitre or Swept
A Constant radius fillet's Turns row sends `turn: swept`; choosing a narrowed
radius or a curvature corner puts it back to Mitre, and Swept puts those back.
Its tooltip says what each does where two rounds turn round a corner edge.
New strings in a pending locale file (en, de, ja, ko, zh); glossary entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* Fillet turn: the schema tests' fixes and the complete catalogs' strings
The no-contract example in the schema tests is solid.chamfer now that
solid.fillet has one; the reply test checks the mid-radii form against the
contract (solidcore refuses that law's corner yet, #430) instead of building
it; Arabic, Hebrew and Vietnamese, complete catalogs, get the new strings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* Fillet schema test: variable and spline forms checked against the contract
solidcore fails a variable round on a box edge at this pin (status 1001, as
variable_radius_on_a_box_edge), so the reply test checks those forms against
the contract instead of building them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* Fillet turn: the swept rig cases pass; the MCP no-contract example is solid.chamfer
cov-fillet-turn-swept-boss-base-r1 and
cov-fillet-turn-swept-pocket-sharp-corner-refused-r1 pass now that
solid.fillet takes `turn`: off the rig's known-failing list. The MCP bridge
test's example of a command without a contract was solid.fillet, which has
one now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
---------
Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Planar sources: decide coplanar faces by support group, no budgets that drop sources
map_planar_sources kept two budgets, `metadata` (2 MB) and `identity_bytes`
(16 MB), charged by each face's source descriptor and by every extra
candidate on its plane. When one ran out, faces silently lost their source
and with it their persistent name: a 300-hole plate whose top a comb of
grooves cuts into 62 strips lost the cap source from strip ~47 on.
The budgets bounded the real cost: each result face looked at every
candidate on its plane, faces x candidates when many faces are coplanar.
The candidates are now grouped by support once (`same_support` against
each group's first plane, through the existing PlaneIndex), each group's
chosen source, ambiguity and inner flag decided once, and the faces
without a role together with the competing tool faces grouped the same
way. Each result face then looks up its plane's few groups. The decision
is the old one: blocked by an unknown or competing support, else the
first candidate on the plane unless another candidate there has a
different plane, source or role.
Work: grouping looks at each candidate's index window once per group
(each candidate is assigned on its group's first look), and each face
looks at the group representatives near its plane, so the planes looked
at grow with faces + candidates. A counter (`looked`) checks it: n
pieces of one cap and n faces on its plane take exactly 2n looks (n*n
before), 3n with n blocking supports.
Tests: the holed plate keeps the cap source on all 62 strips and the
bottom (fails on the old code: face 352 lost its source); the existing
planar source tests pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* Extrude: an ellipse or a spline sketch curve sweeps one wall
An extruded ellipse had four side faces (`F2:side:e1#1` to `#4`), one
per conic quarter, and a spline one per span: the profile holds such a
curve as several exact segments and SMLib got each as its own curve.
The Extrude feature's builder (`extrude_whole_sides`) now takes a
`one_curve` test from the caller. Each run of free-form segments of one
degree that it says are one curve goes to SMLib as one B-spline: the
Béziers' control points in a row, knots repeated the degree times at
each joint, each span as long as keeps the speed through the joint the
same (so the curve is C1 there and SMLib makes one face over it, as it
would not over a C0 parametrisation), weights scaled to meet. Exact: the
same curve, reparametrised. A loop starts at a run's start, so no run
wraps round it. The wall's history lists every piece, and its
construction source is its first piece's (as joined collinear lines).
The document says which segments are one curve: ExactSketchCurves now
also holds each free-form sketch curve's exact segments
(`find_free_form`: a segment that is one of them, either way round), and
the profile roles use it, so the wall is named `side:<curve>` from its
history rather than by the curve nearest its mesh centre.
Saved designs rebuild with these walls renamed (`F2:side:e1#k` ->
`F2:side:e1`); accepted, no alias kept.
Tests: kernel `pieces_of_one_curve_extrude_into_one_wall` (an ellipse in
four conics is 3 faces, its volume pi a b h to 1e-6, the wall generated by
all four pieces; a 3-span spline closed by lines is one wall; the same
solid as a face per piece); doc
`an_extruded_ellipse_or_spline_is_one_wall_named_by_its_curve` (one
`F2:side:e1`, no piece names, the same names on a second build and after
reopening).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* Tests: a tray's far rim name is checked on the exact B-rep face
The tray test took the point `sheet:...:rim.far` finds as right when it
lay within 1e-3 mm of the strip z = 30, 199 <= y <= 200: a slack sized to
the mesh. It now asserts on the face the name finds, on exact geometry:
the point's distance to that face's surface (FaceSurface::nearest) is
within rounding at the part's scale (1e-12 x its size), and the point is
inside the face's boundary, counted by crossings of its record edges
(each asserted to be a line, the rim being planar).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* Tests: delete tests/naming/, the records no test reads since the naming corpus stopped comparing against them
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* Viewport test: smooth wall joins drawn from eight G2 spline walls
The PR extrudes each spline or ellipse sketch curve as one wall, so the
offset-ellipse ring the test built has no joins between faces any more.
The test now extrudes a circle drawn as eight cubic splines: eight walls
meeting with one curvature along eight upright edges (24 edges in all).
It still checks that those joins are left out of the shaded view, drawn
in the wireframe and selectable as edges.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
* Kernel ladder: 009 and 012 record the one-wall extrude (an extruded spline or ellipse sweeps one wall)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
---------
Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
`Seg2::mapped(f, arc)` is a segment under a map of the plane that keeps shapes. Points go
through `f` itself (an arc's centre, every control point). `ArcMap { angle, mirrored, scale }`
says how the map moves an arc: it turns it by `angle`, after a mirror across the x axis when
`mirrored` (start `angle - start`, sweep reversed), and scales its radius by `scale`.
`ArcMap::turn(angle, mirrored)` keeps lengths; `ArcMap::rigid(f)` measures a map of points that
keeps lengths, from where it puts the origin and the unit axes, with a scale of exactly 1.
`Seg2::similar` and the three arc maps written out by hand use it:
- a sheet-metal region onto a panel's flat (`region_to_flat`, which measured its map by hand and
now asks `ArcMap::rigid`);
- the mirrored flat (`flip_x_loop`);
- a sketch region mirrored in its x axis (`mirror_y`).
The points go through the same functions as before, so every result is the same, bit for bit.
This comes from the architecture review of the drawing work (2026-10-25): four places wrote the
arc rule out, each its own way, and one measured its map by hand.
`map_controls` is private to geom now: on its own it hands an arc back unmapped, which is what the
three hand-written arms were there to avoid.
Tests: every kind of segment under a mirrored map with a turn, a scale and a shift, point by point,
its length scaled and an arc's sweep reversed; the three old formulas, bit for bit (the sketch
mirror keeps a +0.0 start's -0.0); a rigid map's turn and mirror measured whatever its shift, and
the identity; the sheet-metal and mirror tests unchanged.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
document.units gets input and output schemas: `units` (mm, cm, m, in or
ft, with the handler's messages for a missing or unknown unit) and its
reply, `units` and `kept`, which the handler now builds from the reply
type. Its line leaves unconverted.txt.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Threads: a 12 mm hole takes M12, and a modelled thread narrows a bore that is too wide (#11609)
Automatic sizing of a hole now takes the size whose nominal diameter the hole has (a 12 mm hole
is M12, not M14, the size whose tap drill is 12 mm); a hole near no nominal diameter is still
matched by tap drill. A modelled internal thread in a hole as wide as the thread or wider no
longer refuses with "too wide": the bore is filled in to the thread's minor diameter over the
threaded length and the groove cut there, and the feature's warning says so. A size that does
not fit the hole names the size that does.
A saved thread with no designation keeps the old rule through a pending format step, so an
existing design rebuilds with the size it had.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Threads: keep an old automatic size through edits; kernel-rig cases expect the narrowed bore (#11609)
Editing a saved automatic thread keeps `old_auto_size`, so it does not change size. The five
kernel-rig cases that expected a modelled thread in a hole as wide as the thread to be refused
now expect the narrowed bore, with the volume worked out analytically in each case. The thread
dialog's reopen pattern names the new field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Thread dialog test: a 5 mm hole is suggested M5, its nominal size (#11609)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Typed schemas for Appearance, Appearance Library and List Appearances (part of #2829)
appearance.assign, appearance.library and appearance.list get contracts
that read what their handlers read, with the handlers' messages, and
reply types the handlers build their replies from. Their lines leave
unconverted.txt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Appearance library: the opacity is already a number
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing sheets: a copy of a title block on the drawing border, saved with the sheet (#3875)
`Sheet.title_block` holds a copy of its definition, as `border` does. Each sheet's check lays it
out on the drawing border, so a sheet without a border, a block wider or taller than the border,
or a change of paper that leaves no room is refused. `drawing.sheet.add` and `drawing.sheet.set`
take `title_block` (a definition, or null for none), a new sheet takes the block of the sheet it
follows, and `drawing.inspect` lists it. A sheet without a block saves no `title_block`, so an
older drawing reads as having none (pending format file `sheet-title-block.rs`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing sheets: the built-in title block, on every new drawing (#3875)
`title_block::default_block()` is the 180 x 54 mm block of twelve cells approved on #3875, with
the legal owner read from the drawing's `organization` and the general tolerances as text to
change. `drawing.create` starts its sheet with it. The geometry tests read the built-in block
instead of their own copy of it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing sheets: a title block's lines on paper, drawn after the views (#3875)
`TitleBlockLayout::paper` draws the outline, then every cell edge inside it, each once:
neighbours' shared edges, and edges that meet along one line, are one stroke. The sheet scene
paints the block after the views, and counts its records with the border's, so no view takes
its room. The view tests' drawing leaves the block off, so their scene is still the border and
the views.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing sheets: the title block's projection symbol, in the drawing's projection (#3875)
ISO 5456-2 (Annex A): a truncated cone and its end view, h across the cone's
small end from table A.1's sizes (3.5 to 20 mm), the largest that fits the
cell, lines h/10 wide. The end view is on the right in first angle and on
the left in third. The block only says a cell holds the symbol; the angle
comes from drawing.projection, and the sheet scene redraws when it changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing sheets: a title block's fields, and text typed over its cells (#3875)
A title block cell reads its fields from the component the sheet documents (its
name, part properties, material and mass from the bill of materials), the
drawing, the sheet (number and count among the counted sheets) and the newest
revision row; a field with no value shows "-". A key its source doesn't have is
refused when a block is given or read. Sheets save text typed over their cells by
cell name; drawing.inspect lists each text cell with its value beside an override.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing templates as data: a drawing with no model, and ISO built-ins (#3875)
A template is a drawing with no sources, views, dimensions, balloons, revision
rows or documented components, so it is saved and read as a drawing is. A new
drawing is a copy with ids of its own. The built-ins, ISO A4 to A0 for parts and
for assemblies, are made in code when asked for and differ only in their general
tolerances.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing templates: drawing.create from a template, and the preferred ones (#3875)
drawing.create takes template? (default ISO A3, for a part or, for a design with
components, an assembly) and projection? over the template's. The new
drawing.template.list lists the built-ins and marks the one a new drawing starts
from. Preferences add a template for part drawings and one for assembly drawings;
the app fills in the preferred template and projection before drawing.create
runs, so a template named keeps its own projection, instead of changing the
projection after the drawing is made. A saved template this version doesn't know
reads as the default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing templates: apply one to the drawing open, moving nothing (#3875)
drawing.template.apply {template, dry_run?} gives each sheet the paper, drawing
border and title block of the template's sheet in its place (its last for the
sheets past its own). Text typed over a cell stays while the new block has a
text cell of that name; the cells whose text is dropped are listed. Nothing
moves: the views a new paper leaves outside the drawing space are listed. A dry
run answers the same and changes nothing; applying is one undo step, none when
nothing changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing sheets: views a title block covers are listed, never moved (#3875)
A view lying over its sheet's title block is listed with the ones the drawing
space leaves out, after a change of paper or block (drawing.sheet.set) and when
a template restyles a sheet. Where a block sits is one rule, the one a sheet is
checked by (Sheet::title_block_outline), and the overlap of two boxes is one
rule in Aabb2::overlaps, which the title block's own cell check now uses too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing templates: save one as a file, and start or restyle drawings from it (#3875)
drawing.template.save {path} writes the drawing open as a template: its format,
and nothing it draws or documents. drawing.create and drawing.template.apply take
a .json template file as well as a built-in's name. A file is read as a drawing
is, then held to the template rules; files are read and written through the same
file check and atomic write as the sheet export. A drawing made from a file keeps
its own copy, so a later save changes no drawing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing sheets: the built-in title block is 180 x 49 mm (#3875)
The top row is 15 mm, Sheet is 30 mm wide, lined up with Mass, and Date of
issue is 32 mm. The top row now holds one line of the legal owner, two of the
general tolerances and the 3.5 mm projection symbol.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing sheets: one operation sets a sheet's title block, and drawing.sheet.set names the typed text it drops (#3875)
A sheet's block was set in two places: drawing.sheet.set kept the typed
text of the text cells the new block still has, and drawing.template.apply
did the same and listed what it dropped. Sheet::set_title_block is now the
one rule both use. drawing.sheet.set's reply gains `lost`, the cells whose
typed text a new block drops, as drawing.template.apply's reply has it, and
its help says that a view over the title block is listed too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing templates: the built-ins and a new drawing start with the border only; the built-in title block is added by name (#3875)
A template now holds only the ISO border by default. A title block,
tables, references and text are added to a drawing, and a template saved
from it keeps them.
- The ten built-ins (iso-a4-part ... iso-a0-assembly) become five,
iso-a4 to iso-a0: one sheet with the ISO border. Without the block, the
part and assembly versions were the same.
- drawing.create with no template starts from iso-a3. The two
preferences for parts and assemblies become one, drawing_template,
"Template for new drawings".
- drawing.sheet.add and drawing.sheet.set take title_block: "built-in".
The built-in block's general tolerances are a part's or, for a design
with components, an assembly's, through Sheet::set_title_block.
- An old name such as iso-a3-part is refused with the list of names;
drawings haven't shipped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing title blocks: a drawing with no number of its own is numbered by the component its sheet documents (#3875)
The identification number cell read the drawing's part number property,
and showed "-" for a drawing that has none, which is every new one. Now
such a drawing shows the name of the component the sheet documents, so a
new drawing of a part is numbered by the part until it is given a number.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing templates: a template saved from a drawing keeps typed text only over plain text cells (#3875)
A template saved from a drawing kept all the text typed over its title
block's cells, including text over a cell that shows a field, such as
the material or the title, which belongs to the design the drawing
documents. Now it keeps the text typed over cells of plain text, such as
the general tolerances, and leaves the rest behind.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing title blocks and tables: a field without a value shows nothing (#3875)
A title block cell or a table row whose field has no value (a property
nobody gave, a row field its row doesn't have, an uncounted sheet's
number) now shows nothing instead of "-".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing title blocks: the built-in block's general tolerances start empty (#3875)
The general tolerances cell of the built-in title block now starts empty for
parts and assemblies alike, rather than ISO 2768-m in the block and a part's
or an assembly's text added by drawing.sheet.set. A shop types its own, or
its template carries them, and an empty cell shows nothing.
- template::PART_TOLERANCES, ASSEMBLY_TOLERANCES, for_assembly and
built_in_block go: "built-in" is title_block::default_block.
- drawing.template.list's help no longer speaks of part and assembly
built-ins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* claim: #6257
* Align: move bodies by frames that follow sketch and model geometry (#6257)
solid.align takes from_frame and to_frame: a joint origin on the model
(a face's or round end's centre, an edge's middle, a corner, found again
by name) or a sketch point or a sketch circle's, arc's or ellipse's
centre. Both are resolved on every evaluation, so the bodies follow
their target when it changes. An optional angle turns the bodies about
the target's direction after the move.
The Align dialog takes sketch points and curves as From and To, offers
the Joint Origin snap and an Angle row.
* Align frames: box the joint origin (clippy large_enum_variant)
* Align frames: every moved body on the frame's component, placed once
* Align frames: a sketch id's length in characters
* Align frames: the dialog test's sketch curve hit carries its point
* Align frames: the dialog test takes Vec2 from solidcore-record
---------
Co-authored-by: MateuszSychXpl <151755914+MateuszSychXpl@users.noreply.github.com>
* A drawing's list of one kind of record: ById, with balloons first (#5426)
Each kind on a sheet writes out the same add, find by halves, cap, order and check loop. ById holds
those, so a kind's own file holds only its own rules, and the file's bytes don't change: it saves as
the plain list. Views and dimensions stay on their own lists for now, since other work is on them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* A drawing keeps an image's file once, however many places it sits (#5426 W38e-1)
images holds the files and sheet_images each place one sits, so a logo on every sheet costs what one
does. drawing.image.add reads the file (bytes and pixels checked from its header before anything
decodes it), reuses a file with the same bytes, and saves the bytes without the path. A file goes
with the last thing that uses it, which Drawing::images_in_use alone says, and reading a drawing
refuses a file nothing uses or a record its file disagrees with. A sheet's list and delete take the
placements on it. Deleting one placement waits for selection.delete to take a drawing's objects. Its
pixels on paper are W38e-2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Sheet images: an image file's pixels on any paper grid (#5425, W38e-2)
A PNG or JPEG decoded once, then stretched over its paper rectangle onto the pixel grid a writer
asks for: a box filter in linear light with alpha premultiplied, so a shrunk logo keeps its edges
and gains no dark fringe. The size is read from the header and refused over 64 megapixels before
anything is decoded. An EXIF orientation is applied; colour profiles are not read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Sheet images: a placement in the sheet's scene and its SVG (#5425, W38e-2)
Each image placed on a sheet is a group of the new kind `sheet_image`, between the drawing border
and the views, so a view's lines draw over a photo. `drawing_pictures` holds both that group and
the provider a writer asks for its pixels, so the two read the same placement.
The provider holds what one sheet uses, decodes a file when it is first asked, once however many
placements show it, and refuses a sheet whose files hold more than 64 million pixels, from their
headers, before anything decodes. `drawing.export` passes it to the SVG writer in place of
`NoPictures`, and a file that won't decode refuses its sheet by name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: pin the product image's output before it is drawn in tiles (#5624, W17b S1)
The decoded rows of five product renders (orthographic on a transparent background, perspective on a
solid one, a PBR surface, two glass layers sorted back to front, triangles crossing every edge of the
picture), taken on this tree. The next change reshapes ImageTask into a prepare stage, tiles and a PNG
sink; they must not move. The PNG bytes are not pinned: their compression depends on the deflate
backend the build unifies (flate2's zlib-rs when the UI crate is built alongside, miniz_oxide
without), not on this code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: pictures drawn tile by tile into any pixel window (#5624, W17b S1)
The CPU product renderer, reshaped so drawings can use it: one rasteriser (`Raster`) prepares a
scene once (appearances, projected triangles, glass sorted back to front), then draws each tile of
the picture on a canvas of its own. A sample's position comes from its whole-picture index, so tiles
put side by side are the picture drawn whole, to the byte.
- `ImageTask` (render.image) is that rasteriser over one whole-picture tile from the product camera,
then its PNG: the same output, pinned by the previous commit's rows.
- `PictureTask` draws a `PictureRequest`: a `Projection` (the product camera, or an `OrthoFrame`,
W17a's view frame as plain data: a `Plane` basis, a scale and a paper shift, on a
`geom::pixel_grid::PixelGrid`), any list of `PixelWindow` tiles, `Supersample::One` (pixel centres)
or `Two` (i + 1/4 and i + 3/4), a `BodyRole` per body (`DepthOnly` hides what lies behind it and
draws nothing itself) and an optional background (none: transparent). Each tile comes back as
straight-alpha sRGB RGBA rows, blended in linear light.
- The orthographic map is the frame's paper map, onto the grid, so lines drawn from the same frame
register with the pixels (to 1e-9 mm in the test).
- Limits: 65,536 px a side, no total cap; each tile under the resolver's `RenderLimits`, as the
product image is; at most 65,536 tiles; the prepared lists as a product image's; pixel tests up to
8 per sample of the picture (128 M for a product image, as before), counted at admission by the
one projection the raster uses, as main counts a product image's.
Not here: the drawing light, stored per-tile bins (S2, measured), the paper scene's picture item
(S3), 4x sampling, and `raster::render`, the snapshot rasteriser, which stays as it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: time the tile renderer (#5624, W17b S2)
An ignored timing test, as `simplify_timing` is: a 65,548-triangle front view drawn as the
product image, as one 300 dpi picture, and in 64-row strips at 300 and 1200 dpi, each the median
of three runs. It is the measure S2's speed-ups are judged by.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: a tile passes over a triangle outside it before painting it (#5624, W17b S2)
Each tile placed and painted every triangle of the picture, then dropped those outside it: the
appearance lookup, the PBR normals and the colour decode ran for every triangle in every tile. A
triangle's work is now three steps, `corners`, `look` and `place`. Preparation runs them in
today's order, so its checks and errors are the same. A tile places a triangle first and paints
only those inside it. What is drawn doesn't change: the pin and the tile tests stay as they were.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: one light per picture (#5624, W17b S2)
`raster::shade` normalised its key light and highlight directions again for every sample,
although both depend only on the view. `raster::Light` works them out once per view and shades
with them. The tile renderer and the snapshot rasteriser (`raster::render`) both use it, so the
product light is written in one place. The arithmetic is the same, so every pixel is too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: sRGB codes from tables (#5624, W17b S2)
Each shaded sample was stored as sRGB through a power (three per sample), and each output pixel
was averaged from its samples through twelve more and written back through three: the powers
were most of a sample's arithmetic. Decoding is now a 256-entry table of `geom::srgb`'s own
values (#7162), which also ends this file's own copy of the formula. Encoding counts the code
starts (the linear values halfway, in sRGB, between two codes) at or below the value. Within a
billionth of a start, where the formula's rounding could fall either way, `srgb::encode8`
decides, so every code is the one it gives. A test checks both against `geom::srgb` at every
start, the numbers around it, the band's edges and a million values in and outside 0 to 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: a tile's passes run in loops (#5624, W17b S2)
The raster went back through its step loop for every sample: the cancel check, the stage match,
the tile's window and its canvas bounds, once per sample cleared, tested or averaged. Clearing,
the opaque and glass passes and the downsample now each loop on their own up to the step's budget,
counting a unit as before; preparation and the glass sort still take one unit a call. A step
still checks for cancellation before each stage's run and still does at most 16384 units, so the
host's slices and the progress counts are the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: tests for a picture's light, glass order and test budget (#5624, W17b S2)
Three planted faults went through the image tests; each now has one
that fails:
- an orthographic picture lit from another direction than its eye: a
face square-on to the view is the colour the product image gives it;
- glass placed by a triangle's first corner, not its middle: a tilted
square whose first corners lie in front of the near one, its middles
behind;
- a picture held to the product image's pixel-test budget: a face
across most of an A0 sheet at 1200 dpi is prepared.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing sheets: a shaded view's picture on paper (#5624, W17 V9b)
A saved view in a shaded style draws on its sheet and in drawing.export:
draw puts one picture per entry of the view's parts under its lines, and
ViewPictures renders each on the writer's grid through the frame that
placed the lines. SheetPictures answers for a sheet's images and views.
The styles with lines stay refused until W06's exact lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: a picture's count of its tiles and its fixed limit, as #6483 has them (#5624)
A triangle counts only where it meets the tiles asked for, and a picture has a fixed 400 M pixel tests,
as #6483 at bf93e890e. V9b's stack holds an older copy of that slice; this drops away when drawings
takes main. PictureTask says what admission counted, for the view's running sum.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing views: a shaded view's pictures add up to one limit (#5624, W17 V9b)
A writer asks for a picture a band at a time, and each request is limited on its own, so ViewPictures
keeps what each view's requests have counted and refuses the next one past the limit, by name, before it
paints. That makes 400 M a bound on a whole view.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Kernel: the B-rep record and the native body file come from solidcore-record
SolidCraft's portable B-rep record (`solidcraft_geom::brep`: brep.rs, topology, history,
envelope, part, curve2) and the native body file (`solidcraft_kernel::native`: the tagged binary
codec and the container) move to solidcore's `solidcore-record` crate: geometry as data, with
structural validation and no maths (solidcore's docs/layers.md, stage 1). Every caller uses
`solidcore_record::brep` and `solidcore_record::native`; the old copies are deleted.
What computes from coordinates stays with the kernel, in geom's `brep`:
- `brep::check`: the record's geometric checks (orthonormal frames, non-degenerate planes,
unit revolution axes, non-singular placements). `check::validate` and
`check::validate_built` are the record's validation and these together, and every caller of
`Brep::validate` uses them, so what is accepted is unchanged;
- `brep::label`: a surface's natural ranges (a cone's apex), `curve_interval`,
`edge_curve_interval` and `form_turns`;
- `brep::pcurve::eval`: a pcurve's point;
- `geometry::check`, `placement::moved` and `split_edges` become functions on the record.
The kernel's native module keeps the conversion between a body and its saved record
(metadata.rs) and checks the decoded record's geometry. `native/analytic.rs`, which no module
declared, is deleted.
solidcore-record is pinned to its rev on solidcore's `layer-record` branch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NvoxKMbMFSQU8tzRtoJhtT
* Geometry: Vec2, Vec3, Plane and the profile types come from solidcore-record
The plain data of vectors and points, sketch planes and planar profiles (`Seg2`, `Loop2`,
`Region2`) moves to `solidcore-record`, with its constants and component-wise operators only
(owner decision, solidcore layer split). Their geometry stays in geom as traits:
`Vec2Geom`, `Vec3Geom`, `PlaneGeom`, `Seg2Geom`, `Loop2Geom`, `Region2Geom`, `Seg2ArcFit`,
`Loop2ArcFit` and `Region2ArcFit`, in scope with `use solidcraft_geom::prelude::*`. Every caller
names the types from `solidcore_record`; geom no longer defines or re-exports them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NvoxKMbMFSQU8tzRtoJhtT
* Kernel: pin solidcore-record to solidcore main f5e8e9a29
solidcore-record is merged on solidcore main (tangency-labs/solidcore#2519); its crate there is
identical to the rev pinned before but for its clippy configuration. The lock is regenerated
against the merged rev.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NvoxKMbMFSQU8tzRtoJhtT
---------
Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A stroke can carry a pattern, `Dashes { lengths_mm, phase_mm }`: dash and
gap lengths in turn, in paper millimetres, and how far into the pattern
the stroke starts. Without one a stroke is solid, and a solid stroke
reads and writes as before.
- Checks: 2 to 12 lengths, an even count, each above 0 and at most
1000 mm; the phase from 0 up to the pattern's length; at most a
million dashes along the stroke, counted from its pieces' own lengths.
- The walk puts the pattern on the writer's grid: a dash or gap under
half a step is one step, counted, as widths are.
- SVG: stroke-dasharray, and stroke-dashoffset when the phase isn't 0.
- PNG: tiny-skia's dashing on the flattened line; its points count
against the sheet's, a line in a gap draws nothing, and one tiny-skia
won't cut is refused rather than drawn solid.
- The paper fuzz cases carry a dashed arc.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
drawing.status says each view's status (current, out of date, placeholder or
failed, with why) from what the sheet page last drew, and each dimension's in the
words inspect uses, reading each body once for the call. Nothing is drawn.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>