The title block's text and a dimension's text each chose for themselves between waiting for the
search for fonts to fall back to (an export, drawing.inspect) and asking it (the window's sheet),
then each mapped the answer to set, pending or refused. That rule is now in one place, in sketch
beside the fonts: PaperFonts holds the drawing's family and language with the font folders listed
once, and sets lines or text the waiting or the asking way; Outcome is the one mapping of its
answer. The title block's lay and the dimensions' paper_group take a PaperFonts, made once for
each block and each read of dimensions. Nothing else changes: the same text in the same fonts,
pending and refused in the same cases. A parts list's words on paper will use it too.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
PartsList::rows gives each row of a bill of materials with its values formatted, each followed by the
rows listed under it. The item comes from the rule a balloon reads, so the two can't disagree. A mass
follows the list's unit and decimals and a length the drawing's units; a value a row hasn't got is left
out, for the table to mark. A nested row's quantity is how many are in one of its parent, and `count`
has them all.
A row's key names each member, so one part listed in two places keeps two keys, and the limit is now
2048 bytes to fit the 65 members of the deepest list. The plan's "item with its padding" has nothing to
do: no padding exists. The text measure goes with its first caller, the sheet's tables (P8b).
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing export: a sheet exported to a file runs in the background, like the view DXF (#4890 EX2)
A sheet exported to a file through the control channel was drawn and written on the window's
thread, so a large PNG at a high dpi held the window up until it was done. `drawing.export` with a
`path` now goes through `file_load` as `Kind::ExportSheet`, beside the view DXF's `ExportDxf`: on a
copy of the design, off the window thread, with an "Exporting sheet" card. Without a path the
reply holds the document, so it runs at once as before. Cancel on the card says which export it
stopped: it said "DXF export cancelled" for every export while the view DXF was the only one.
`Kind::exports()` holds what the two export kinds share (the copy, never adopting the worker's
session, Cancel waiting for the worker, a drop cancelling it, a finished export staying finished),
in place of seven `ExportDxf` tests and a check on the command's name.
`paper_png`'s band loop reports its rows to the current `solidcraft_kernel::watch` and stops
between bands once it is cancelled. The command writes the file only after the PNG is complete, so a
cancelled export writes nothing. With no watch, every other caller, the bytes are unchanged.
`drawing.export`'s checks and write, its commands and its schema are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing export: a held sheet exported in the background has its views, as on the page (#4890 EX2)
A sheet exported to a file runs on a copy of the session. `Session::scratch` leaves the copy's
drawing-scene cache empty, so a deferred drawing that was held (the model changed since its last
`drawing.update`) exported from the copy with no views or dimensions. The same export without a
path, on the window's session, wrote the lines the sheet page shows.
`Session::scratch_as_shown` is `scratch()` plus `Cache::shown_copy`: the world state the cache last
updated against, each view's and dimension's last drawing, and the serial they were numbered to.
That is what `as_shown` reads. The lines kept for closed drawings, the last answer and a request in
flight stay out, since only the window's page uses them. `file_load` takes that copy for its two
export kinds; inserts, updates and opens keep `scratch()`, which is cheaper and never draws a sheet.
Tests: the engine compares the export (svg and out-of-date list) from the session and from the copy
for a drawing that isn't deferred (also after a view's edit), a deferred one with a view edited
since its update (drawn at once), and a held one, its dimension included, on the sheet last shown
and on a second sheet. The window
test writes a held sheet through the background export and compares the file with the synchronous
export.
Co-authored-by: theironchef <6278036+theironchef@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: theironchef <6278036+theironchef@users.noreply.github.com>
* Drawing text: a font search that stops part-way no longer leaves text waiting for the rest of the session (#4890)
The search thread clears its running mark only when it ends normally. If a search stopped
part-way (a panic), the mark stayed set: nothing was searched again, and text needing a fallback
font waited for the rest of the session. The thread now holds a `Running` mark; dropped before it
finishes, it clears the mark, and what it held or was asked meanwhile is answered as a miss, so that
text is set as no font has it. A character asked for next starts a search of its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing text: a font search that stops part-way answers what it held under the same lock that clears its mark (#4890)
Drop for Running cleared the running mark and answered the held queries as misses under two
locks. Between them, a request for one of those queries found no answer and no search running,
and started a new search for it: the query that may have stopped the search was searched
again. Both now happen under one lock. store keeps its shape and shares store_in with the
Drop, so the cap on kept answers stays one rule.
Found and fixed by @theironchef in review.
Co-authored-by: theironchef <6278036+theironchef@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: theironchef <6278036+theironchef@users.noreply.github.com>
* Paper scene: what a font adds to a table, a run's reach, and text in the sheet reply's schema (#4890)
One rule for everything that puts text on a sheet: `Scene::font_records_beyond`
counts only what a scene's font table doesn't hold yet, `TextRun::reach` says
how far a run's glyphs go along its baseline, and `drawing.scene`'s schema has
text runs and fonts, never a font's bytes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Paper scene: a font's records are found by its id, not by its place in the table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing dimensions: their numbers on the sheet, in the drawing's font (#4896 W19h)
A dimension on a sheet now carries its text: each value is set in the
drawing's font and language, measured, and placed along the dimension's
text direction, reading from the bottom or the right. Arrows flip by the
measured text width. A text the font can't set leaves the lines and says
why. The scene adds each dimension's fonts to its table once, counting their
records against the scene's limit, and measures text by its outlines for an
object's bounds. A dimension is read again when the drawing's units,
language or font change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing sheets: a title block's labels and values set on paper (#4890 B3, #3875)
Each label is set as one line at its place, and each text cell's value in its
value box by the cell text rule, broken between words to the box's width when
its fit wraps, in the drawing's font and language. What doesn't fit is shown
whole and noted; a text no font can set is left off the sheet and noted with
why, so the sheet and its export never fail over one cell. drawing.inspect
lists each cell's notes; the sheet scene sets what was measured.
What a cell shows is worked out in one place for drawing.inspect and the scene.
The block's fonts count toward the scene's records with the border, so no view
takes them, and the scene is drawn again when the design or a cell's text
changes.
Ported from the personal PC's 1951bc696 onto today's drawings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Sheet scene: a title block's text set once while its sheet fills in, and its faces in the key (#4890 F5)
The sheet scene read its title block's fields and set their text again on
every extract that missed its last answer, and views are drawn one a tick,
so a sheet filling in weighed the documented component and laid out the
block once for each view drawn. The text is now kept with the last scene
and set again only for another sheet, drawing, design, model or lettering.
A scene is reused only for the same faces too: one family name can mean
another face once a font is installed or removed, and that face is another
scene. A family with no face is set in the built-in font, so it stays the
same scene until it's found.
Ported from the personal PC's d82fd03e7 onto today's title block text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Sheet text never waits on the window's thread: a title block's and a dimension's text wait for no font search, and inspect names the fonts fallen back to (#4890 F7)
A text in a script the drawing's font lacks needs a search of the installed
fonts. The window's sheet (`drawing_scene::extract`, `step` and the view's
job, on the UI's tick) now asks the search's thread instead of waiting for it:
- sketch: `paper_lines_now` beside `paper_lines_in`, as `paper_text_now` is
beside `paper_text_in` (FontPending until the search answers).
- title block: `title_block_text::lay(.., wait)`. A text whose font is still
being looked for is off the sheet and marks the `Laid` as `pending`, never as
refused. While the last scene's block is pending, the fast path and the
text's reuse both miss, so `extract` sets the block again until the search
has answered.
- dimensions: the same rule for a dimension's number (`paper_group(.., wait)`,
a `wait` flag on `draw_dimensions`). The step, its dimension step and the
view's job (#11126) all ask; a dimension whose text is pending is kept as
pending, and `extract` reads those dimensions alone again
(`set_waiting_dimensions`), keeping each one only once its text is set.
- `SheetView::waiting_for_fonts` says when text is still waiting. `step` does
not: pending text has no lines to draw again, so a `true` from it would spin
on no work.
- `build` (export, `drawing.scene`) and `drawing.inspect` wait, so their
answers are whole. `drawing.inspect` adds `font_fallbacks`: which font set
each script of the title blocks' text that the drawing's font lacks
("Kana set in BIZ UDPGothic").
The scene tests' `settled` asks as the window does (extract, then steps,
until neither has more to do), with a time bound.
Ported from the personal PC's cae4a2969 onto F5; the dimensions' half is new
(one rule for every text the window's sheet sets). On `drawings` f50edc1ed:
`draw_dimensions` takes #12516's (frame, line group) pair as well.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Adding one on a part the view's saved settings leave out (its hide, or a source that doesn't
choose it) is refused, naming the view and the setting, and the parent view when it set it. One
added before a later view edit stays, and its inspect reply warns until the edit is undone.
The rule stays the view's own (`chosen`): `left_out` asks it about one occurrence path and says
why; `check_drawn`, `not_drawn` and `drawn_warning` beside the view commands use it for the three
annotations. `DimensionKind::paths` and `Anchor::path` list what each points at, so every kind of
dimension is checked. No model is evaluated.
On drawings a7c0310ab, #12516 (line groups) gave a resolved setting two more setters, the
view's sheet and the drawing. The words for where a setting was set are one function, set_on,
with an arm for each: a parent names its view, a sheet and a drawing say so, and a view's own
setting and the default add nothing. Hide and the chosen occurrences come only from a view's
chain today, so no refusal says "its sheet" yet; the match keeps the compiler checking each
new setter.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A script that calls drawing.create or drawing.set with a misspelt setting now gets an error
naming the setting. Before, the call reported success and the setting was lost. The two
commands now read their parameters through input schemas, like every other drawing command.
- schema/drawing.rs gains DrawingCreateParams and DrawingSetParams. Each field's reader keeps
the refusal words the hand readers used.
- The hand readers for units, projection, updates and revision_numbering move into the schema.
- The drawing's line_group reads through cmd::line_group_of, so it keeps its sheets' words.
drawing.view.edit is unchanged.
- The output types are their own slice.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Straight after a drawing opened again, drawing.status said out_of_date for views whose kept lines
still show what the model shows, and drawing.update counted them as waiting. The first extract then
found them up to date and drew nothing. status read the cache as it was: the kept lines came back
and the keep pass ran only inside extract and the drawing step.
One function, catch_up, now brings the cache to the drawing open and the world state: the kept
lines come back, then each view that shows the same takes the state. extract, step, begin and
drawing.status (and so drawing.update) all start there, so each says the same of a view.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Drawings: views drawn beside the window (#4892 B7)
`drawing_scene::begin` asks for the first view out of date, `Job::run` works
its lines out on a copy of the session (pending moves cleared: the design's
placements, as dimensions use), on any thread, and `finish` takes them only
for the latest request while the revision, the model's world state and the
view as it resolves are as they were; `cancel` forgets the request. Request
numbers come from one counter for every session, so a drawing closed and
opened again never takes an old job's lines.
A job carries what `step` draws in one swap: the view's lines, what they
show, and the view's dimensions through its new frame. `step` and `begin`
start from one helper, so both keep the views that show the same and both
draw nothing while a deferred drawing holds. `step` is the same three run at
once. The window's hook is `drawing_jobs::tick` (the shape of `save_job`): no
caller yet, no UI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawings: a built sheet leaves uncaptured moves out too (#4892 B7)
`build` (every export) draws the parts where the design places them, as the
provider's jobs do: one rule for lines, dimensions and files, and once
nothing waits the provider's scene is still the built one. Exports change
only while an occurrence move isn't captured.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawings: the window reads a sheet's dimensions too, once no view is waiting (#4892 B7)
Sheets now read their dimensions after their views (`drawing_scene::step`). Drawing views beside
the window went through `begin`, which asks only for views, so with every view drawn the
dimensions out of date were never read. With no view waiting, `tick` now steps on the window as
before; reading dimensions is quick. The tick test adds a dimension and ends with none out of date.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A drawing saves the ISO 128 line group its views and dimensions are drawn
in; a sheet or a view may save its own. A view's group is resolved like its
other inherited settings: its chain, then its sheet, then the drawing, and
inspect says which gave it. The group joins the display settings a projected
view follows. drawing.create and drawing.set take it; the sheet commands and
drawing.view.edit take it or null to follow.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A drawing's views follow the model automatically, or, when deferred, only on
drawing.update, which lets them draw from the model as it is now, for this
session only. The next model change holds again, and a close drops the update,
so a reopened deferred drawing waits. While it waits, its views show their last
lines, out of date.
drawing.set and drawing.inspect take and say `updates`, saved only when
deferred (a drawing-format pending note). drawing.scene, its hit and line
commands and drawing.export read what the page shows and list what is out of
date; drawing.status says held.
The ribbon's Update Drawing button stays planned as drawing.update.planned with
its art awaiting review, as Export does; the command itself takes the existing
update icon.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A view's entry keeps what it was drawn from: each body of the world state by
its occurrences, name, reference mark and geometry key. A view drawn from a
world state that showed the same takes the new one and draws nothing, so a
sketch, or an edit taken back, projects no view.
A drawing closed keeps its views' lines in the sheet scene's provider, and
opened again starts from them: with nothing changed it draws no view, and with
the model changed its last lines show, out of date, until drawn. Dimensions are
read again. Only in memory, never saved; a deleted drawing's lines go with it.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Drawings: which line of a view is under a point, and drawing.scene.line (#4816)
A view's group now keeps what drew each of its strokes (the body, and the edge or silhouette of it),
one entry per item with none for its pictures, from the same walk that paints the strokes
(paper_lines). line_at finds the view under a point (hit, over the views alone), then the nearest
of its strokes within a band, the one painted later of two as near, and names it as
drawing.view.snapshot names its lines (one From<Source> for both). drawing.scene.line draws the
sheet's views out of date first, as the page does, and evaluates nothing. The two tests that built
the two-part design inline now share one fixture.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawings: a pressed line names what drew it on each placement (#4816, #4892 Re)
A test: a round bar placed twice. A press on either one's outline names the silhouette's face
through the occurrence pressed, and a press on its top names the top rim's edge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The sheet page draws through the provider, which brings one thing up to date per tick. After a model
change it drew a view's new lines in one step and that view's dimensions in a later one, so for a
step the old dimensions sat on the new lines. `step` now reads the view's dimensions through the
frame it has just drawn and keeps them in the same swap; an edited dimension is still read alone and
projects nothing.
Keeping drawn dimensions is one method, `Cache::keep_dimensions`, which the view step and
`step_dimensions` both call. The same reads happen as before, a step earlier.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A sheet's text is drawn from the same glyph outlines the SVG writer fills,
filled nonzero so a glyph's overlapping contours fill whole, where the PNG
writer refused any text before. Text counts toward the point cap and is
drawn band by band like any fill, in every colour.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
paper_lines measures a text for paper in the drawing's font and language:
its lines, each with its width, and the pitch between them, broken at each
line break and, given a width, between words (a word is never cut, so a
one-word line may be wider). A word the font lacks is measured in the font
it falls back to. PaperLines::set only places what was measured, and
paper_text is paper_lines then set, so one rule measures and sets text.
Ported from the personal PC's abefb3713 onto today's fallback fonts.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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>
#12170 added drawing.balloon.repair and drawing.dimension.repair without a
line in tests/kernel-cases/EXEMPT, so the kernel rig's coverage check now
fails on every drawings pull request that runs it ("NO CASE"). Like the
other drawing commands, both are tested in their area's test files
(drawing_balloon_tests.rs, drawing_dimension_tests.rs), so each gets the
same line, in sorted order.
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>
The web covered Japanese only (F6): any other script on a drawing was
refused. Now each script the web covers has its own font, fetched once
from the web app's origin the first time a drawing's text needs it:
- kana and Japanese Han: BIZ UDPGothic, as before;
- Hangul and Korean Han: Noto Sans KR;
- simplified or traditional Chinese Han: Noto Sans SC or TC;
- Arabic: Noto Sans Arabic.
Han takes the font of whose Han the text wants (Han::of, the desktop's
rule), so a drawing in English with Han asks for the simplified Chinese
font, as a desktop does; F6 sent all Han to the Japanese font. A text in
two scripts waits for both fonts; one whose fetch failed is refused by
name, and the rest sets. Thai is still refused by name (Hebrew is in the
built-in font).
The four fonts and their licences are unmodified, in assets/fonts/<family>/
with ATTRIBUTION rows, and trunk copies each to fonts/<family>/. Four
files rather than one CJK collection: a session fetches only its own
language's font (4.6 to 8.3 MB), where the collection is one large file.
The folder the web app fetches fonts from is named once (FONTS), and a test
checks that index.html copies each font from its asset into that folder.
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>
The rig's "Every command has a case" check failed on drawings for the ten
commands #11898 added. Each is tested in crates/engine/src/cmd/drawing*_tests.rs,
as the other drawing commands are, so they join them in EXEMPT.
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>
* geom/hlr: per-curve work on worker threads, shared work limits
Silhouette tracing, screen sampling, shadow cuts, classification, coverage and
the crossing search (by grid rows) with crossing refinement run on worker
threads through one ordered map: results go back in item order, so drawings
are the same bit for bit on any number of threads. Options::threads picks the
workers (0 = one per core, small views stay on the calling thread); the
browser build stays serial. Placements sharing a body and a turn share one
silhouette tracing.
Cancellation is polled before every item and inside long ones from every
worker; the first error stops the others; a panicking worker becomes
HlrError::Internal instead of escaping. Ray, curve, crossing, shadow and
coverage budgets are totals over all threads (shared counters; crossing pairs
are counted before the search).
Limits: placements and the default max_tracks are hlr::MAX_ITEMS, which is
section::MAX_ITEMS (also the brep record limit); trim_samples must be 1..=4096.
* docs/drawing-hlr: link the parallel-work PR
* geom/hlr: clearer limits and parallel-work docs, faster thread tests
docs/drawing-hlr.md now separates input limits (with the error each returns:
body records fail with Invalid, not Budget) from the work budgets, names every
budget's error, and states how errors and panics behave on worker threads.
Code comments say the same in plainer terms. The budget and cancellation
tests drop the oblique torus, and the freeform pass of the identity test
compares one parallel run, which keeps the HLR suite under 4 s.
* geom/hlr: poll cancellation inside long items, find spline spans by bisection
Review found two items a worker could run for seconds without seeing a
cancellation: tracing a body with many curved surfaces, and sampling one long
spline (up to 4096 control points). Silhouette tracing now asks before each
surface, screen sampling at every refinement pass, the cuts at left-out faces
every 4096 chords and coverage every 65536 checks.
The long spline was slow because every point and every part hull scanned all
of its knot spans. de Boor evaluation now finds its span by bisection over the
ordered knots, and a part's hull starts at its first piece and stops after
its last: the same spans, so the same bits (checked on the fixture scenes),
and a 4096-point spline edge prepares in 0.9 s instead of 2.2 s and samples
in 0.23 s instead of 1.47 s.
* geom/hlr: poll cancellation while forming and trimming silhouette sets
Review found that forming a body's silhouette sets scanned each face's whole
surface group before the first poll, quadratic in the faces on one surface
(about 4e8 steps for 20 000 faces). The group scan now stops at its first
supported face (groups list faces in order, so that is the same face), the
loop polls every 256 faces, and trimming a traced curve asks before each
face. A cancellation seen while trimming drops the partial curves, even if
the callback answers false later. Output unchanged on the fixture scenes.
* geom/hlr: poll cancellation per boxes met when cutting at left-out faces
Review found that one chord crossing the screen boxes of very many left-out
faces bisects every side without a poll (polls came only every 4096 chords).
It now also polls every 1024 boxes met. The docs state the cancellation
contract precisely: polls are where listed, and the work between two polls is
bounded by the input limits rather than by a time.
* docs/drawing-hlr: say where coverage polls cancellation
* geom/hlr: body records have brep's own, larger limit now
Main raised brep::MAX_ITEMS to 1 000 000 (#3093, which stores whole evaluated
models), so it no longer equals section::MAX_ITEMS. hlr::MAX_ITEMS stays
section's 100 000 for placements and the default curve budget; the docs and
the limits test now say that a body's records are bounded separately, by
brep's limit.
* geom/hlr: a panicking worker stops the others; the ray budget is HLR's own
A worker that panics now sets the shared stop flag while it unwinds, so the
other workers end the phase early instead of finishing work the call throws
away. The docs no longer compare the ray budget with the occlusion work
budget of file.export_view_dxf: the two count different work.
* geom/hlr: an ignored timing test, prepare and drawing timed apart
hlr_timing prepares four bodies, then draws 100 differently turned placements
on one thread, two workers and one worker per core, printing the total, the
phase timings and the ray count. SOLIDCRAFT_BENCH_HLR sets the placement count.
* geom/hlr: timing scenes for sharing and crossings; placements keep their lines when permuted
hlr_timing now starts its prepare clock after the fixtures are built, adds the
same grid at one turn (shared definitions against one per placement) and
sixteen thin bars crossing 8x8 from above, rotates the thread order over three
rounds and checks the drawings match across thread counts outside the timed
part. A new test permutes three placements of one prepared box and removes one:
each line keeps its own placement index, and the boxes' lines stay exact.
* docs/drawing-hlr: the review's limits and fixtures in the parallel tables
* geom/hlr: follow the B-rep record into solidcore-record
The record, its version and its item limit now come from solidcore-record
(#11496): the new tests build their bodies at `solidcore_record::brep::VERSION`
and make a spline's curve with `C3::bounded`, as the other fixtures do, and
the limits table gives the record's own limit, 4 000 000 items, checked by
`brep::check::validate`.
---------
Co-authored-by: MateuszSychXpl <151755914+MateuszSychXpl@users.noreply.github.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>
Picker::placed, face_corners and BodyEdges::new decide with the display mesh.
They are listed on this branch only and must be cleared before drawings lands
on main, where the list takes no new lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The kernel rig's coverage check exempts the drawing and bill of materials
commands, each naming where it is tested. The mesh decisions check follows the
view line modules to mesh_lines/, and skips the two that only draw and count a
drawing's view lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Sketch: constraint icons stay while the sketch fills the view (#10518)
Constraint glyphs hid as soon as a millimetre of the sketch plane drew smaller than two pixels
(#8980), whatever the sketch's size, so a 500 mm sketch zoomed to fit lost every glyph although
it still filled the view. Below that scale the glyphs now hide only while their anchors span
less than twenty glyphs (300 px) on screen: a small sketch far away still loses them, a large
one that fills the view keeps them. The preference "Hide constraint glyphs when zoomed out" is
unchanged; off, glyphs stay at every zoom as before.
Test: constraint_glyphs_hide_when_zoomed_out adds a 500 mm sketch that keeps its glyphs zoomed
to fit and loses them far away; glyph_zoom_tests covers the span threshold.
* Sketch: glyph span measures only drawn glyphs and stops at the threshold (#10518)
The span check now walks the same constraints the glyph pass draws (one MidPoint glyph per shared midpoint, a pattern's constraints once) and returns as soon as the bounds reach MIN_GLYPH_SPAN_PX, so a large sketch zoomed out costs no more than before.
* Sketch: filter glyph constraints lazily, midpoints in a set (#10518)
* Sketch: measure the sketch, not its glyph anchors, before hiding glyphs (#10518)
* Sketch: collapse the midpoint check into one if (#10518)
* 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: #11303
* Keep Browser and History row interactions independent
* Browser tests: use solidcore_record::Vec3 after the layer split
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>
rfd opens file dialogs through the XDG desktop portal and falls back to zenity
when there is none. The flake's package didn't bring zenity, so on a system
without a portal or zenity, Open and Save showed nothing. The wrapper now adds
nixpkgs' zenity at the end of PATH, after the system's own.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Measure: show complete point coordinates (#11069)
Render measurement item details as wrapping text instead of fixed-height cells. Keep the existing values, units and precision. Add a regression test in the existing measurement UI test module.
Local validation: the regression test compiled, but the Windows GNU test binary crashes with 0xc0000005 even for --list, before tests run. Runtime verification and visual evidence remain pending; this contribution is a draft.
* Keep repository LF line endings in the coordinate fix
* 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>