* Viewports keep their own UCS and their other settings through save and copy (part of #1316)
A layout viewport's own UCS and every setting CADCraft doesn't model
were dropped on read, so saving a sheet set lost them for good.
- Viewport::ucs (origin, X/Y axes, elevation, orthographic type, named
and base UCS by name) and ucs_per_viewport (UCSVP), read from and
written as VIEWPORT groups 110-112, 146, 79, 345/346 and 71.
- Viewport::extra: the viewport's other groups as read (snap, grid,
lens and clipping, render mode, plot style sheet, shade plot, visual
style, background, lighting). They belong to the entity, so COPY and
MIRROR carry them; dxf_raw::finish writes them before the xdata and
points their references at what they named (ForeignExtra::tail).
- Not carried raw: the view twist, direction and target (51, 16, 17),
which say where the view centre is measured from; writing them back
while the centre is in drawing coordinates would move the view.
- DWG: the bridge drops 345/346, the plot style sheet, shade plot and
lighting groups, so CADCraft xdata keeps a copy (VPUCS, VPEXTRA) that
the reader falls back on. The visual style, background and shade plot
references are still lost through DWG (file-format-parity.md).
- A UCS with unreadable or zero-length axes is no UCS; a named UCS
that's no longer in the table isn't pointed at.
Tests: another program's viewport read; DXF save and reread; two DWG
round trips; a copied viewport; a deleted named UCS; a viewport without
a UCS written as before; hostile groups (5000 extras, NaN axes, bad
handles); COPY and MIRROR through the engine.
* Viewports: VPEXTRA keeps only a viewport's own groups; a base UCS handle alone is kept
- CADCraft's VPEXTRA xdata copy of a viewport's unmodelled groups is
merged only for groups that can stand inside the AcDbViewport subclass:
a record start (0), handles (5, 105), a subclass (100), a group brace
(102) or xdata (1000 on) from a crafted file are dropped, so a save
can't write records or handles the user didn't draw.
- A VIEWPORT whose only UCS group is its base UCS handle (346) now reads a
UCS, so the base UCS is resolved and written back.
* Viewports: drop structural groups from a record's own extras; index UCS names for the xdata fallback
- A VIEWPORT's own AcDbViewport groups are kept raw only when they can
stand in the subclass, as CADCraft's VPEXTRA copy already was: a second
handle (5, 105) or a group brace (102) written back would give the
record two handles. The record's own pointer groups stay, to be
remapped with it.
- The named and base UCS that CADCraft's xdata names are looked up in a
case-insensitive index built once with the UCS table, not by scanning
every UCS for each viewport.
* Parity checklist: regenerated after merging main
* Parity checklist: regenerated after merging main
* Parity checklist: regenerated after merging main
* xtask: take main's stats.rs (the merge kept a test import Linux clippy rejects)
* Viewport tests built on main set the UCS fields
* WIP row 74: Codex's test edits kept; production normalisation (identity UCS -> None, default-valued extras dropped in dxf_read viewport_ucs/viewport_extra) still to do
* Viewports: a default viewport reads back with no UCS or extra groups (#1484)
A DWG save writes an identity UCS and the default snap, grid, lens, clip,
render and shade groups for every viewport, so a viewport nobody gave a UCS
came back with one and a dozen extras. The DXF reader now reads an unnamed
identity UCS (UCSVP 0) as none, and keeps a group in extra only when it
differs from the defaults, listed in one table. Tests: a_default_viewport_reads_back_without_ucs_or_extras,
a_viewport_with_non_default_snap_keeps_it; layouts_and_paperspace passes.
* Viewports: clippy range patterns; raster_image test builds with the viewport's UCS fields
* Tests: move the viewport UCS suites into the it entry points (#1316)
viewport_ucs_roundtrip.rs and viewport_ucs_copy.rs were separate test
binaries; AGENTS section 30 wants the existing entry points. All 12 DXF/DWG
persistence tests and the COPY/MIRROR tests are kept.
* Tests: move the viewport UCS suites into the it entry points (#1316)
viewport_ucs_roundtrip.rs and viewport_ucs_copy.rs were separate test
binaries; AGENTS section 30 wants the existing entry points. All 12 DXF/DWG
persistence tests and the COPY/MIRROR tests are kept.
---------
Signed-off-by: FredApps <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: SBaksa <[email protected]>
Co-authored-by: FredApps <[email protected]>
* Expose xdata through entities, properties.set and AutoLISP's -3 group
An entity's extended data was read, kept and written back (#528) but
invisible to the API: `entities` left it out, `properties.set` had no
field for it, `entget` never returned the -3 group and `entmod` dropped
it. Now `entities {xdata: true | "APP"}` and `properties` list it per
application with values typed by group code, `properties.set {xdata}`
replaces or removes one application's data after checking codes,
values, braces and sizes, and AutoLISP's entget/entmod/entmake carry
the -3 group, with `regapp` and the APPID table. The applications
CADCraft writes from its own model are reserved (one list, now in
cadcraft_doc, shared with the DXF reader).
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Check xdata before any change in properties.set; cap entmake's xdata across applications
Review follow-ups on #2469:
- properties.set validated xdata after ensure_layer, so a request naming a new
layer and carrying bad or oversized xdata left the layer behind on failure.
The xdata checks now run first.
- entmake capped each application's groups but not their sum; an entity could
exceed MAX_XDATA_GROUPS across applications. The total is checked as entmod
already does, with a test.
- docs: the control-protocol xdata section is an h2 like its neighbours; the
file-format-parity revision row no longer has a pipe inside a code span.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* properties.set checks every handle first; a dotted -3 group is a bad list
Review follow-ups on #2469:
- properties.set edited the objects before a handle that names nothing and
then failed, keeping those edits (and a new layer). Every handle is checked
before anything changes; a missing one is refused with its hex.
- xdata_from_list read `(-3 . 7)` as "no applications" and let entmake/entmod
succeed with nothing set. A -3 whose cdr is not a list is refused (listp),
so both return nil as for any bad list.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* An xdata application's groups must be a proper list
Review follow-up on #2469: `("ACME" . 7)` in a -3 group read as "no groups",
which `entmod` takes as "remove ACME's data", and a dotted tail after real
groups was dropped. The application's tail is checked as a list (listp) like
the -3 group itself, so entmake/entmod answer nil and change nothing; test
covers both shapes.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Runs of one xdata application in any case are one application in the API
Review follow-up on #2469: a file can carry `ACME` and `acme` runs on one
entity. `entities` showed them as two JSON keys and `entget` as two lists, and
writing either back through properties.set or entmod replaced the application
twice, keeping only the last run's groups. Both projections now merge runs
case-insensitively (first spelling, all the groups), as set_xdata_app already
treats them; tests round-trip such an entity through both APIs.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Refuse raw ACAD xdata on a dimension, whose ACAD run is written from its overrides
Review follow-up on #2469 (austin62jake): properties.set accepted
`xdata: {"ACAD": …}` on a dimension and `entities` showed it, but the DXF
writer emits the dimension's ACAD run (DSTYLE) from its overrides and the
reader models it back, so the raw groups vanished on save. ACAD can't join
RESERVED_XDATA_APPS (files carry ACAD data on other entities that CADCraft
keeps raw), so the rule is per entity: `is_model_xdata_app(name, kind)` is
the reserved list on any entity plus ACAD on a dimension. properties.set
refuses it before anything changes, entmake/entmod answer nil. Tests cover
both paths, including that ACAD on a line survives a DXF round trip and the
dimension's own override does too. control-protocol.md says so.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* fix(lisp): return and accept REAL for xdata group 1071
---------
Signed-off-by: FredApps <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: FredApps <[email protected]>
Co-authored-by: FredApps <[email protected]>
* Options: preview and selection effects in Visual Effect Settings
Selection Preview Effect (Dash / Thicken / Both, PREVIEWEFFECT) as AutoCAD
offers it, and Selected Objects Effect (Dashed / Selection color,
SELECTIONEFFECT), so neither has to be typed. They stay off the Selection tab
itself.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Options test: each Visual Effect Settings choice sets its variable
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Tests: the visual effect test sets up the app's headless runtime, as main's UI tests now do
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Translations to craft-i18n (AGENTS.md rule 16)
The Greek and Ukrainian rows this PR added to the app catalogs are removed; the
English keys stay, and show until craft-i18n has them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Cody Vogt <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
A solid hatch, wide polyline, wipeout mask or filled glyph reached the PDF
writer as a triangle list, and each triangle became its own closed subpath.
The writer now cancels edges that two triangles share in opposite
directions and chains what is left into closed loops, written as one
nonzero fill. The winding number at every point depends only on the net
directed edges, so the filled area is the same for overlapping, mixed-
orientation, zero-area and T-junction triangles; vertices are matched by
the exact bits of the f32 coordinates written. O(n log n) time, O(n) memory,
no recursion.
For a 400-vertex solid hatch with a square island the page content stream
goes from 30,086 to 9,922 bytes (457 to 3 subpaths) and the compressed file
from 5,874 to 4,223 bytes.
Co-authored-by: Claude Opus 5.5 <[email protected]>
A value of nothing but underline and overline toggles (%%u%%u) has no drawn
character, and the box floored the count at one: Aligned over a span of 20
that was a box of 20 by 120 for text that draws nothing. The box is empty
when no character is drawn, for an empty value too.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
main now carries #3594 and #3622 (landed through #3692), which rewrote
clip_prim around Limits and the pieces/fill closures. The only conflict is
that block in crates/render/src/viewports.rs: main's clip_prim is kept and
its Clip::Poly fill arm gets this branch's one line, so both truncation
signals stay:
- #3594's whole() in the fill closure marks the list when the clip stops
at the room left or at its own 6,000,000-point stop;
- may_leave_out marks it when the clip region's own triangles stopped at
the fill cap (#3636).
truncated is only ever OR-ed, so neither signal clears or doubles the
other.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main (PR 3679) mirrors the box of Backwards and Upside-down text about the
point the text is placed by. This branch builds the box from a bottom and a
top instead of an offset and a height, so the mirror is applied to those
corner points.
Tests: the two helpers (ours with a vertical justification, main's with the
mirror flags) are one that takes both, and the test of the vertical
justifications also runs with each mirror.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Land #3628, #3583, #3625, #3617, #3248, #3221, #3287, #3259, #3232, #3291, #3679: Drawing Units dialog, SCALE and MOVE base points, TRIM/EXTEND Shift, mirrored hatch patterns, layout framing, deep zoom, RECTANG X/Y, Save As version, Turkish, TEXT backwards
The box took the length of the stored value, control codes included: the
%%u and %%o toggles draw nothing, %%d, %%c, %%p, %%% and %%nnn draw one
character, \U+XXXX draws one, and invisible formatting characters take no
room. So the width was over-estimated again for such text: Aligned
"%%uAB%%u" at height 1 over a span of 20 is drawn 12.5 high in a box of
6.25. The callers now pass the number of drawn characters.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The point arm repeated require_length's check and message inline; it now
calls the helper, as the Reference length already does, so the two paths
keep one threshold and one error.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bottom justification lifts a line by a third of the height it is drawn at.
The box used a third of its own height, which is the most the line can be
drawn at, so the box began above the bottom of the text: "I" over a span of
20 is drawn from 20 to 80 and its box began at 40. The box now runs from
where the shortest possible line would start (from the widest width the
stroke font gives the line) to where the tallest would end.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Two findings from the landing review of #3506.
Text of next to no width is left as it is by the fonts. The box applied
that cutoff with a margin, so for a height of 1e-7 and a width factor of
1e-5 it still scaled the text over its span: a box about a million units
high. It now uses the fonts' cutoff as it is.
Aligned text is scaled by span / shaped width, and the box divided by the
widest width a line can have, so narrow letters were drawn taller than
their box: "I" over a span of 20 is drawn 60 high in a box of 22. The
height now comes from the least width the stroke font gives a line.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
A test that the extents of backwards and upside-down text over two
points are the plain text's extents reflected about the first point,
as the drawn text is.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Per review: the 40 Italian rows go to a translation-only PR.
it.tsv is back to its state on main; this PR keeps only the
dialog wiring and the English keys.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keeps both sides in text_box (main's fitted height and rotation, this
branch's mirroring) and sets the two flags on the Text literals main
has added since.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The multileader DWG test that waited for craft-libs#2005 (ignored) now runs:
its scales and paper text height come back through DWG from CADCraft's own
record, and the DWG holds no multileader contexts. The contexts' round trip
through DWG follows with the bridge.
FredApps on #1362 (rule 31).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A save through the DWG bridge writes no annotation scale contexts now: the
bridge doesn't convert them yet (storytold/craft-libs#2005), so CADCraft's own
record carries the scales, as for an older format. DXF from 2007 on writes the
contexts as before.
The DWG test that waited for craft-libs#2005 (ignored) now runs: the scales,
paper height and rotation come back through DWG from the record, and the DWG
holds no contexts. The contexts' own round trip through DWG follows with the
bridge.
FredApps on #1362 (rule 31).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The DWG bridge doesn't carry annotation scale contexts into a DWG yet
(storytold/craft-libs#2005): the DWG reader read them back as zeros, a
reference at scale 0 at its other scales. A save through the bridge now
leaves the kept block reference and attribute contexts out, as before they
were kept, and the block's AcadAnnotative flag too (without its references'
contexts AutoCAD would scale them by the annotation scale once more). DXF
keeps both.
The DWG round-trip test that waited for craft-libs#2005 (ignored,
a_reference_s_contexts_survive_dwg) is replaced by one that runs: a DWG save
leaves the contexts out and the reference reads back at its own scale. The
round trip of the contexts through DWG follows once the bridge converts
them.
FredApps on #1362 (rule 31).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Holding Shift during TRIM/EXTEND temporarily switches to the opposite command (standard CAD behavior). Session.shift_down is written by the UI and TrimM uses extend XOR shift_down for execution, prompt, Fence/Crossing preview and the single-entity rollover preview. The UI repaints and the preview cache key includes shift/ctrl, so a modifier-only change refreshes the preview.
BLOCK/INSERT geometry is still ignored as cutting/boundary edges in TRIM/EXTEND; that remains for a follow-up.
block_contexts compared the reference with the one read in X and Y only, so a
reference moved only in Z kept its contexts at their old heights; and any
other change set every context's group 30 to the reference's Z, losing a
context's own height. Z is part of the change check now, and each context
keeps its offset from the reference as read, scaled with the reference's Z
scale as X and Y follow theirs.
FredApps on #1244.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
check() takes a read-back with no answer within 10 s as a pass, so the
device test that called it couldn't tell an answered read-back from a
timeout (it took 10.9 s on the Linux CI runner). Call clear_and_read and
require Ok(true) for both passes, naming the adapter and the time taken.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
EXPORT ignored the version and always wrote the version the drawing was
read in, and the Save dialog passed the Default Save Format version only
for drawings with no file yet, so an opened 2013 DXF could not be written
as 2000.
EXPORT now takes SAVEAS's version and binary options for DXF and DWG
(other formats refuse them). The Save and Export dialogs share one helper
that passes the Default Save Format version for every .dxf or .dwg path,
an opened drawing's too. An export leaves the drawing's own version and
name alone, and QSAVE still keeps the file's version.
The message shown when the version is picked names Save As and Export
and goes through the translation system.
The base point prompt opts in to deferred PER and TAN snaps. The pick waits for
the second point, which resolves the base with snap::resolve_deferred, as LINE's
first point does, then moves or copies by second point minus that base. COPY
keeps the resolved base for later copies.
The other corner of a rectangle is its size, so the reference
application shows width and height boxes there whatever DYNPIFORMAT
says. CADCraft followed DYNPIFORMAT, so with the default polar format
40 Tab 30 placed the corner 40 units away at 30 degrees.
A prompt can now ask for X and Y (Prompt::xy), and RECTANG's other
corner does.
When the first start of the window's graphics fails, run eframe again in the
same process with the next attempt instead of exiting:
- the start as it always was (DirectX 12 alone on Windows, eframe's backends
elsewhere);
- OpenGL alone, where those backends have it beside another;
- the same backends on a software adapter (WARP, llvmpipe).
Each is tried with a stencil buffer, then without. No attempt creates a
backend the first one didn't, so Windows still never creates OpenGL (#31).
What failed picks the next attempt: an adapter, device or surface error moves
to another adapter; a failure the stencil buffer is part of tries the same
adapter without it. Before the app is created, a clear-and-read-back check
catches a driver that takes the stencil buffer and draws nothing (#1724's
Mesa log). A canvas whose GPU pipelines are refused draws on the CPU.
WGPU_BACKEND and CADCRAFT_STENCIL still win. Nothing is remembered between
starts. The log and the status bar say which renderer draws and why. When
every attempt fails, the first error is returned. A debug-only
CADCRAFT_GRAPHICS_FAULT switch fails one step of one attempt, for testing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Proxy graphics text, PDF import text and dynamic block grip text are built without Backwards or
Upside down; four tests build Text the same way.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
From CodeRabbit's reviews of #1136:
- TEXT's generation flags are AcDbText's group 71, but ATTDEF and ATTRIB
read the first 71 among all their groups. A multiline attribute's
AcDbAttribute / AcDbAttributeDefinition subclass has a 71 of its own (its
multiline flag: 2 for an attribute, 4 for a definition), which AutoCAD and
CADCraft write when the text has no generation flags, so multiline
definitions read upside down and multiline attributes backwards (and were
saved so). Only the groups before the attribute subclass give the flags
now; the multiline fixture checks it, read and saved again.
- The start of a justified TEXT's baseline (DXF group 10) is worked out with
the text's own Backwards and Upside down, as it's drawn and as its group
71 says; it took the style's.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
TEXT, ATTDEF and ATTRIB have their own Backwards and Upside down, as AutoCAD's do (DXF group
71: 2 backwards, 4 upside down). New TEXT and attribute definitions take them from their style;
changing the style afterwards leaves existing text as it is. They were the style's only, so
text read from a file with its own flags was drawn as its style said.
- Model: `Text::backwards` and `Text::upside_down` (serde default false).
- DXF: read from 71 (the object's own groups, before an embedded MTEXT) and written when set.
- Render: drawn from the text's flags; the extents box mirrors with them, so zooming to
extents frames mirrored text. Linetype text keeps its style's.
- Properties: a Misc group with Upside down and Backwards (`properties.describe`, and
`properties.set` takes `backwards` and `upsideDown`), for several texts at once with *VARIES*.
- ATTDEF builds its text as TEXT does, so it also takes the style's width factor and obliquing.
- Round trip: #2237's matrices compare both flags, with DXF and DWG cases for them. Its
mirrored-style cases mirror the text by the text's own flags, and each mirrored style
also has text whose flags differ, so a style's flags can't leak into its text's.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Split layout_flags_are_saved_as_read into a DXF case for every target and
layout_flags_survive_a_dwg_save, which carries the same cfg as the other
DWG test in the file: the DWG bridge is not built on wasm32 or FreeBSD
aarch64 (#2526), so a DWG save fails there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since #3389 the HATCH writer keeps the Derived bit (4) of each boundary
path's group 92 from the file it read, but it never writes the hatch's
pixel size (group 47), and the reader does not keep one. #3664 reports
that AutoCAD refuses such a file, and that a stand-in pixel size draws
NET patterns solid.
Write only Polyline (2), External (1) from `outer`, and Textbox (8) and
Outermost (16) from the file, as for paths CADCraft creates. The bit
stays in HatchLoop::boundary_flags. Associativity (71), the source
handles (97, 330) and the pattern are unchanged; no group 47 is written.
The DWG save and AutoLISP entget use the same writer.
New test reads an invented associative NET hatch with derived paths and
a pixel size, saves it twice and checks the 92 bits, no 47, 71, 97 and
the 330 handles. Four #3389 tests now expect bit 4 cleared.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reader skipped group 72 ("Circle sides" in the DXF Reference, VPORT)
of the first *ACTIVE record, and the writer wrote none. Opening a DXF or
DWG and saving it again therefore dropped the value.
Keep the first *ACTIVE record's 72 with the header values (internal key
CADCRAFT_VPORT_CIRCLE_SIDES, hidden from the variable list like other
CADCRAFT_ keys) and write it back on every *Active record. A value that
is not a 16-bit integer (the type of groups 60-79) is left out. A
drawing that stores none is written without 72, as before: no
documented default for this group was found, so none is invented.
DWG goes through the same reader (craft_dwg::decode then dxf_read) and
the same writer (dwg_bridge), so the value now survives a DWG save and
reopen too.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The writer replaced a file's WIPEOUTVARIABLES object whenever the drawing
held 0 or 1, also when the setting was what the file said, and what other
applications hung on that object (an extension dictionary) was lost. The
writer now emits its object only when the file's own does not already say
what the drawing holds or what would be written for it.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The extents estimate a line's shaped width; the fonts measure it. Where the
fonts decide by a cutoff the two could differ, so the extents now assume
the real width is within a factor of 4 of the estimate and take the larger
box unless the estimate is clear of the cutoff:
- Fit text counts as stretched only when its fitted factor clears the
fonts' cutoff by that factor; otherwise it is boxed unstretched.
- A line of next to no width is left as it is by the fonts, so its box no
longer reaches for the second point.
- Aligned text shrunk into a short span is boxed at least as tall as its
own height, which narrow characters reach.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The LAYOUT object's own group 70 (after the AcDbLayout marker) holds the
layout's PSLTSCALE (bit 1) and LIMCHECK (bit 2), each the value while that
layout is current (DXF Reference, LAYOUT). The writer wrote 1 for the Model
layout and every paper-space layout and the reader ignored the group, so
every saved layout had paper-space linetype scaling on, whatever the
source said. DWG input goes through the same reader (the DWG bridge
writes the group), so DWG -> DXF conversion lost it too.
- doc: Layout::flags and Drawing::model_layout_flags keep the value read
(None for a layout CADCraft made).
- read: group 70 is taken only after the AcDbLayout marker; before it the
group is the plot layout flags.
- write: the value read, masked to the two bits the Reference defines;
without one, the drawing's PSLTSCALE (what CADCraft draws every layout
with) and LIMCHECK off. A new drawing still writes 1.
- engine: LAYOUT Copy copies the flags with the page setup and limits.
The renderer still uses the header PSLTSCALE for every layout; making it
per layout needs SETVAR to become per layout first, a separate change.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fit text is stretched by scaling its width factor by span / shaped width
and shaping again. With a span that is a tiny part of the text's width the
scaled factor is too small for the fonts, which then draw at a factor of 1:
the text is far wider than its span, and the extents reported only the
span. The extents now take the unstretched width in that case, as they do
for an unusable stored factor.
Test (render, which sees both): the drawn text lies inside the drawing's
extents for a span too short to fit and for one that fits.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
too_short's margin is TRIM's ON_CUT plus the 3 tol the traced ends and pick can be off by, not
twice ON_CUT. A cutting edge picked before MSPACE or PSPACE moved to another space cuts nothing
there: the preview shows nothing and the trim is refused, so the preview never shows a cut the
trim can't make.
The object a file brings is kept raw and written back, as on main, so a
drawing whose object holds 2 is saved as it was read. The writer still
produces only 0 or 1 itself: a setting changed in the session replaces the
file's object, and "shown but not plotted" set here is written as 1. The
dictionary key goes back out of the modelled entries, so the file's object
is kept again.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
* Load Construction Geometry from the shared Chinese catalog
* Format the shared Chinese catalog validation
---------
Co-authored-by: FredApps <[email protected]>
Require user-defined spacing to exceed the renderer limit in HATCH and SETVAR. Show the exact default spacing, and use a shared scale rule for rendering and DXF definitions.
Measure the rendered spacing before and after a DXF save at the first supported value.
The picker skips a chunk whose cached envelope misses the query. With the
index rebuilt for the new ATTMODE, a box at the constant attribute value
finds the reference through the reused index, as the tree does.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The DXF Reference gives the object's group 70 two values, 0 (no frame) and
1 (display frame). "Shown but not plotted" (WIPEOUTFRAME 2) displays the
frames, so it is now written as 1 and reopens as 1, as it did before this
branch; where a file keeps the third state is not documented.
The named object dictionary entry is listed with the entries the writer
models, so a file's own object is not kept beside the one written. Tests:
no setting writes a flag other than 0 or 1, and a changed setting replaces
the object a file came with.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
* feat(offset): OFFSETGAPTYPE extends, fillets or chamfers polyline corner gaps
OFFSETGAPTYPE is a system variable (0, 1 or 2, default 0) kept in the
drawing header. Offsetting a polyline fills the gap at the outside of a
corner between two line segments: 0 extends both copies to meet, 1 inserts
an arc of radius equal to the offset distance centred on the original
vertex, 2 inserts a chamfer line at the offset distance from the vertex.
Inside corners and joints with an arc keep the extended join. OFFSET's
settings echo shows the current value.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* OFFSETGAPTYPE fills only corners the source polyline has; geometry parity headline and history match
* test(offset): OFFSETGAPTYPE fillets and chamfers open outside corners turning either way
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* test(offset): interactive OFFSET previews and makes the OFFSETGAPTYPE fill
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Remove a leftover merge file
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* OFFSETGAPTYPE: leave docs/geometry-parity.md to the maintainers
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
* Dimension text below the line (\X) and leader text at DIMSCALE (#1055, #1056)
- #1055: in dimension text, `\X` starts the text below the dimension
line (DXF Reference). CADCraft drew only the part before it, and its
*D block held only that part. The part after `\X` is now drawn below
the line, on the other side of it at the same distance (text centred
on the line moves above it), on screen, in plots and in the *D block
as a second MTEXT; text width for the fit is the wider part's.
- #1056: LEADER's annotation was DIMTXT high whatever DIMSCALE said
(0.25 instead of 6.25 beside dimensions at DIMSCALE 25). It is now
DIMTXT × DIMSCALE (the style's, else the drawing's; 1 for annotative
styles), in the style's text style, as AutoCAD's LEADER makes it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Dimension `\X`: measure from the dimension line, not DIMTMOVE 1's leader
The part after `\X` is placed from the dimension line's longest segment, and DIMTMOVE 1's leader
(added by #2015) is drawn as a dimension line too: with the text moved far away, the leader won
and the part below went next to the text. The leader's ends are now kept (`text_leader`) and its
segments skipped. Text moved off its place also leaves the part below at the usual clearance
under the line, instead of as far below as the text is above.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* LEADER text of an annotative dimension style: DIMSCALE, and annotative
With an annotative dimension style the leader's text left DIMSCALE out and was not annotative,
so at an annotation scale it stayed small beside the dimensions. It now takes DIMTXT × DIMSCALE
as a dimension of the style does, and is annotative at the current annotation scale.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* LEADER text of an annotative style: the annotation scale replaces DIMSCALE
An annotative dimension takes the annotation scale in DIMSCALE's place (anno_scaled sets its
scale override), so its text is DIMTXT × the annotation scale. The annotative leader text took
DIMTXT × DIMSCALE and then the annotation scale again: twice the dimension text with DIMSCALE 2.
It is now DIMTXT high and annotative; a non-annotative style still takes DIMTXT × DIMSCALE.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* DIMTMOVE 1 leader is kept as the text leader again
The merge of main moved the leader into dim/linear.rs without the text_leader record, so the
text below the line was placed over the leader.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Keep `\X` text below a suppressed or extension-line dimension line
With DIMSD1 and DIMSD2 both on, no dimension line segment is drawn, so
the part after `\X` was dropped. The linear dimension now records its
whole dimension line (`dim_axis`) and the `\X` layout falls back to it.
With DIMJUST 3 or 4 the text runs along an extension line, so its normal
is across the dimension line's: the text no longer moves onto the
dimension line at the arrow, and the part below stacks under it in the
text's own frame.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
* FILLET/CHAMFER with polylines keep the picked side and join two polylines
A line crossing an open polyline's end segment cut the polyline on the
wrong side when the pick was past the crossing: the polyline always kept
the part towards its other end. Each object now keeps the side it was
picked on and drops what lies past the corner, as AutoCAD does.
Two open polylines picked at their end segments were refused. They now
join into one polyline through the corner (the first one picked keeps
its handle and direction), as AutoCAD does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* FILLET/CHAMFER: a line or polyline joins any straight segment of an open polyline
AutoCAD accepts a middle segment too: an open polyline's end segment
crossing another's middle segment joins them, each keeping its picked
side and dropping what lies past the crossing. Closed polylines and arc
segments are still refused.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* FILLET with polylines: a closed polyline opens to join a line; an arc segment is cut where a line crosses it
Checked against AutoCAD with the same shapes:
- A closed polyline filleted with a line opens at its first vertex: the
picked side of the picked segment joins the line, either side, and the
result is an open polyline. CADCraft refused closed polylines.
- An arc segment crossed by a line (radius 0) is cut where they cross,
keeping its picked side, with the bulge of what is left of it. A line
that misses the arc, or a radius, stays refused, as in AutoCAD.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* FILLET: a pick just before a polyline arc's start keeps the start side
Where the pick lies along an arc segment was clamped to the arc's end, so a pick a little before
its start (within the pick box) kept the end side. It now counts at the nearer end.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
* Drawing locks and WHOHAS: say when a drawing is open elsewhere (part of #540)
While a drawing opened from a DWG/DXF/DWT file is open, the app keeps
`.<file name>.cadcraft-lock` beside it (user, computer, app instance,
when opened), touched every minute; a lock not touched for five minutes
is stale. Opening a drawing someone else has open says who and since
when, on the command line and in the status bar, and opens it anyway:
the lock only informs. A lock is released when its drawing closes or is
saved under another name and when the app exits, only ever by the
instance that holds it; a stale one is taken over, and an app that finds
its lock taken over notes it instead of touching it. WHOHAS reports the
holder of the current drawing or of a file. The locks run with the
autosave tick; the format is CADCraft's own, not AutoCAD's .dwl.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Drawing lock: claim a free lock atomically
Two apps opening a drawing with no lock at the same moment could both write it and both think
they held it, so neither told its user until a later heartbeat. A missing lock is now created
atomically (a hard link of the staged file, or create_new without hard links), and a stale one
is replaced only if no other app has taken it meanwhile, then read back. The app that loses is
told at once who has the drawing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* WHOHAS: a `path` that isn't text is an error
A `path` of another type (`{"path": 7}`) was taken as left out, so WHOHAS answered for the
current drawing. Left out or null still means the current drawing; anything but a string is now
refused.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Drawing locks: name the imports of the native module
The workspace now denies clippy's wildcard_imports, which `use super::*`
in drawlock's native module trips after the merge of main.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Autosave: wake up for the drawing-lock heartbeat, not only for autosaves
Autosaver::tick kept the drawing locks but returned only the next autosave,
None with every drawing saved or SAVETIME 0, and the UI only schedules a
repaint on Some. An idle app then never touched its locks: after STALE_SECS
another app took the drawing over without a word. Locks::next_beat gives
the shortest wait until a held lock (or someone else's) is due again, and
tick returns the sooner of that and the next autosave.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* WHOHAS: an error on the web, not "nobody has it open"
The web has no lock files, so the lookup isn't done there; reporting no
holder presented that as a negative result.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Fix the wasm build after the merge
The merge dropped the native-only cfg from main's autosave lock field, and
two drawlock items used only by native code warned on wasm.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
* Plot: JIS B4/B5/B6 and Japanese paper sizes
Japanese drafting uses the JIS B series: B4 257×364 mm, B5 182×257 mm and
B6 128×182 mm. The paper table only had the ISO sizes, so a JIS B5 drawing
plotted about 7 mm short in each direction. B4/B5/B6 are now the JIS sizes (the
names Japanese Excel and drawings use) and the ISO ones stay reachable as
`B4 (ISO)`/`B5 (ISO)`; a drawing that stored the ISO sheet keeps its stored
size, and a caller that means ISO B5 says so.
Adds the Japanese papers the table lacked: Japanese Postcard (はがき,
100×148 mm), Japanese Double Postcard (往復はがき, 148×200 mm), Japanese
Envelope #3 (長形3号, 120×235 mm), Japanese Envelope Kaku #2 (角形2号,
240×332 mm) and 四六判 (127×188 mm). A6 was already an ISO sheet.
Paper names resolve case-insensitively and ignore spaces, hyphens, underscores
and parentheses (`B5 (JIS)`, `b5-jis`, `b5jis`), with the Japanese spellings as
aliases too (`はがき`, `往復はがき`, `長形3号`, `角形2号`, `四六判`). The
built-in plotters and the Page Setup/Plot paper combo pick the new sizes up
from PAPER_SIZES, and the PDF plot's MediaBox and the plot preview use them.
Tests: the render paper test pins every new size and alias, the ISO sizes keep
their values and the unknown-name fallback is unchanged; a new io test pins the
PDF MediaBox for each new paper (JIS B5 515.91×728.50 pt, はがき 283.46×419.53 pt,
ISO B4/B5 and the rest), and the plot-preview test checks that `B5` resolves to
JIS B5 and `B5 (ISO)` to ISO B5.
Docs: docs/plotters.md standard sizes and the `pagesetup`/PDFBOOK parameter
notes, and ROADMAP.md progress log + revision history, dated 2026-10-21.
* Plot: B4/B5/B6 stay ISO; JIS sizes by explicit name
Review follow-up: making the bare names mean JIS changed the ISO sizes for
every user. `B4`/`B5` are the ISO sizes again, an ISO B6 row (125×176 mm)
completes the bare series, and the JIS sheets (JIS P 0138, 257×364,
182×257 and 128×182 mm) are reachable only as `B4 (JIS)`/`JIS B4`,
`B5 (JIS)`/`JIS B5` and `B6 (JIS)`/`JIS B6`.
Drop the ambiguous bare `Postcard` and `Double Postcard` aliases; the name
and はがき/往復はがき say which postcard is meant. Drop the ROADMAP.md edit
(ROADMAP.md stays at origin/main's content).
The render and io paper tests, the plot-preview test and docs/plotters.md
follow the new mapping; the Japanese stationery sizes and their はがき/
往復はがき/長形3号/角形2号/四六判 spellings are unchanged.
Still safe for stored papers: a page setup keeps the canonical paper name
with its width/height, DXF groups 44/45 round-trip those sizes, and the ISO
canonical names (and the JIS rows by name) did not change.
* Plot: full-width paper names resolve like their ASCII forms
A Japanese keyboard or IME gives B5 (JIS); fold U+FF01..U+FF5E to ASCII (and the
ideographic space to a space) before the existing normalisation, with a test.
---------
Co-authored-by: midasdf <[email protected]>
triangulate_evenodd stops once its triangles pass 6,000,000 points (or
returns none past 200,000 edges) without telling the caller, so a fill
drawn in part left DisplayList::truncated false.
- fill: triangulate_evenodd_whole also says whether the triangles cover
the whole region. The cap check moves to before the next slab that adds
triangles, so the triangles are unchanged and a region whose last slab
passes the cap counts as whole. triangulate_evenodd keeps its signature.
- Builder::region_tris marks the list truncated when a region is not
whole; hatch fills and backgrounds, MLINE fills, Prim::Fill and WIPEOUT
go through it.
- PolyClip keeps whether its region triangles are whole. A fill crossing
the outline of a capped region is cut against the triangles there are,
so it is drawn too little and never past the outline; may_leave_out
says when that can happen and clip_prim marks the list.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* feat(nightly): wire craft-nightly for direct-launch self-isolation
* fix(nightly): bump craft-nightly for single-instance sockets and add Windows regression test
The test is unchanged. At its first place it sat where #3642 adds a test
of its own, so the two branches conflicted in crates/mcp/src/tests.rs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Session::echo keeps the command history bounded: past 5,000 entries it
drops the oldest 1,000. Code that reported a request's output saved
log.len() as an index and returned the lines after it, so when the trim
happened during the request its output came back empty or partial while
the request still reported success.
Session now counts every line echo adds (never lowered by the trim or by
clearing the history). Session::log_mark returns that count, and
Session::log_since(mark) returns the lines echoed since the mark that the
history still holds. The collectors keep a mark instead of an index:
headless MCP cmdline.input, cmdline.script and cmdline.key, the window's
control channel (the same three), and the output of the lisp and appload
JSON commands. The history stays bounded as before.
Tests: lisp::tests::a_lisp_calls_output_survives_the_history_trim,
cadcraft-mcp tests::headless_output_survives_the_history_trim and
cadcraft-ui-egui control::tests::cmdline_output_survives_the_history_trim;
all fail without the change.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Opening a large DXF aborted the process (handle_alloc_error) once an
entity list grew past its fallible up-front reservation, and the move of
the entities into the drawing allocated each of them again while the
list still held its copy.
- Entity lists grow fallibly (entity_room): doubling as a push would, but
no further than their records can fill, so they end at about their
final length; past the count (a polygon mesh's faces) they double. The
up-front cap of #1833 is unchanged. A mesh's faces are reserved with
their polyline and pushed straight into that room.
- The handle sets and the block list reserve before they insert.
- The first ENTITIES/BLOCKS list is moved, not copied; a repeated section
(#865) is appended after a fallible reservation.
- Before each list moves into the drawing, room_to_place asks once,
fallibly, for about the memory the drawing's copies take and hands it
back for them.
- read_budgeted takes a test-only ceiling (None when reading) so tests can
refuse a reservation as an allocator out of memory would.
A release cadcraft-cli opening a 10M-group binary DXF of LINEs in a job
with a memory limit now exits 1 with "DXF: out of memory reserving N
entities" at every limit from 1.2 to 2.45 GB (main aborted up to 3.0 GB)
and opens from 2.46 GB (main needed 3.2 GB; peak commit 3,215 -> 2,532 MB).
Part of #1922 (F-06).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Past the 65,536 entries an entity list reserves up front (#1833), the
DXF reader grows it by ordinary pushes. Each doubling is one allocation
that aborts the process when it can't be had, and the last one leaves up
to half the list spare. The new test reads 65,636 LINE records and
expects no more room than records; on main the list ends with room for
131,072.
Part of #1922 (F-06).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A constant attribute's value counts in a reference's box since the block
caches hold `Contents`. Measured through a viewport it is left out when its
definition's layer is frozen there, as the renderer leaves it out. The test
fails when `contents` measures the value without the viewport's layers.
`outline_in` added to the rectangle a dimension is hit along the room of
every text of its block on a layer frozen in the viewport. It did not look
at the drawing: text on a layer frozen for the whole drawing or turned off,
or invisible itself, had no room in that rectangle before a viewport was
counted, and got one when the viewport froze its layer as well, so a pick, a
crossing window, a fence or a crossing polygon took the dimension through
empty space. That text is now passed over.
A new test asserts the top side for each of those selections
with the layer frozen for the drawing and turned off, through a viewport
that freezes it too and through one that freezes nothing.
Conflicts in crates/doc/src/extents.rs and crates/engine/src/select.rs.
extents.rs: main's `Contents` (a block's geometry, its constant attribute
values by tag and its definitions) is what the block caches hold, and it is
measured with the viewport's frozen layers: `contents` takes `frozen` and the
separate `in_drawing` cache, a constant value on a layer frozen in the
viewport is left out as the renderer leaves it out, and a clipped reference
takes the drawing's contents from `in_drawing` (`drawing_contents`).
select.rs: main's file with the viewport laid over it. A block reference is
hit on what is drawn (#3445), so through a viewport on what that viewport
draws (`insert_geometry` and `insert_fill_hits_box` take the frozen layers).
The frame of blank text (#2810) stays in the box a viewport gives. `pick_scanning`
tests its candidates through one `ViewportBounds`.
One test follows #3445: a clipped reference whose frame is hidden
(XCLIPFRAME 0) is no longer hit on its boundary, in any viewport, since the
boundary is not drawn; the window around it still takes it.
A LISP expression at Command: runs in 400,000-step slices, and only the
window's per-frame lisp_tick carries a routine on. Session::script gave
its next input right away and returned, so outside the window a routine
longer than one slice stopped after it for good: cadcraft-cli run and the
headless MCP server reported success with the routine cut short, and the
next LISP line got "a LISP routine is already running".
Session::lisp_run_until_input carries on such a routine until it ends or
waits for input (a get... prompt or a command pause). A script calls it
before each input it gives and once it ends, so the input goes to what
the routine waits for, or comes after it. The headless MCP backend calls
it after a command line and after Enter, since it has no frames either.
The window's own command line keeps its slices and Esc; a script in the
window, which already runs synchronously, now holds it until the routine
ends or waits.
Nobody can stop such a routine by hand, so it stops after
Limits::frameless_steps steps (BLOCKING_CAP, as a programmatic lisp call)
with the same "routine stopped after N steps" error; an endless *error*
handler is stopped one slice later.
Tests: lisp::tests::a_script_runs_a_long_routine_on_before_its_next_input,
lisp::tests::a_script_stops_an_endless_routine, cadcraft-cli
lisp_script::a_long_routine_in_a_script_draws_before_the_save and
cadcraft-mcp tests::headless_lisp_routines_run_to_their_end; all fail
without the change.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A closed spline repeats control vertices: SPLINE CV's Close repeats the first at
the end, and control vertices that wrap round repeat the first degree. Grips
listed every copy and a drag moved one, which opened the curve. SPLINEDIT's
distinct/copies rule moves to Spline so grips use it too.
Control points count as copies only where they really repeat: a spline whose
knots wrap but whose tail doesn't repeat its first control points keeps every
control point its own, even when only its last matches its first.
reading_a_user_fonts_names_keeps_no_font_bytes wrote its font to a
pid-named path in the temp folder without exclusive creation and removed
it by hand, so the file stayed behind if anything panicked before that
removal. The
font now goes in a folder the test creates itself (create_dir, trying the
next name if one exists), and a guard removes the folder when the test
ends, also on panic. The checks are unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Face::family_name took only the first name record of each id and gave up
when it read as blank. Some installed fonts (43 VNI fonts on the test
machine) start name id 1 with an empty Unicode-platform record before the
Mac Roman and Windows names, so they had no family name. It now passes
over records that read as blank (empty, or in an encoding that is not
decoded) for the next one with the same id, bounded like Face::names.
reading_a_user_fonts_names_keeps_no_font_bytes took the first .ttf in
HashMap order from the installed fonts, so it failed whenever such a font
came first. It now writes its own font file (a name table built in the
test) and checks the same no-bytes property, plus the family read back.
A new test pins reading past blank records.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Route the UNITS dialog's labels, type lists, insertion units and buttons
through the catalog, and add the Italian translations.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two review findings on the plot style point limit:
- pattern_within kept going after a triangle set `full`; a later
triangle over the pattern cell allowance then returned None, so the
list was not marked truncated and later outlines were still styled.
It now returns as soon as `full` is set; the cells running out first
still keeps the fill solid, as before.
- Viewport contents were styled within the build's whole point limit,
then clipped into the layout's list, which already holds the objects
drawn before the viewport. Outlines that fit the contents' list but
not the layout's stopped the append part-way and spent the build,
dropping the last contents and the layout objects after them. They
are now styled within the room the layout's list has left.
Part of #1603.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in "Start no clipped piece without room; skip viewport scans
once spent" (clip.rs, viewports.rs, tests.rs). No conflicts; the
viewport contents keep both the early return and the pen limit.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
CodeRabbit on #3594 and #3622:
- Pieces started a new piece when the cap had no piece left, so a long
visible run was copied up to the point cap and then dropped. Starting
a piece now stops the pieces there; a piece that fits exactly with
nothing visible after it stays whole. The output is unchanged.
- A layout viewport after the build was spent still scanned model space,
working out each object's bounds before entity() found nothing could
be drawn. contents() now returns first when the build is spent and its
list already says so. A build spent by a list filled exactly still
scans, so the list is marked for what the viewport leaves out.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On the web build (one allocation at most isize::MAX) two vectors could
still double past 2 GiB and panic with "capacity overflow":
- gpu::build_highlight_mesh grew its quads from empty. It now counts
segments, point markers, fill corners, fill outline segments and
image frame edges first and allocates once, as build_mesh does. Fill
outlines are worked out once, while counting.
- pen::apply turned plot style line ends, joins and fill patterns into
triangles after the build, outside MAX_DISPLAY_POINTS. It now stops
at the list's point limit: from the first primitive whose geometry
doesn't fit, the rest keep their plain line or solid fill and the
list is marked truncated. Layouts and viewport contents use the
build's own limit.
Measured on wasm32 (harness, Node): 40M highlighted points and a plot
of 1,060,000 round-ended lines panicked on the base; now 1.12 GB
allocated once, and 63,999,974 points marked truncated.
Part of #1603.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Add Russian translation (ru).
Update the in-app Russian catalog and add Russian strings to the
Linux desktop, AppStream, and MIME metadata.
Copyright (c) 2026 SuperSfera LLC, MIT OR Apache-2.0.
* ru: address review (metainfo license notice)
* i18n(ru): apply review suggestions from #2296
* i18n(ru): keep a single copy of the translation notice
The desktop entry, MIME file and Russian catalog repeated the same copyright line. The notice text itself is unchanged.
Co-authored-by: sesaposa1 <[email protected]>
* i18n(ru): translate Generate Boundary
The hatch command label was the one English command name still absent from the catalog. It follows the catalog's own Boundary / Create wording.
Co-authored-by: sesaposa1 <[email protected]>
* ru: state CC0-1.0 for Russian metainfo strings
* ru: remove the per-file translation notices
The translation is under the repository's licence, and authorship is in git history.
* i18n(ru): 15 strings added on main since the last catch-up
Array dialog fields and the update and right-click option hints.
Docs counts updated to 2,274 rows.
---------
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: sesaposa1 <[email protected]>
Co-authored-by: FredApps <[email protected]>
* i18n(cs): translate the 115 strings added since the Czech catalog
Adds Czech rows for every key of the Ukrainian reference catalog that the
code looks up and cs.tsv was missing: the 3D mouse window and its status
messages, the Hatch and Gradient dialog, the Block Editor and dynamic block
commands, multileader editing, Options (selection, grips, selection preview
and automatic save), the MTEXT editor toolbar, palette tool sets and recent
files. 1,214 -> 1,329 rows; the i18n tests now report no Czech gaps.
"SVG drawings (SVG, SVGZ)" is left out: no production code looks it up.
Rows are inserted in the reference catalog's order; existing rows are
unchanged. Translations are original, written from the meaning of the
English strings (AI-assisted, not yet proofread by a native speaker).
docs/localization.md and docs/localization-parity.md updated.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* i18n(cs): review fixes for the new Czech rows
Independent review of the 115 rows added in the previous change:
- Hatch Pick: "Výběr pro šrafy", matching the existing helper command
QuickCalc Pick ("Výběr pro rychlou kalkulačku").
- 3D Mouse Navigation: noun form "Ovládání pohledu 3D myší", as in the
English label and the Enable 3D mouse navigation checkbox (the command
applies one navigation frame).
- Automatic save hint: "Výkresy, které ještě nemají soubor, ..." reads
more naturally than "Výkresy bez souboru".
- 3D mouse busy: "obsazena", the same short form as "připojena" and
"odpojena" in the sibling status messages.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* docs: note the intermediate Czech baseline in the parity history
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* i18n(cs): translate the 33 strings added on main since
Rows for UI that landed on main after this branch started, so the
Czech catalog again covers every key of the Ukrainian reference catalog
the code looks up (no gaps reported):
- Command Aliases dialog (ALIASEDIT) and Tools > Customize.
- Express Tools commands: BREAKLINE, TXT2MTXT, BURST, MOCORO.
- Options: two-click selection window, interface scale.
- HATCHEDIT: removing boundaries, the Island boundary label.
- Properties: a dimension's arrow size, overall scale and precision.
- Three command prompts (DATAEXTRACTION, TOLERANCE, APPLOAD).
Not added: the Plot dialog labels in managers.rs, which the code does
not look up yet, and the unused SVG filter label.
1,330 -> 1,363 rows; counts updated in localization.md and
localization-parity.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* i18n(cs): drop the duplicate Normal row after merging main
Main's ATTDISP work (View > Attribute Display > Normal) added the row
`Normal → Normální` to cs.tsv, the same one this branch had added at the
end, so the merge left the key twice and the catalog test failed on
"duplicate key Normal". The branch's copy goes; main's stays.
Czech has 1,373 rows (main has 1,219); the counts in the docs follow.
`cargo test -p cadcraft-ui-egui` passes (307) and `translation_gaps`
reports nothing missing for cs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* i18n(cs): put the two backup rows in the reference catalog's order
Backup copy and Create backup copy with each save follow Automatic save
file location, as in uk.tsv; the other five new keys are not in the
reference catalog and stay at the end.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* i18n(cs): the 7 strings translation_gaps lists after merging main
Alias import confirmation, the right-click hint in Options, MINSERT and the Xref clip menu; no reference catalog has the first five yet.
* i18n(cs): the Dimension Style Manager and dimension properties
184 rows for the strings #1460 added (Dimension Style Manager, dimension
and text properties, unit formats, arrowheads), 1,653 rows in all.
translation_gaps: cs nothing missing. Docs counts and history updated.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* i18n(cs): 19 strings added on main since the last catch-up
Array dialog fields, the update and right-click option hints,
the unsaved-changes prompt, and Unnamed.
---------
Co-authored-by: Losminek <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: FredApps <[email protected]>
CodeRabbit review on #3594:
- clip_list started from an empty list, so a list the budgets had
cut came back with truncated false. It now starts with the input's
truncated, undashed and expanded, as viewport contents merge them.
- clip_prim built the whole clipped result before push_raw checked the
list's limits. A fill crossing a clip edge fans to more points, and a
line crossing an outline of many edges splits into a piece per
crossing, so the transient result could pass 2 GiB on wasm32 from a
list within its budgets. clip::Cap and _within variants of the
rectangle and outline clips stop at the room left (Limits::left) and
say so; clip_prim appends what fit and marks the list truncated. A
fill cut there keeps the triangles that fit, as line pieces already
did. The uncapped functions stay as wrappers for their other callers.
PolyClip::clip_triangles' 6,000,000-point stop now marks the list too.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
egui's own arrow-key focus moved from the combo into the nearest row button
below and then down that column, so Enter toggled a lock instead of making a
layer current. In the open list, Up and Down now move from layer name to layer
name and scroll it into view; from the combo, Down goes to the current layer.
Enter or Space on a name makes it current. Each row's On/Off, Freeze/Thaw and
Lock/Unlock buttons are also named with their layer, so they no longer share
three names.
Clicking the Percent box in the Transparency menu closed the menu, because a
menu closes on any click inside it, so the value could only be dragged. The
Transparency menu now closes only on a click outside it (ByLayer and ByBlock
close it themselves), and the box is a slider with its value box, labelled
Percent.
* feat(area): expose active interactive command to canvas
* feat(area): shade temporary AREA preview and add tests
* fix(area): skip ambiguous self-intersecting preview fills
Reject overlapping or touching nonadjacent polygon edges before triangulation, preserving the AREA measurement and outline. Add bowtie and degenerate-boundary regression coverage with documented behavior.
* fix(area): preserve fill when cursor repeats last selected point
Strip only the redundant cursor vertex from the temporary AREA preview before polygon validation; keep genuine duplicate selected points invalid. Add two regression tests for stationary cursor and duplicate selected clicks.
* fix(area): keep preview fill when cursor revisits any selected point
Drop only the final temporary cursor vertex when it duplicates a selected vertex. Preserve rejection of actual duplicate selections and add closure/interior-cursor regression tests.
* perf(area): cache selected-edge validation while keeping cursor checks live
* perf(area): keep preview validation cache in canvas state
* style(area): clean preview formatting and let-else layout after review
* style(area): apply rustfmt per maintainer review
---------
Co-authored-by: mrepzzz <[email protected]>
Co-authored-by: FredApps <[email protected]>
The drop-down under the Layers palette's current layer, and Properties > Layer
with nothing selected, listed every layer in one column with no scroll area, so
with many layers the last ones were off screen and could not be picked. Both now
scroll like the Properties layer menu for a selection (#1467), at the same
height. The current layer combo also gets a combo box node named after the
layer it shows.
* HATCH by internal point keeps the arcs of its boundary (#1167)
The boundary search works on flattened curves, so a hatch made by
picking inside a circle stored 158 chords and AREA came out short
(5025.22 for pi*40^2 = 5026.55).
Each traced edge now keeps the input polyline it came from
(region::Boundary::outer_edges, Island::edges, outline_edges,
enclosing_loop_edges_gap; bridged gaps are None), and each input
polyline is one piece of one object: a line, a circle, an arc or one
segment of a polyline. arcs::with_arcs turns each run of edges on the
same circular piece back into one bulged vertex and moves the corners
onto the exact curves (line-circle or circle-circle crossing nearest the
traced corner, within the reach a shallow crossing needs, else onto the
circle). Nothing is matched by proximity, so a line or an ellipse next
to a circle is never taken for it. The associative refill does the same,
so a hatch keeps its arcs when its objects move.
dedup_loops now merges only loops with the same role: a loop that is one
pick's outer loop and another's island stays twice, as the even-odd fill
needs (one hatch picked inside a circle and around it, or inside a square
within a square, left the inner shape empty once the two loops matched).
A boundary object selected twice is used once.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Hatch arcs: origin from the arcs' extents; opposite-role duplicate loops cancel
- HPORIGINMODE's corners came from the loop vertices only, so a circle kept as two half-circles
had no height and its corner origins fell on its centre line. The extents now include each
bulged edge's arc.
- A pick inside a circle and one around it keep the circle as an outer loop and as an island.
The renderer collapsed the two into one loop, so the circle drew empty, and AREA measured them
by nesting. Two loops that are the same boundary now collapse only in the same role (a repeated
loop); in opposite roles they cancel, as they do under the odd-parity fill. AREA measures the
loops the fill keeps (`hatch_fill_loop_indices`), exactly with their arcs.
- Tests: the circle's corner origins, BOUNDARY keeping a circle's and a rounded rectangle's
arcs, and the drawn fill and AREA of the circle inside a square.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Hatch loops: same-role repeats collapse before opposite roles cancel; HATCHEDIT keeps islands
- The renderer cancelled an outer loop and an island as it met them, so the same loops in another
order filled differently (outer, island, outer left a hole; outer, outer, island left none).
Repeats within a role now collapse first, then an outer loop and an island that are the same
boundary cancel, spending the same comparison budget.
- HATCHEDIT adding a boundary the hatch already has (its island) added a second copy, which then
cancelled the island. A boundary already there is no longer added.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* HATCHEDIT: a boundary already there takes the added objects' links
Adding a boundary the hatch already has dropped the added loop, and with it the objects it came
from, so an unlinked island picked with addBoundary stayed unlinked. The objects now join the
loop already there (no second copy is added).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* AREA of a hatch tests nesting at an edge's middle, as the fill does
AREA tested whether a loop is an island at its first vertex, which can lie on the loop around it
(an island touching the outer boundary): the island was then added instead of subtracted. It now
uses the fill's own test point, the middle of the first non-degenerate edge (`hatch_loop_probe`).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Hatch loop dedup: look only at loops that could match, stop when the budget is spent
The comparison budget bounded `same_polygon`, but both passes still walked every kept loop for
each new one, O(n²) in the number of loops however few matched. Loops are now found by (role,
vertex count), so only possible matches are looked at, and once the budget is spent no more are.
A test sorts 40,000 distinct loops.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* docs: hatch gap tolerance (HPGAPTOL) is done, not missing
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* docs: BOUNDARY keeps the arcs of what it traces
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: FredApps <[email protected]>
The object is of a class a reader does not have built in, so the CLASSES
section names it, as it does for RASTERVARIABLES. A test checks that a
drawing with the setting gets one object, one class and one dictionary
entry, that a drawing without it gets none, and that saving twice does
not add a second object.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Layer 0 puts an attribute on its block reference's layer only when the
attribute takes it from its definition. The DXF writer (and so the DWG
bridge), the renderer, BURST and the attribute editor's current layer
applied that rule to an attribute whose own layer is 0 as well, so it was
saved, drawn and exploded on the reference's layer.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* RENAME keeps a layer's, block's or style's xdata, extension dictionary and reactors
The data CADCraft keeps for a table record or block without modelling it
(Drawing.foreign.records, and the roles of its file handles in foreign.targets)
is keyed by kind and upper-case name, so a rename left it under the old name:
a renamed dynamic block lost its dynamic data, and a renamed layer, text style,
dimstyle, linetype, view, UCS, multileader style or table style lost its other
applications' xdata, extension dictionary and reactors on the next save.
Foreign::rename re-keys both maps; every rename site (layer.set newName, which
RENAME and the Layer manager use; block; style; dimstyle; linetype; view, UCS,
multileader and table style) calls it through Foreign::rename_shared, which
clones the shared Foreign only when it holds something for that name. Undo needs
nothing: foreign is part of the drawing snapshot.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A case-only rename leaves the shared foreign data uncloned
* A case-only rename test checks the saved layer and block names exactly
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* docs: RENAME keeps the foreign data of layers, blocks, linetypes, text styles and dimension styles
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: FredApps <[email protected]>
Resolve the conflicts in crates/render with #3564 (dash budget) and
#3560 (block-loop cache), keeping every side:
- Builder carries the point, primitive and dash counters and the loop
cache; every part, XCLIP part and viewport-contents builder gets all
of them, shared.
- build_space_within takes the point, primitive and dash limits; the
tests of both PRs pass the other budget's default.
- The clipped appends carry undashed beside truncated, and spend the
build when a piece doesn't fit.
Also test the shared primitive count with a limit no one parallel part
reaches (300 of 600, parts of 256). Since Builder::join limits the
joined list, the limit below one part passed without the shared count.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* feat(layout): pick the model area a new layout shows
Creating a layout from the "+" button or the layout tab menu takes the next
free name, shows the Model tab for two corners picking the model area the new
layout's viewport shows (Enter: the whole drawing; Esc creates nothing and puts
the tab back), then shows the new layout. `layout.new` takes `window` for the
same from JSON.
Interactive::cancelled lets a command put back the view or tab it moved when it
is cancelled (forwarded by the Guarded wrapper). Rebased onto main: the tests
live in cmd/layout/tests.rs, the cancel hook in session/interactive.rs.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* fix(layout): Esc restores the starting tab only if the Model tab is still shown
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* i18n(it): the prompt that asks the model area of a new layout
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* feat(layout): keep "+" and New Layout instant; pick the area with New Layout from Area
"+" and the tab menu's New Layout create the next layout at once, as before, and
LAYOUT.NEW asks only for the name. The model-area pick moves to its own command,
layout.newarea ("New Layout from Area..."), offered in the layout tab menu. Its
code is unchanged; layout.new {window} still covers scripts.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* i18n(zh): the New Layout from Area menu item
main's Chinese test requires a label for every menu item and command.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* Classify layout.newarea as a no-files command
every_command_is_classified requires every registered command to be on one of the file-access lists. layout.newarea does not touch a file, so it belongs next to layout.new on NO_FILES.
---------
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Co-authored-by: FredApps <[email protected]>
* Stroke font: U+2205 is the diameter sign too
Files from other software store the %%c symbol as U+2205 (empty set)
rather than U+2300. The stroke font drew Ø, ø and U+2300 with its
diameter glyph but had nothing for U+2205, so a stroke-font style showed
it as a missing-glyph box, or as an installed font's ∅ when one had it.
Draw it with the same strokes.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Draw %%c with the style font's U+2205 or Ø when it has no U+2300, else the stroke glyph (fixes#1608)
%%c becomes U+2300, which most Latin TrueType fonts lack (Arial, Times,
Liberation Sans on Linux). A text style set in one of them drew the
font's missing-glyph box for the diameter sign; only when a wide-coverage
font (DejaVu Sans) happened to be installed did the per-character
fallback show a symbol, in that other font's size and look.
A character the style's face lacks is now first looked for as one of its
substitutes in the same face: U+2300 as U+2205 or Ø, U+2205 as U+2300 or
Ø (`substitutes`, a pure candidate list). All three read as the diameter
sign in drawing text, and every Latin font has Ø, so the symbol keeps the
text's font, size and weight. The existing fallback chain (FONTFALLBACK,
FONTALT, installed fonts) is unchanged and comes next, as for every other
missing character; when no font has the character and the stroke font
does, its glyph is drawn as strokes instead of the face's box. The PDF
glyph record carries the character actually drawn, so the ToUnicode map
stays one-to-one when a text has both %%c and a literal Ø. Lines with
right-to-left text (the shaped path) apply the same substitution before
itemizing.
Tests: the candidate order; the last resort's choice; and, with a real
installed font that lacks U+2300 but has Ø (Liberation Sans, Arial...),
%%c, U+2300 and U+2205 shape, measure and record the same glyph as Ø,
also on a right-to-left line. Skips cleanly without such a font; no font
file is added.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Test the Ø substitution only in a font that also lacks U+2205
The installed-font test picks a face without U+2300 that has Ø, and
expects %%c, U+2300 and U+2205 to shape as its Ø. A face that lacks
U+2300 but has U+2205 satisfied that predicate, yet in it the
substitution rightly chooses U+2205 over Ø, so the comparison with
"Ø50" failed on such a machine. Require the face to lack U+2205 too;
Liberation Sans does, so the test still runs where it ran before and
still skips cleanly when no such font is installed.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Shaped lines: draw what no font has with the stroke font too
The left-to-right path draws a character that neither the text's font,
its substitutes nor any installed font has with the stroke font's glyph
when it has one, in place of the face's missing-glyph box. The shaped
path for lines with right-to-left text stopped short: `resolve` went
from the fallback chain straight to the face's box, so %%c on such a
line in a font without a diameter sign, with no installed font to lend
one, still showed a box where a left-to-right line showed the symbol.
Select the stroke glyph before the face's box there as well. The piece
is drawn and measured as the stroke-font pieces of a stroke-font line
already are (the stroke font's advance, no PDF glyph record, since it
is strokes, not an outline), so no other site needs a case. One
difference remains deliberate: a stroke-font line leaves the trailing
gap of its last glyph out of the width, as `shape_stroke` does; a
TrueType line now keeps it, as `ttf::shape` does, so a line measures
the same whichever path lays it out.
Tests: with a face that maps nothing standing in for a font lacking
the character, `resolve` picks the stroke glyph when no installed font
has the character (the fallback font when one does), keeps the face's
missing-glyph shape for what the stroke font lacks too, and the shaped
line draws strokes rather than a box at the stroke font's advance. The
installed-font test's right-to-left part also checks the width and
that the face's Ø, not the stroke font's, is drawn.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Shaped lines: take the bidi runs from the text before substitution
A character the text's font lacks is drawn as one of its substitutes
when the font has that: %%c (U+2300) as Ø in Arial, Liberation Sans and
the like. The shaped path (lines with right-to-left text) substituted
first and then ran the bidi algorithm over the substituted characters.
U+2300 and U+2205 are bidi-neutral, Ø is left-to-right, so on a line
like "⌀50 אב", right-to-left by its first strong character (the Hebrew),
the Ø became the first strong character instead, the paragraph flipped
to left-to-right and the runs changed order: "⌀50" moved from the right
end of the line to the left, where a font with U+2300 never puts it.
Resolve the runs from the characters as decoded and draw the substitute
at the same logical index: substitution is one character for one, so
the runs index both lists alike. Itemizing, shaping, mirroring and the
widths keep using the substituted characters, since those are drawn.
Tests: a TrueType font built in the test (character map and metrics, no
outlines) gives a face whose coverage the test chooses, with or without
U+2300, whatever is installed. "%%u⌀50%%u אב" in both faces underlines
"⌀50" at the same place, the right end, at the same width. The
installed-font test compared the glyphs of "⌀50 א" with "Ø50 א", equal
only while the line flipped; it now checks that the face's Ø is the
rightmost glyph of the former and the leftmost of the latter, at the
same width and glyph count, still without stroke-font glyphs.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Skip empty glyph slots when finding the rightmost glyph in the diameter test
Main now keeps an empty outline slot for a glyph without contours (the
space), so the slot's missing x put it last in the right-to-left check.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: FredApps <[email protected]>
* Picking reads the index topmost first when the aperture holds more than 1024 candidates (#2701)
When a drawing is shown small, the pick aperture under the cursor covers most of it and the
spatial index returned nearly every entity on each pointer move: the hover highlight collected,
mapped and sorted all of them before testing the topmost. A pick now takes at most 1024
candidates from the tree as before; past that it reads the index chunks from the last one down
(skipping chunks whose bounds miss the query), stops at the first hit, and sorts the tree's
candidates only for the entities below those it examined, after 4096 of them. Picks are
identical (parity tests against the scan at every limit).
select::pick per call, 1396 px canvas, PICKBOX 3 (synthetic 374k-entity site plan / 2M lines):
zoom 20x 0.006 / 0.005 ms -> 0.006 / 0.005 ms
zoom extents 0.014 / 0.112 ms -> 0.015 / 0.115 ms
0.005x 17.0 / 148 ms -> 8.4 / 74 ms
0.0005x 12.3 / 121 ms -> 0.017 / 0.019 ms
Hovering over the 2M-line drawing at 0.0005x: 100% of a core at 7.6 frames/s before, 9% after.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Picking past 1024 candidates skips the layers frozen in the viewport
The test covers the frozen-layer filter on the topmost-first and below-floor
routes of a pick, which #3124's tests do not reach.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: FredApps <[email protected]>
Part of #1922 (F-06 e). The DXF reader's Objects kept every XRECORD,
TABLESTYLE, DIMASSOC, MLEADERSTYLE and GROUP record as a to_vec() copy of
its groups while read_budgeted still held the tag list they came from, so a
file made of such records held them twice while it opened. Objects now takes
a lifetime and keeps them as slices of that list; the records are read by
the same code from the same groups.
Peak commit opening 20M-tag crafted files (dev build): TABLESTYLE,
MLEADERSTYLE, DIMASSOC and CADCraft's own XRECORDs 1,660 -> 895 MB in ASCII
(87 -> 47 bytes per tag, the tag list alone) and 2,115 -> 1,991 MB in binary;
GROUPs 2,476 -> 1,367 MB (ASCII). Reading and saving give byte-identical
DXF and DWG output on 22 files.
The binary tag list's growth (craft-dxf, storytold/craft-libs) is left out.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* engine: check a paper's margins against its own axis
* doc: turn a paper's margins with the sheet when it is stored portrait
* fmt: keep plotters.rs rustfmt-clean
* engine: turn a device paper's margins to the page's orientation
* engine: turn a page's margins when only its orientation changes
PAGESETUP sets `landscape` before `page_device`, but a command that names no paper copies no
device paper, so the retained margins stayed on the old sheet's axes and Sheet::from_page
refused them on the new orientation, falling back to the whole sheet. Turn them with the page,
using the inverse of the rotation `set_paper` applies.
* engine: an orientation-only pagesetup turns the retained margins the way the page turns
---------
Co-authored-by: midasmatterhorn <[email protected]>
Co-authored-by: FredApps <[email protected]>
* Key the raw reader's entity map by handle, not hex text
dxf_raw::read built a HashMap<String, bool> from Handle::hex() of every
entity and probed it with the handle text of every entity record: for
the #1076 reference drawing that is 1.1 M String allocations plus
SipHash over text, and the record's handle was parsed, formatted and
parsed again. Keyed by Handle, the map is built from the entities' own
handles and probed with the handle the record's head already yields.
handle() only rejects null and absurd handles, which the lookups' users
skipped a few lines later anyway.
Reading the #1076 reference DXF: 0.34 s less of 5.85 s.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Skip the raw reader's head scan for records without 102 groups
dxf_raw::read ran head() three times per entity (its extras, the
extension-dictionary map and the per-entity handle), and each call
allocates the handle and owner text (parsed, then formatted again) even
when the record has no reactors and no extension dictionary, which is
the case for most entities of a large drawing. Both scans that only
need those two fields now first check whether the record has any 102
group at all; without one there is nothing to find.
Reading the #1076 reference DXF: 0.28 s less.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Unescape DXF text only when it holds a backslash
The ASCII parser allocated every string value twice: once in typed()
and once in unescape_unicode(), which copies its input even when there
is no \U+ or \M+ escape to resolve, after two scans for them. Half the
16.7 M groups of the #1076 reference drawing are strings, so that was
8 M needless allocation pairs. A value without a backslash cannot hold
an escape and now moves into the tag as it is. The end-of-file check
reads the value before it is pushed, as the binary parser already did,
instead of cloning the text of every record's type group.
Reading the #1076 reference DXF: tag parsing 1.22 s to 1.17 s, 0.12 s
less overall.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Size the DXF tag list from the line count
parse_with_limit already counts the file's lines to refuse an oversized
drawing before reading it; that count is the number of groups, so the
tag list is now created at that size instead of growing by doubling.
For the 16.7 M groups of the #1076 reference drawing the doubling moved
about 670 MB of tags in all and, at the last step, held the 335 MB old
list next to the 670 MB new one. The hint is capped by the tag limit
and never trusted beyond it.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Size the entity list of a DXF section from its record count
parse_entities grew its list of (owner, paper, Entity) by doubling: for
the 1.1 M entities of the #1076 reference drawing that is a list of
about 700 MB moved at every doubling and, at the last one, held beside
its 350 MB predecessor. The records come from the file but are already
in memory and bounded by the tag limit, so the list is sized to their
count once; nearly every record becomes an entity.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Borrow group text in the DXF reader's per-tag scans
Tag::str() clones the value, and the reader called it in loops that run
over every group of the file or every group of a record: the handle
seed scan over every 5/105 group (1.2 M clones for the #1076 reference
drawing), the CADCRAFT_HANDSEED probe over the OBJECTS section, the
entity plot style lookup, the handle of every entity record, the record
split of every section, the AcDbEntity marker search, the xdata brace
check and the head scan's handle, owner and group names. A private
text() helper in the io crate borrows a string or hex value instead
(the dxf crate's API is left alone), and split() keeps a record's type
as a borrowed &str, as the writer's record list already can.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Bound the tag-list reservation by the text's length
The reservation came from the newline count alone, so a file of blank
lines (`0`, `EOF`, then megabytes of newlines) reserved a tag slot per
two newlines before the parser found its one group: far more than the
grow-as-needed list would ever have taken for that input. A group is two
lines of at least two bytes each, so the text's length over four bounds
what any file of that size can hold; the reservation now stops there.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
* Size the entity list by the records that can become entities
VERTEX, ATTRIB and SEQEND fold into the POLYLINE or INSERT before them,
so a heavy polyline file reserved a slot per vertex it never filled.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Reserve the tag list fallibly, so a refused reservation grows the list instead of aborting
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Bound the entity list's reservation and make it fallible
parse_entities reserved its staging list for every record that can become
an entity, infallibly, before any record was read. The reservation now
stops at MAX_RESERVED_ENTITIES (1 << 16 entries, about 46 MiB; larger
lists grow as usual) and goes through try_reserve_exact, so a refused
reservation is a "DXF: out of memory reserving N entities" error rather
than an abort; parse_entities and read_blocks return a Result for it.
Review by FredApps on PR #1833.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: FredApps <[email protected]>
Found while testing crates/geom/src/lib.rs:43-46 (ccw_sweep), used by Arc::sweep and angle_in_sweep
Co-authored-by: Claude Haiku 5.5 <[email protected]>
Co-authored-by: FredApps <[email protected]>
Clears the two cargo-deny advisory findings that #3607 ignores for now:
- url 2.5.8 -> 2.5.9 (RUSTSEC-2026-0592, stack overflow in
Url::origin() on nested blob: URLs); form_urlencoded 1.2.2 -> 1.2.3
comes with it because url 2.5.9 requires ^1.2.3.
- async-executor 1.14.0 (yanked, use-after-free in Executor::drop)
-> 1.14.1 (smol-rs/async-executor#164).
Lockfile only; no Cargo.toml change. Part of #1935 (F-17).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* doc: a mirrored dimension reflects its direction about the mirror line
* test(doc): set insertion_point on the mirrored-dimension fixture
main added Dimension::insertion_point in #2636. The test in this PR
constructed a Dimension without that field, so clippy failed after
merging main.
---------
Co-authored-by: FredApps <[email protected]>
* Write RevcloudProps xdata on revision clouds
Fixes#1570
Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* REVCLOUD: arcs use the bulge readers need to recognise a cloud (follow-up to #1605, #1570)
Readers take a closed polyline for a revision cloud only with RevcloudProps
xdata (#1605) and every bulge within 0.02 of 0.520567; clouds used 0.5,
just outside, so ezdxf's is_revcloud still said no. Clouds now use
0.520567050552 on every creation path. Tests check the reader's condition
for all six ways of drawing a cloud and after a DXF round trip.
* Parity checklist: regenerated after merging main
* Parity checklist: regenerated after merging main
* REVCLOUD: import RawTag in the revcloud module main split out of draw2
* Parity checklist: regenerated after merging main
* Revcloud: update the recognition test for main's prompts (#1692)
Main now asks for the minimum and maximum arc length and, after an object
pick, whether to reverse direction, so the old scripts left a prompt waiting
and the test read the previous entity. A helper now checks the prompts
finished and exactly one new entity was created.
* Revcloud: drop the file-format-parity.md change from this PR (#1692)
The LWPOLYLINE note and changelog entry are moved to the PR description, as review asked.
---------
Co-authored-by: NetterSilver <[email protected]>
Co-authored-by: Claude Haiku 5.5 <[email protected]>
Co-authored-by: FredApps <[email protected]>
Co-authored-by: SBaksa <[email protected]>
Since #2119 the app bundle carries NOTICE and ATTRIBUTION.md, but not
LICENSE-MIT and LICENSE-APACHE, which the .deb, .rpm, .tar.gz, AppImage
and both zips ship. Copy them into Contents/Resources next to the
notices, before signing, so the bundle seal covers them.
Co-authored-by: FredApps <[email protected]>
* fix(io): look up table, multileader and multiline styles without scans
A crafted DXF made several style lookups cost N^2 name comparisons
(#1924, F-04 item 5):
- the reader's TABLESTYLE, MLEADERSTYLE and MLINESTYLE records, each
scanning the styles read so far for an earlier one of its name, and its
VPORT records, each scanning the viewport configurations;
- each table from another writer, scanning the table styles on read;
- each TABLE, MULTILEADER and MLINE on DXF save, for its style's handle
and values;
- render's table_style_of, which a DXF save calls for every table;
- AUDIT's multileader and table style checks, which RECOVER runs on open.
On main, N = 40 000 MLEADERSTYLE or TABLESTYLE records took 65-69 s to
open, and the DXF save of 40 000 multileaders or foreign tables naming a
missing style ran past 300 s. With this change they take 0.4-5.5 s, and
the output is byte-identical.
- ByName (from #3562) moves to dxf_ext.rs and gains position(). The record
dedups go through it, keeping the rule: a later record of a name
replaces the first in place and takes its name. A VPORT record still
adds a tile to the first configuration of its name.
- Drawing::table_styles is a NamedList, like the other style tables.
- The writer's Ctx keeps a ByName beside its table and multileader style
lists. dxf_mline::plan and Plan keep one too. Missing names fall back as
before.
- When no styles are planned (entity_groups, for entget), the multileader
style is still looked up in the drawing.
- AUDIT checks multileader styles against a lower-cased BTreeSet, and
table styles with by_name.
Tests: cost tests for each path, with behaviour checks that also hold on
the old code, and an entity_groups test for the multileader's style.
Part of #1924.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(io): trim a multiline style's name when reading it
A DXF MLINESTYLE named " Road " was kept with its spaces. Its multilines
look their style up trimmed (dxf_mline::plan, Plan::handle,
Drawing::mline_style), so a save missed it, wrote a second Road style and
pointed the multilines at that copy. main did the same: its scan compared
the trimmed query with the untrimmed name. The writer already writes the
name trimmed, and the reader's fill key trims it, so the name is now
trimmed where it is read (CodeRabbit, on #3590).
Test: a_padded_multiline_style_name_is_saved_once (fails without the
trim: the save writes STANDARD, Road and Road).
Part of #1924.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
* ci: notify artcraft-services on release state changes
* ci: pass only the dispatch token to the notify-services workflow
secrets: inherit hands the called workflow every repository secret, including
the signing credentials. The reusable workflow only reads
ARTCRAFT_SERVICES_DISPATCH_TOKEN, so map just that one.
---------
Co-authored-by: FredApps <[email protected]>
Review on #3594:
- The XCLIP attribute part's `truncated` flag now reaches the parent
list, as the block-contents part's already did. A clipped reference
whose attributes ran out of budget as the last object of a drawing
drew 98 of 105 points and said nothing.
- The parts of a parallel build are joined within the list limits
(Builder::join). Clipped copies are in no shared count, so two XCLIP'd
blocks in different parts could join to 798 primitives against a
limit of 748, unmarked. Parts are appended whole while they fit; at
the first that doesn't, the build is spent and marked truncated. This
is native-only: the web build has no parallel path.
Part of #1603.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On wasm32 a DPrim is 40 bytes and one allocation can take at most
isize::MAX (2 GiB - 1): a list of more than 2^25 primitives panicked
with "capacity overflow" when its vector grew. The 64M-point budget
(#3306) charged a point primitive one point, so it allowed 64M of them;
a 4.5 MB DXF of dotted lines reached 33.56M.
- MAX_DISPLAY_PRIMS, charged once per primitive beside the points and
shared like them: 2^24 on 32-bit targets, equal to MAX_DISPLAY_POINTS
(and not counted) on 64-bit ones, where it can't bind.
- Clipped copies (viewport contents, XCLIP) are appended only while the
list has room within both limits; the append stops at the first piece
that doesn't fit and the build is spent, as when a budget runs out.
Builder::charge checks the same room in its own list.
- Compile-time asserts: the primitive, point, pen, plotted-text and
image vectors stay under isize::MAX bytes at these limits (checked
for wasm32 by the wasm step).
- gpu::build_mesh counts its lines and quads first and allocates each
array once: the quads grew by doubling and passed 1 GiB on large
lists with lineweights shown.
Part of #1603.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the command line when a prompt is active. Keep line breaks editable and use each visible tag as the value field label.
Verified with 23 attribute editor tests and four accessibility tests on Linux.
exchange() retries once when the first attempt was not sent (or is
read-only), but the retry dropped `sent`: a mutation the retry sent and
whose reply was lost came back as a plain transport error, without the
"may or may not have been applied" warning. The new ping before long
requests adds a way into that retry (a lost ping reply counts as not
sent). The retry now keeps `sent` and returns the same warning for
mutations; read-only methods keep the plain error.
Test: a_lost_reply_on_the_retry_still_says_a_mutation_may_have_been_applied.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A later outline was closed back to its start only when its end lay farther
than the tolerance from it (review). With the end within the tolerance but
not equal, the jump back to the first outline left from the end while the
jump out arrived at the start, so the two did not cancel under even-odd
fill and a sliver between them was filled. The start is now added whenever
the end differs from it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The end lookup took any unused end in the 3x3 grid cells around a point,
so ends up to about 2.8 tolerances apart could be joined (review). The grid
now only gives candidates; each is checked with Vec2::near against the
tolerance and the lowest eligible end wins, as the "runs on" and closed-run
checks already did. A cell's scan stops at the best match so far, and the
ends visited are capped at 32 per end of the loop: past that, a crafted
loop is read in file order.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
An edge path was read in file order, so an edge listed elsewhere or stored
end to start made the vertex list jump, and the even-odd fill filled the
polygon of the jumps (a square listed AB, DC, BC, AD filled as an hourglass).
Each edge is now read on its own and hatch/chain.rs joins them. A path whose
edges already run on is joined in file order as before. Otherwise edges are
chained into runs by their ends (within a millionth of the loop's extent,
at least 1e-9), turned around when needed (points reversed, bulges negated
and moved). Closed runs fill as loops of their own; open runs are joined in
order, as a path read in file order is. Ends are looked up in a sorted grid,
O(n log n).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The control server checks a request's token only after reading the whole
line, and clients send the token last, so a local peer without it could
make the app buffer a line of up to 256 MiB (512 MiB across connections).
Until a request on a connection has passed the token check, a request
line may be at most 64 KiB (control_token::MAX_UNAUTHENTICATED_LINE); a
longer one gets an error reply and the connection is closed. After that
the usual 256 MiB limit applies.
The MCP bridge sends a short ping with the token before a longer request
on a new connection, and sends the request only when the ping's reply
shows the token check passed; a refused or lost ping leaves the request
unsent and safe to retry. docs/control-protocol.md describes the limit.
Part of #1925 (F-12).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
At the Specify scale factor prompt, a picked point at the base point gives a
factor of zero. The command then cleared the selection and ended without
scaling anything or saying why. It now answers "Requires a positive number."
and stays at the prompt, keeping the selection and base point, as typed
factors and the Reference option already do. Non-finite factors are rejected
the same way.
An ATTDEF or ATTRIB in a tilted plane facing up holds its insertion
point, alignment point and rotation in that plane's OCS (DXF Reference,
ATTDEF and ATTRIB groups 10 and 11 "in OCS"; "Object Coordinate Systems
(OCS)"). The reader took them as world coordinates, and the writer saves
attributes with no group 210, so a save moved the attribute millions of
units in a drawing near survey coordinates.
flatten_tilted maps them through Mat4::ocs and turns group 50 into the
plane's direction in plan, as tilted LWPOLYLINE and HATCH are drawn
flat; an ATTDEF's extrusion is then spent. ATTRIBs of a reference that
is itself left in its tilted plane (#1158) stay as read with it; the
INSERT arm and that check share mirrored_reference. Planes facing down
(mirror_text), flat attributes and TEXT (#3296) are unchanged.
Fixes#3541
Co-Authored-By: Claude Opus 5.5 <[email protected]>
e9e4b0e1f made a gaps-only pattern draw nothing past the per-run limit, but
it was still drawn as one continuous line where a pattern with a dash falls
back to continuous: a run shorter than one period, a pattern under
`min_pattern` (sub-pixel), past 50,000 periods with a level of detail, and
a run of one point (review of #3564). On screen that also differed from the
plot of the same run.
apply, apply_as and ranges now return no dashes for a pattern whose elements
are all gaps, before any of those fallbacks. Patterns with a dash or a dot
keep every fallback, and an empty (continuous) pattern is drawn whole. Texts
and shapes in a gaps-only pattern are placed as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
main now holds the dimension styles behind a shared pointer; the ATTMODE
comparison is kept next to the updated style comparison.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Review of #3564:
- A closed run is stretched to round(L / period) periods and laid out from
the period before its anchor to the one after its last, up to half a
period more than the (L / period + 2) elements it was charged. A run of
192 on 127 dashes and a gap (period 128) walked 508 elements for a charge
of 448. It is now charged (round(L / period) + 2) x the pattern's length.
The per-run limit keeps its formula, so runs under it keep their output.
- A pattern of gaps only was refused past the per-run limit, drawn as one
continuous line and counted as undashed, while below the limit it draws
nothing. It now draws nothing at any length, uncharged and unreported.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`(gcd -2147483648 0)` gave 2147483647 (the divisor clamped to the
largest integer), and `atoi` cast its digits with `as i32`, so
"99999999999" gave 1215752191 and "99999999999999999999" gave 0.
They now follow what the reader, `fix` and JSON inputs already do with
a whole number that doesn't fit 32 bits: it is a real. `gcd` gives
2147483648.0 for its one such result; `atoi` gives the real `atof`
reads from the digits, the number the reader makes of them. Results
that fit are the same integers as before. Integer arithmetic still
wraps.
Part of #1933.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first commit made `cadcraft-cli convert` print the note, but the app's
own commands write images through IoHooks::write and ::plot, which return
bytes only, so the desktop and web apps and LISP stayed silent (#1069).
- cmd::file::set_noted_io(NotedIo { write, plot }): an optional hook beside
IoHooks (which is built by struct literal in ~70 places), installed by the
CLI, desktop and web apps with cadcraft_io::write_framed_noted and the new
cadcraft_io::plotter::plot_noted / pdf::plot_noted.
- EXPORT, PLOT (so EXPORTPDF, PUBLISH and PDFBOOK per sheet), QSAVE and
SAVEAS to an image and document.bytes echo the note and add it to the
result's `warnings`. An image written with a `version` option goes through
the same writer (same bytes), so it is noted too.
- report_notes adds to `warnings` instead of replacing them;
report_dwg_notes uses it (no result had `warnings` before it, so DWG
results don't change). Without the hook nothing changes.
Not covered: the plot preview and the canvas show no message.
Fixes#1069.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
An expression typed at a command's prompt (CIRCLE, then `(while T)` as
the radius) is the prompt's answer, so it ran as a blocking run with the
500,000,000-step cap meant for programmatic calls: about 17 s on a dev
build with no frame drawn and Esc not handled.
It now runs through `lisp_eval_answer` with a 20,000,000-step cap, and
the callbacks it runs (`vl-sort`'s comparator and the other synchronous
callbacks) share what is left of that allowance instead of each taking
the 500,000,000-step callback allowance inside one step. The error says
the expression was stopped and to run long routines at Command:, where
they run a slice per frame and Esc stops them. Routines at Command:,
`c:` commands, APPLOAD, dropped files, the `lisp`/`appload` JSON calls
and startup files are unchanged.
Part of #1926 (item 3).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
DATALINK remembers up to 1000 linked files per open drawing. At the
bound a new file dropped an arbitrary entry of a HashSet, which could be
the file linked just before it. Each remembered file now carries when it
was last linked: linking it again moves it to the newest, and a new file
at the bound drops the one linked longest ago.
Test: remembered_links_are_the_most_recent_ones.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The filter labels were translated on the dialog's thread, where the
interface language (thread-local) is English. They are now read on the UI
thread and handed to the dialog's thread.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The Open, Save, APPLOAD and ALIASEDIT dialogs ran in the window's event
handler and waited there for the desktop portal's dialog. For as long as it
was open the window answered nothing, and after a few seconds the desktop
offered to force-quit the app. The dialog now waits on a thread of its own,
through Services::start_pick, as the macOS sheets do.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
A dashed run is laid out over at most two million pattern elements, but
nothing bounded the total, and a pattern of mostly gaps visits many elements
for each point it draws, so the 64M-point display budget never stopped it:
1,000 lines on a 256-element pattern of gaps and one dash (a 58 KB DXF) took
11.6 s to PNG and 12.7 s to a 69 MB PDF on a dev build. A run past the
per-run limit was also drawn continuous without a word (#1069).
- MAX_DASH_ELEMENTS (64M, as many as the list's points) is charged by
linetype::layout before a run is laid out, on a counter shared like the
point budget's (parallel parts, XCLIP parts, viewport contents). Once a run
does not fit, the rest of the build's dashed runs are drawn continuous.
The per-run limit is MAX_RUN_DASH_ELEMENTS, unchanged.
- A run drawn continuous because of either limit sets DisplayList::truncated
and counts in the new DisplayList::undashed, merged where lists are joined.
Runs drawn continuous by rule (short, sub-pixel, the screen's 50,000-period
level of detail) are not counted.
- cadcraft_io::write_framed_noted (and png/svg/pdf "noted" variants) return
the note; cadcraft-cli convert and run --export print it.
- Linetype texts are placed only on a run whose dashes were laid out; phase
checks the limits without laying the run out again.
On 11 real drawings the most a complete plot asked was 26.5M elements; a
16M total would have drawn 8,241 runs of that drawing solid. With 64M the
gap-pattern file takes 0.8 s / 0.4 s, the #1069 controls and three real
drawings export byte-identical, and the audit's dense dash/gap file stays as
on main (it fills the point budget at the same time).
Part of #1923 (F-05 f). Part of #1069: the app's EXPORT and PLOT don't show
the note yet.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts: crates/fonts/src/ttf.rs (main made OutlineMesh's points pub(crate); kept that and this PR's bounds field) and crates/render/src/tests.rs (kept this PR's #666 view test and main's fixture-font section).
Main also added a public font-set GENERATION/generation() for redraws (2c979eb1), which clashed by name with this PR's private lookup-cache counter. Renamed this PR's counter to LOOKUP_GENERATION/lookup_generation(), and set_font_dirs now also calls changed() so the per-thread caches drop fonts from removed folders.
cargo test -p cadcraft-fonts -p cadcraft-render and cargo fmt --check pass locally.
The DXF reader looked for an earlier VIEW or UCS of the same name by
scanning the records read so far, and found each layout's named UCS by
scanning every UCS, on read and on save. A crafted file of N VIEW or N UCS
records, or of N layouts each naming one of N UCSs, cost N^2 name
comparisons (#1924, F-04 item 3): at N = 40 000 it took 67 s and 194 s to
open on main.
- ByName: the records of a table read so far by lower-cased name; a later
record of a name replaces the first, which keeps its place and takes the
later record's name, as before. DIMSTYLE records use it too.
- UcsNames: the drawing's UCSs by lower-cased name with their positions in
table order; a layout's named UCS is the first of that name whose frame
is the layout's, as named_ucs finds it. Built once per read and per save.
Tests: VIEW/UCS records (main 118.9 s, now 0.23 s) and layouts naming
UCSs, read and saved (39.9 s, now 1.6 s), against a 10 s bound; a
behaviour test compares UcsNames with named_ucs. Follows #3539.
Part of #1924
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A table's data link path is stored in the drawing, and DATALINKUPDATE
copies the linked file's text into the table, where the next save keeps
it. A stored path could name any local file (by `..` or an absolute
path), so a drawing could pull any readable file into itself.
A link the drawing itself names is now read only when its file, resolved
by the file system (`..`, symbolic links and junctions followed), lies in
the drawing's folder or a folder below it, compared by whole components;
the resolved path is the one read. A file the user links with DATALINK
is remembered for that open drawing (never saved, at most 1000, newest
kept), so it keeps updating until the drawing is opened again. Refused
links are listed in DATALINKUPDATE's errors; the other links update. The
automation roots are still checked first.
Part of #1929 (F-08).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A dimension block holding dimensions of itself, directly or through block references, other
dimension blocks, multileader blocks or proxy graphics, was drawn again for every such dimension at
every level down to MAX_BLOCK_DEPTH: k of them made up to k^16 copies, a loop through many
distinct blocks one copy per ordering of them, cut only by the 2M expansion budget. A crafted
490-byte DXF took 79 s to export to PNG (dev build), 602 bytes over 300 s.
A dimension inside block C is now drawn from its own block T only if T does not lead back to C.
A short search from T (16 blocks, 256 objects) settles ordinary blocks; past it the strongly
connected components of the block graph are found once per build (iterative Tarjan, shared through
a OnceLock). A dimension on a loop is drawn from its definition points, as one whose block is
missing is. Loops made only of block references are unchanged.
Part of #1923 (F-05).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
One conflict, in crates/engine/src/cmd/modify/select_then.rs: this branch
adds COPY's copy_prompt, copy_input and copy_done just above join_now, and
main (#2725) rewrote join_now's doc comment. Kept both: the COPY methods,
then main's two-line doc. The struct fields (copy_single, copies,
copy_array, ask_circle), SelectThen::new and the match arms merged without
conflict. No behaviour changed on either side.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drawing::linetype, text_style, dim_style and layout scanned their table,
once per entity while a drawing is drawn, measured or saved, and once
per layout after every command. The DXF reader also scanned the
dimension styles once per DIMSTYLE record and the layouts by exact name
once per paper-space object. So a crafted file of N records and N
entities naming one it lacks, N DIMSTYLE records, or N layouts with N
objects in the last of them cost N^2 name comparisons (#1924, F-04
item 3): at N = 40 000 a PNG export took 23 s, opening 107-151 s or
more than 300 s on main.
- linetypes, text_styles, dim_styles and layouts are NamedLists (from
#3484) and the four lookups use its index: the first entry of a name
in list order, ASCII case folded, as the scan returned.
- NamedList::by_name_mut: the first entry of a name to change.
- Scans with the same answer go through the lookup (STYLE, DIMSTYLE,
RENAME, -DIMSTYLE, .lin loading, COMPARE, COUNT, UCS, plotter, DXF
header, Layers panel).
- The DXF reader indexes DIMSTYLE records by lower-cased name, and maps
layout names (exact) to the first layout of that name once per pass.
Cost tests (doc: one per table; io: DIMSTYLE records and layouts) fail
on main at 66-421 s and pass within 3 s; a behaviour test compares
every lookup with a scan.
Part of #1924
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Nightly launch fix under Skylar's Exec 454: the Launcher's trailing `--` no longer reaches the file list where that applied, and a refused launch no longer blocks on macOS (the reason goes to stderr and the app exits 2).
Keep the Attribute Editor alongside the INSERT attribute entry and Array dialogs. Start the headless runtime in the Attribute Editor UI tests, as on main.
acadrust 0.6.6 writes and reads a DWG linetype's element count as one
byte, so a linetype of 256 elements came back from a DWG save with none
(continuous) and one of 300 with 44. The DXF read cap of #3482 lets 256
through, so every capped DXF linetype hit the 256 -> 0 case.
The DWG bridge text now writes at most 255 elements per linetype (the
first ones, with group 40 totalling them); DXF output is unchanged.
cadcraft_io::dwg_notes gives one note counting the linetypes cut, counted
by the writer so an xref linetype the file leaves out is not counted. An
engine hook installed by the apps echoes it and returns it in `warnings`
on every DWG write: QSAVE/SAVEAS, document.bytes, EXPORT, WBLOCK,
-WBLOCK, LAYOUT SAVEAS; cadcraft-cli convert prints it.
Part of #1923 (F-05).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
muda's predefined Quit ends the process through terminate: without asking. The menu item
is craft-quit's Quit, a close request of the main window, so the close path asks first
as the close button does (#2157).
Supervised nightly switch-on, merged under Skylar's explicit Nightly 758 override after green CI, CodeRabbit on this head with no open threads, Sonar passing, and an independent adversarial review with no blockers.
The web build's RandomState keys come from addresses, not entropy, so a
file could pick tags whose hashes collide and bring back the A x K cost
this change removes. Key the by-tag maps by the tag's ASCII-folded bytes
in a BTreeMap, as the layer and block name index (#3484) does. Matching
is unchanged: TagKey's order is consistent with eq_ignore_ascii_case.
Part of #1923.
The reader builds a user-defined hatch's families from its double flag (77) when a file lists
no definition lines, as AutoCAD writes its own. The other tests save explicit families, so none
of them reached that fallback. This one rewrites a saved hatch to 78 = 0 with no lines and a 77
of 0 or 1, and reads it: one or two unit families, with the hatch's angle and spacing kept. It
fails with the fallback switched off.
Renders the plain nightly tar's launcher from craft-common-actions' shared template.
Independent check: dylanmtaylor compared all 14 app launcher PRs byte for byte with the template rendered from the registry (https://github.com/storytold/craft-common-actions/pull/367#issuecomment-7172085284); this head was re-checked against craft-common-actions main 88148a5.
A covered cell's text now goes in its own value block, like any other
cell's, instead of an empty block, so unmerging after a reopen brings
it back. An empty covered cell still writes an empty block. Follow-up
to #3392.
A script's own HATCH line started taking the published command-line
questions, so `HATCH A <angle>` in a script read A as a pattern name and
left the command asking for a scale. HATCH now asks them when an AutoLISP
`(command ...)` call starts it: the program input a routine feeds the
command line. A script's own line and a person keep the interface's
prompts, picking the boundary first, as before. A routine's call made
inside a script still gets the published order.
The two starts are told apart at the point HATCH chooses, with
lisp_program_input(), which answers for the routine's input alone:
command_origin() reports a script and a routine as program starts alike.
A script's HATCH keeps the interface's prompts, and a routine's call from
inside a script keeps the published order, each with its own test.
As before the move to the craft-ui dock, a tab held while the layout
resets is not dropped into the reset layout. The reset replaces the
workspace, so its generation changes.
The tests assert CADCraft's own close decision for a saved drawing and
for a programmatic quit, as they did before the platform's quit joined
the close path, so they pass on macOS, where that quit cancels the window
close. Unsaved drawings still run the whole close frame.
As before the move to the craft-ui dock, opening or activating a panel
with a command raises the floating window that holds it, once. Docked
panels only become the front tab.
A HATCH with the pattern name _USER was saved with group 78 = 0 and no
definition lines, though the DXF Reference has no user-defined exception
to 78's number of pattern definition lines. Another program read no
lines and its explode produced nothing, and a hatch whose lines are
based away from its origin reopened with them at (0,0).
The writer now lists a user-defined hatch's own families as it lists
any pattern's: each line's angle, base point, offset and dashes, scaled
and rotated as the hatch draws them, with the real count in group 78.
The pattern type (76 = 0) and the double hatch area flag (77) are
unchanged, and a DWG keeps the lines too, since the bridge converts the
same written HATCH. A file that lists no lines for a user-defined hatch
(78 = 0, as AutoCAD writes its own) is still read from its angle,
spacing and double flag.
The save test now expects the real count, and a doubled user-defined
hatch based at (1,1) keeps both families' angle, base point, offset and
count through a DXF save and read and a DWG save and read.
The keys (Cmd on macOS) step the Options interface scale by a tenth, within its limits, and Ctrl+0 sets it back to 100 %. They work while a text field or the command line has the keyboard, and a key the user gave to a command runs the command. In the browser they zoom the page.
A height of 0 is drawn as a height of 1, which left the Aligned box
empty (0 / 0). Fit text with an unusable width factor is drawn at its
own width, not stretched to the second point.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
A script, a LISP (command ...) routine or the command line's -HATCH
used to share one prompt machine: HATCH took every answer as a pattern
name. HATCH now asks the published questions when a program starts it:
the pattern name (or ?, Solid, or the user-defined form), then the
pattern's scale and angle, or the user-defined form's line angle,
spacing and double flag, and then the boundary objects. Enter takes
the default at each question, and a refused scale or spacing is asked
again.
-HATCH keeps its own prompts. It is a command id of its own rather than
an alias, so a dashed start is never the HATCH sequence; a person, the
interactive HATCH and the -HATCH Properties option are unchanged.
A user-defined hatch is stored as DXF's _USER pattern: pattern type 0,
the spacing as its scale, the lines' angle, and a second family at
right angles when doubled, which the file's group 77 records. DXF
reads the families back when a file has no pattern definition lines,
and writes the pattern type and double flag.
-HATCH is classified with the file-reading commands.
A press in the drawing, and a drawing that opens or becomes active, give the drawing the focus; a text field, a dialog
or a menu keeps it. The focused drawing keeps Tab (KeepKeys::Tab) only while a command runs, text is typed, value boxes
are live or a snap marker is under the cursor. A bare Tab with nothing focused is the framework's: capture_tab is gone.
Aligned and Fit text are drawn from their first point to their second,
whatever rotation is stored: Fit at its own height with its width
stretched, Aligned at the height that keeps its proportions. The
extents measured them like left-justified text at the stored rotation,
so ZOOM Extents and selection by box missed where they are drawn.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The drawing's host canvas is declared with the id of the drawing's own widget, so egui keeps the focus Tab gives it.
While the drawing is the focused Tab stop, the command line and the shortcuts take the keyboard as with nothing focused.
A stretch whose end is within TRIM's on-cut tolerance of its pick made TRIM run on to the next
cut and take more than planned; it is now left and the object counted as uncut. Only pieces of
no length are deleted, as TRIM leaves short ones. An object cut in part is counted with those
not cut everywhere (skipped.partly), not also as trimmed.
The highlight merged cut points within 1e-9 of the distance from the origin, a whole unit near
x = 1e9, so a visible 0.5-unit trim there was merged away and the whole object highlighted. Cuts
now merge only when f64 can't tell them apart.
Phase 1 of storytold/craft-i18n#401 for CADCraft's own vi.tsv.
- 44 existing rows: the 8 terms raised in #401 (14 rows), "nạp" for
loading into CADCraft (8 rows), Boundary as "Đường bao" (2), the 17
rows left in English (Find and Replace, Magenta, Working Set, Feet)
and 3 rows kept consistent with them. "tỉ lệ" stays as spelled.
- 249 new rows, one for each string the translation_gaps report listed
(Dimension Style Manager and dimension properties, keyboard shortcuts,
right-click customization, Array dialog, UCS, ALIASEDIT, commands),
grouped under comments. The report now prints "vi: nothing missing".
- ATTRIBUTION.md: the phase 1 changes were reviewed by a native
Vietnamese speaker; older rows are not yet proofread in full.
Translations are written from the meaning of the English strings and
their use in the code (clean room).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The index mapped a hash of the case-folded name to the first entry of that hash, and scanned the
table when the entry's name differed. On wasm32-unknown-unknown, std's RandomState takes its keys
from a stack and a heap address (library/std/src/sys/random/unsupported.rs), so a crafted file
could pick colliding names and keep every lookup a full scan on the web build (review of #3484).
The index is now a BTreeMap from the name's bytes with ASCII letters lower-cased to the first
entry of that name. eq_ignore_ascii_case compares exactly those bytes, so a lookup returns what the
scan returns without a fallback, and costs O(log N) comparisons whatever the names are. Short
names are folded on the stack. Measured, one search costs about a scan of 100 names and a build
about 100-350 scans, so tables are indexed from 128 entries and after 256 scans since their last
change.
A new test builds the index alone and finds the first entry of every name: case variants, names
that differ after a long shared prefix, names of 64 bytes and longer, non-ASCII names and the empty
name. The cost test now uses 60 000 names and a 10 s bound (166.6 s on main).
Part of #1924 (F-04).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
One block reference with A attributes of a block with K attribute
definitions cost A x K tag comparisons wherever they are matched: the
extents (constant values a reference carries, the layer of an attribute
without its own), the renderer's constant values (per MINSERT copy), the
DXF writer (ATTRIB properties, MULTILEADER block-content values), BURST,
ATTSYNC/BLOCKREPLACE and the dynamic-grip preview. Crafted 16k x 16k and
32k x 32k files took 2-28 s to open, draw or save in a dev build.
TagKey compares and hashes a tag without ASCII case, as
eq_ignore_ascii_case does; Block::attdefs_by_tag and
Insert::attribs_by_tag keep the first definition or attribute of a tag,
as the scans' find/any did. Each site builds the map once and looks each
tag up once. Outputs of the crafted files are byte-identical.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drawing::layer scanned every layer, and Drawing::block scanned every block when the exact name
missed. Both run once per entity while a drawing is read, measured and inspected, so a file with N
layers, or with N blocks and N references to blocks it doesn't have, opened in N² comparisons
(40 000 missing-block references: 75.7 s in a dev build; 40 000 layers: 6.8 s).
Drawing::layers is now a NamedList<Layer> and Drawing::blocks a NamedMap<Arc<Block>>. They read
and change as the Vec and BTreeMap they wrap, and keep an index from a keyed hash of the
case-folded name to the first entry of that hash. A hit is checked against the name and falls back
to the scan, so results are the same as before: same case rule, first match in table order, exact
block name first. Every change goes through DerefMut, which drops the index; a clone (undo
snapshot) shares it. The index is built only for tables of 64 entries or more, after 32 scans
since the last change, so code that changes a table between lookups costs what it did.
Part of #1924 (F-04).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- names_by_index (was layers_by_index): markers only for the indices a
record uses, looked up in a map, so a large index costs no more than a
small one; the 65,535 cap goes.
- An index after which the graphics stay on the layer before is named by
the file's LAYER table when it names that layer there.
- with_proxy_tables (was with_proxy_layers) remaps kept dimensions'
pictures too; a reference to a *D block is never taken for the picture.
- Snaps walk a record's graphics like a block's contents: none on layers
that are off or frozen.
- ellipse() rejects conjugate radii on one line (an exact quarter turn
draws as a line); a sweep at or below EPS draws as its chord.
- Linetype indices follow the written LTYPE table (Drawing::proxy_linetypes);
RENAME follows, PURGE keeps linetypes only proxy graphics use.
An LTYPE record kept every dash element a DXF listed, while a .lin file
is capped at MAX_LINETYPE_ELEMENTS (256). The renderer clones the whole
linetype for every object drawn with it and walks the pattern on every
run, so a crafted 400,000-element pattern made a PNG export of 250
lines take 18-22 s on a dev build (8 s or less with this change; the
rest is the renderer walking 1M gap steps per line).
ltype_pattern now stops at the 257th element: the linetype keeps its
first 256 elements, the text and shapes of the dropped ones are not read,
and one read note counts the linetypes cut. Saving writes the elements
kept. A DWG reaches the reader as DXF but cannot carry more than 255
elements (one-byte count), so the cap does not fire there.
Part of #1923 (F-05).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts: Cargo.toml (kept the next/egui pins for every craft-libs entry, including main's new craft-csv and hayro-interpret/cmap/postscript patches), apps/cadcraft/src/main.rs (port's framework frame decision and apply_frame with main's os_window identity, persistence path and exit hook), crates/ui-egui/src/updates_ui.rs (next's argument-free check calls with main's check_updates_at_start gate). Main's new tests and dialogs switched to install_headless and escape_pressed.
A stretch picks which ends of an arc move by testing the dynamic
block's arc ends against its frame (0 its start, 1 its end), but a
mirror swaps an arc's start and end (Arc::transform). In a reference
flipped by a flip action, the copy's start is the block's end, so a
later stretch moved the wrong end and distorted the arc.
The stretch now maps the indices to the copy's when the copy is
mirrored from the block: by the flips the reference already has (an
odd number of flipped flip actions holding the object; a repeated
selection counts once and a reflection line of no length mirrors
nothing, as the flip action itself does) and by mirrors queued for it
earlier in the same change. Unmirrored arcs keep their indices.
Tests: a flipped door arc stretched by Width (flipped, not flipped,
held twice, two flip actions, a reflection line of no length), and a
lookup that flips and stretches in one change, with the flip action
before or after the stretch, and back.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
b781f047 said AutoCAD 2024 was measured at ARRAYEDIT's columns, rows
and items. That measurement was made after the clean-room standard of
20 November (one agent session must not both operate AutoCAD and write
code), so the claim is withdrawn.
The module doc now lists only ARRAYRECT's rows and columns,
ARRAYPOLAR's items and rows, and -ARRAY's rows and items as measured.
The arrayedit_counts doc says ARRAYEDIT's counts go through the same
count() parser in crates/engine/src/cmd/array.rs, so they refuse and
take the same texts; no AutoCAD measurement of ARRAYEDIT is claimed.
Comments only: the test logic and the engine code are unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A large arc's flattened outline strays from the arc by up to a millionth of its radius, more
than the tolerance next to a short edge, so a stretch's pick could miss every piece and the
object was still counted as trimmed through. The pick is now brought onto the object's exact
lines and arcs and the pieces are measured exactly; a stretch still not found counts the object
as uncut. The menu entry moves to Additional Tools, and the es/zh rows go (feature PRs add
English only).
The rollover highlight's cache key now counts the running command's answers, so Undo at the
fence prompt redraws the preview without the cursor moving. A Fence or Crossing preview works
out at most 64 picks; past that it shows no part highlight, and the fence still trims them all.
Since #3462 a block reference's bounds include the constant attribute
values it shows, which ATTMODE decides. The index kept bounds measured
under the old ATTMODE, so after a change window selection and picking
could miss, or still find, a constant value. ATTMODE is now part of the
context the index is reused under.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The rectangle a dimension is hit along keeps the room of block text the
viewport leaves out (`outline_in`), but a pick, selection cycling, a crossing
window, a fence and a crossing polygon first tested `bounds_in`, which leaves
that room out, so a side lying there was never reached. They now test
`touch_box_in`: `bounds_in` with that room. A window's containment test stays
on `bounds_in`.
A window polygon tested the corners of that rectangle as well, so it needed
the hidden text's room where a window of the same shape did not.
`hit_polylines_in` now keeps the room only for selections that touch.
The dimension-text test asserts the top side of the rectangle for each of
those selections and a window polygon against a window of the same shape.
Conflict in crates/engine/tests/it/spline_options.rs, where both sides
appended tests: keep reverse_keeps_a_closed_spline_seam and main's SPLINE
CV method tests (#3456).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
At coordinates near 2^29 the cross products of absolute coordinates
round away a unit of area, so a unit square there had zero area and its
nonzero fill was dropped. The products are now taken relative to the
contour's first vertex.
An even-odd loop's depth was counted at a point nudged just inside its
longest edge. A hole drawn closer to that edge than the nudge held the
point, so the outer loop counted as nested and neither loop was saved
with the outer flag. When no two contours meet, each is now placed by
the middle of its longest edge, as nonzero fills already are; crossing
contours keep the nudged point.
rect_of joined the points of every subpath, so two open segments that
reached the four corners of a box were read as that box, and a stroke
through it was kept. A rectangle must now be one subpath. A clip whose
subpaths each lie on one line encloses no area and clips everything;
any other clip of several subpaths is still reported as not applied.
A glyph joined a run when it lay within 0.1 em of the previous glyph's
baseline, so text that climbed a little each glyph stayed one run and
was placed on the first glyph's baseline. The offset across the baseline
is now measured from where the run starts; the gap along it is still
measured from the previous glyph.
Two clips that only touch intersect in a rectangle with no area. Shapes
under it were already left out, but a glyph whose middle lay on the
shared edge passed the inclusive range test and was imported. Text now
needs a clip with area as well.
Render mode 2 fills a whole Tj or TJ and then draws it again for its
stroke. A TJ that split into two runs arrived as fill A, fill B, stroke
A, stroke B, and the one remembered text matched neither stroke, so both
words were imported twice. The same record also dropped a later fill of
the same text in another colour.
The glyphs filled since the last shape, image or stroke are now queued,
and only a stroke glyph that repeats the next queued one is skipped.
Fills are never matched against each other.
Main moved the action loop into ActionRun (#3424). The frame test for
wipeouts and arcs moves into ActionRun::stretch; a polar stretch still
moves a wipeout or an arc whole, as it did, now that move_entity reads a
stored list for them (tested). Main's array helpers and the hatch outline
code sit side by side.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Survey feet, inches, yards and miles fell through to the millimetre
case, so a page imported into a drawing in survey feet came in 304.8
times too large. A survey foot is 1200/3937 m.
Such a reference draws its attribute and not the definition's value, but
the extents still added the value's box. The cache of block bounds now
keeps each constant value by tag, and a reference leaves out the ones it
carries an attribute for.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Linux nightly packaging by @dylanmtaylor, with the per-app Nightly flavor commits stacked on his branch.
Co-authored-by: Dylan M. Taylor <[email protected]>
Bind an Array window to the running rectangular/polar array commands: fields apply live in both directions while the command-line prompts and canvas preview stay active.
The polar window exposes Items, Angle between, Fill angle, Rows and Levels; the centre must be specified before OK commits.
The preview stays visible while the pointer is over the window.
Tab after the second value now locks it (when typed) and moves back to the
first box, so the typed length or X can be changed; Tab there moves on to the
second box again. Typing and Backspace in the first box edit only the first
value, keeping the separator, the second value and its lock.
Escape, history recall, a picked option or a click could clear or replace the
command line while the first-box record stayed set, so retyping the same text
later reactivated the first box without Tab and put the next digit into the
first value (40<90 then 1 became 401<90).
Turning Dynamic Input off (F12) with the first box active left the record set
too, so Backspace then erased from the first value (40<90 became 4<90). The
record now goes whenever the Dynamic Input boxes are not on screen.
With the first value erased after Tab locked the second one (40<90 to <90),
the canvas now holds the locked angle (or Y) too, so the preview and a click
use the pointer distance along 90 degrees instead of the free pointer.
Escape and a click that used up the typed entry left the second value's lock
set, so retyping the same text (40<90) locked the angle without Tab. Both now
drop the lock as well as the first-box record.
A separator typed in the first box that switches the format is refused when
the second value does not read in the new format (40<N to a comma would give
40,N, which reads as nothing and hid both boxes); the entry and the first box
stay as they were.
A click at a prompt is now taken when the button goes down, and that path
also uses up the typed entry; it drops the lock and the first-box record the
same way, so a click there does not leave 40<90 locked for the next retype.
The bounds of a block's contents are cached by name and depth for block
references and for dimensions that use the block. Only a block reference
draws constant attribute values, so with one cached box the reference's
extents depended on which of the two measured the block first. The cache
now keeps the geometry and the constant values apart.
A constant value whose definition matches the layout's orientation is
drawn upright, and is now measured that way too.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
A paste asked for while another command runs waits for the system
clipboard before it takes over. Input given in that time (a coordinate
typed or picked for LINE) answered the running command's prompt, and
the paste then cancelled that command anyway. The session now counts
the inputs it is given, a held paste remembers the count, and it is
dropped when input arrived before the clipboard was read.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Constant attribute definitions are not copied into a reference as
attributes; their value is drawn from the definition with the block.
The renderer skipped every attribute definition while drawing a
reference's contents, so constant values never showed on screen, in
plots or in exports, and the reference's extents left them out.
A constant definition inside a referenced block now draws its value
(multiline as multiline text) with the definition's properties and the
reference's transform, inside each array copy and under XCLIP like the
rest of the block. ATTMODE applies as for other attributes: 0 hides it,
1 hides an invisible one, 2 shows it. Variable definitions still draw
nothing from the block. A reference that carries an attribute with the
same tag draws that attribute only, not both.
The reference's extents add the box of each visible constant value, so
ZOOM Extents and selection by box agree with what is drawn. Hit testing
of a reference already reads the rendered geometry.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A paste asked for from a menu or the command line waits for the system
clipboard for up to half a second. If another drawing became the shown
one in that time (a file read in the background finished opening), the
held paste ran there. It now remembers its drawing and is dropped, with
a line in the command history, when another one is shown.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
`unknown_bounds`, added on main by #2697, now takes the layers frozen in the
viewport and the drawing-bounds cache, and passes them on to `in_block_visible`
and `bounds_in` as the other block paths do. Without them the merge with main
did not compile. A proxy is never selected itself, so this only matters for a
proxy that is a part of a block: its graphics on a layer frozen in the viewport
take no room in the reference's box there. A new engine test covers that case.
A user alias typed alone routes as its command in the interface, so an
alias of HATCH (KR) opens the Hatch dialog as HATCH does, also when typed
with the Greek layout active (ΚΡ). With more on the line (KR P ANSI31)
it goes to the engine as before, which runs the command with those inputs.
The shortcut loop ran every paste command as already read, but only the
ones from this frame's clipboard events are. A paste command the user
bound to a key of its own fired from the key press with nothing read, so
it pasted what this window held. It is now held like a menu paste.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The test gave each segment a constant width, so a miter from an offset of the centre line would also have passed. The first segment now widens from 2 to 4, and the corner must reach (11, -2.1), where the edges meet, not (11, -2).
Each segment's band was built with that segment's own normal, so a wide
polyline showed a notch at every vertex. Each vertex now gets a corner on
the outer side of the turn: the two outer edges are extended until they
meet, or bevelled past the miter limit plot style joins already use.
Tapered segments meet where their own edges do; closed polylines get the
corner at their first vertex; repeated vertices don't stop it; straight
runs get nothing extra.
Wide polylines with a linetype (wide.rs) follow after #2487.
The prune guard parsed a dependency owner's action list again for each
dependency in each pass. finish now collects the handles of the kept
actions of unknown shape once, beside the handles they reference, and
the guard tests the owner against that set. The exemption is unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The capture rig ran note_raw_geometry alone, so the framework never got
the Options interface scale (FrameInput's Scale, given in before_input)
and egui's zoom stayed 1: the settled-scale test saw 800×600. It now runs
raw_input_hook and before_input, as the desktop app does.
The admission test reseeded the geometry for each request, an identity
change that the next drain rejects queued requests for; it now admits
all four against one geometry, so all four issue and stay undrained.
The native menu bar refreshed enablement with the command's own check,
so Edit > Paste stayed disabled there until something was copied in this
window. It now asks clipboard::offered, like the in-window menus and the
context menu.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Harnesses and bare contexts that run CadApp::ui install the runtime headless; rigs that
run the raw hook also run before_input. Dock tests use the workspace accessors, next's
action constructors and the tabs' accessible names; tests of the old renderer's hit rects,
divider ids and drag bar are removed.
The runtime is installed in the desktop and web shells, before_input runs in the raw hook,
the close path decides in embed::logic, and the interface scale is the runtime's RootEnv
scale. The dock is next's DockArea over the saved workspace with CADCraft's panel bodies
and the drawing as its canvas group; ui.dock keeps its JSON vocabulary. Update dialogs run
on a DialogHost, the macOS title row is shell::TitleBar, screenshots use the runtime's
screenshot slot, and Escape with nothing focused is read as the window's cancel.
The alignment search projected the cursor onto a ray as if it were an
xline, so a point behind the ray's base could be the target; behind it the
base is now the nearest point. It also passed no frozen layers, so an object
on a layer frozen in the active MSPACE viewport (not drawn there) could be
aligned with; `nearest_with_direction` now takes the viewport's frozen
layers, as the osnap search does.
Review of #3424 (CodeRabbit).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With a tiny reference scale a finite typed XY distance became infinite in
block units and was stored, so the saved end point couldn't be read back as
the parameter's points. The distance and the end point must now be finite.
Dragging a polar parameter's end grip applied the distance value set but not
the angle one: the angle now snaps to its value set as typing it does, and
goes where it is dragged when the set has no limits.
Review of #3424 (CodeRabbit).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The arrays' copies were counted only after every selected object's offsets
had been cloned, so one array of 99,999 offsets over 1,000 objects held
nearly 100 million offsets before it was refused. `keep_array` now takes
each object's share of `MAX_ARRAY` before its offsets are kept.
A repeated associative hatch kept the first copy's outline handle, so
`refill_hatches` put every repeat's boundary back on the first square. Each
arrayed object's copies get their handles first, by place in the array
(in the same order as before, so the handles are unchanged), and a
repeated hatch's loop names the copy of its outline at the same place.
Review of #3424 (CodeRabbit).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review: a proxy copied from another drawing was remapped against the wrong
table; its indices are now named by its own decoded graphics (decoded again
with marker names), the file's table only as fallback. Only the 310 groups
holding the declared size are read and rewritten; names are looked up once.
Review: copying block contents into the graphics multiplied nested
dimensions exponentially, missed nested pictures and the block's draw
order. One reference to the block lets the renderer's depth and size
limits, nesting and SORTENTS apply as for any block reference. PURGE keeps
the block a kept dimension names; picking uses the drawn block.
A LARGE_RADIAL_DIMENSION or ARC_DIMENSION CADCraft keeps as read draws the
*D block its AcDbDimension part names, as AutoCAD does; without one, the
proxy graphics in its AcDbEntity part (the decoder learns POLYLINE_WITH_NORMAL,
chunk 32). Saving counts that block as used, so it is written and AutoCAD
reads the dimension again. cadcraft-cli no longer counts unknown entities
that draw graphics as not drawn.
Proxy graphics name layers by their index in the file's LAYER table.
- Layers proxy graphics draw on count as used for PURGE and layer.delete,
as in AutoCAD.
- Drawing::proxy_layers keeps the file's layer order under current names;
saving turns each ATTRIBUTE_LAYER index into the written table's, so
purging a layer before them no longer moves the graphics (AutoCAD itself
saves the old indices).
- RENAME, LAYMRG and LAYDEL update the decoded graphics and that list.
- A LAYER or LTYPE record without a handle or name keeps its place in the
index lists, so the records after it don't shift (review of #3423).
acadrust writes each AcDbAssocAction dependency entry as group 360
(owned) or 330 (not owned). The list rewrite accepted only 360 entries,
so an action with a 330 entry kept a stale count and a null entry after
a dependency was pruned. The rewrite now accepts both codes, keeps each
surviving entry's code, keeps input-null entries, and drops only
entries whose object is gone.
A dependency is no longer pruned when an action of unknown header
shape owns it or names it in any group 330 or 360, so that action's
count and list stay consistent. The prune loop runs until nothing
changes instead of at most 64 passes, and the cascade finds owners
through owner_of, so a null-owner body goes with its pruned hard owner
and stays while another live object holds it.
Tests: assoc_dependency_prune gains a mixed 330/360 list, a null-owner
body with one and with two hard owners, an unknown action header, and
an unknown action that lists a dependency of a known action by 330.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Follow-ups to #2697 from the review in #3423:
- ATTRIBUTE_FILL is an AcGiFillType trait (1 always, 2 never) in force
until the next one, for polygons and circles; a filled shape keeps its
outline. Before, a 2 turned fill on, and only for the next polygon.
- A circle or arc under a matrix that scales its plane unevenly is an
ellipse or elliptical arc; 3-point chunks are fitted in their plane.
- The size group is the first 92/160 after the AcDbProxyEntity marker.
- Only what the 310 groups hold is reserved, not the size claimed.
- ATTEDIT/EATTEDIT: take the reference from the active viewport selection,
so a layer frozen in an MSPACE viewport is respected.
- Echo the stale-rows Apply refusal to the command line as well as the dialog.
- Check pending text for read-only Properties attribute rows (constant or
multiline), so a stale value is reported and dropped.
- Add regression tests for all three.
A canvas click reaches INSERT as Input::Point while the attribute prompts wait. The Attribs arm treated any non-text input as the default and advanced, so the dialog closed and the first attribute took its default. Ignore Input::Point and keep prompting, as Verify does; Enter still keeps the default.
Set ATTDIA's session default to 1, AutoCAD 2026's initial value, and update tests that assumed 0 to set it explicitly. Add tests for a point at the plain command line and a canvas click with the dialog open.
The inherited-unit repair for group 72 now applies only to saved inch or
millimeter values (0 or 1). A layout saved in pixels (2) keeps 2 when its
units are unchanged, including after a device-only edit; an explicit unit
edit still writes its unit.
Conflict in crates/engine/src/cmd/draw/line_pline.rs PlineM::begin():
keep main's drawing elevation (#3423) and the branch's PLINEWID start
widths.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
write_plot_settings takes the layout's model flag and passes it to the baseline
call. Kept group 70 always has bit 1024 set for Model and cleared for paper
layouts. Plot groups 76 to 78 are written from AC1018 and 333 from AC1021, and
333 only when the object it names is saved.
Dimension Style Manager (lines and arrowheads, text, fit, primary and
alternate units, tolerances), Blocks palette and block libraries, icon
sizes and a few prompts. translation_gaps reports nothing missing for pl.
Terms follow the existing catalog: linia pomocnicza / wymiarowa, grot,
odnośnik, rodzaj linii, grubość linii, LUW.
When dxf_raw::finish remaps handles on kept associative objects, a
dangling dependentOnObject pointer (group 330 inside the
AcDbAssocDependency subclass) was rewritten to "0" while the dependency
remained active and stayed listed in its owning ACDBASSOCACTION 360
dependency list.
dxf_raw::finish now drops any kept AcDbAssocDependency whose non-null
dependentOnObject handle does not resolve to a written object/entity
(along with kept objects owned only by it), while leaving originally
unbound dependencies (330 = 0 in the input) untouched. In Map::object,
AcDbAssocAction filters dropped handles out of its 360 dependency list
and updates its 90 dependency count.
Tests: assoc_dependency_prune::{orphaned_assoc_dependency_is_pruned_along_with_action_entry_and_body,originally_unbound_assoc_dependency_with_null_target_is_kept}.
👾 Generated with [Letta Code](https://letta.com)
Co-Authored-By: Letta Code <[email protected]>
When dxf_read::hatch converts an edge-based HATCH boundary loop into a
HatchLoop polyline, line_edge, circular_edge, and spline_edge each skip
the incoming first vertex when it coincides with the previous end vertex
(last.p.near(point, 1e-9)). elliptic_edge did not, emitting consecutive
duplicate vertices whenever an elliptic edge met a neighbouring edge.
elliptic_edge now applies the same skip check as spline_edge (after
reversing points for !ccw).
Tests: hatch_elliptic_edge_dedup::{ccw,cw}_elliptic_edge_does_not_duplicate_shared_start_vertex.
👾 Generated with [Letta Code](https://letta.com)
Co-Authored-By: Letta Code <[email protected]>
A layout that inherits its paper units wrote back the file's group 72 after
MEASUREMENT changed, so it reopened with the old unit. Group 72 is now
rewritten when it no longer matches the unit the drawing applies.
Review of #3214: counting the layers frozen in the viewport took two
answers away that a selection through a viewport gave before.
A point on the layer Defpoints that is a part of a block (the definition
points of a dimension are held so) was hit and took room in a window
whatever the viewport froze. It counts again: ViewportBounds measures it,
and build_entities_in_viewport keeps it, also where the viewport freezes
Defpoints. A line on Defpoints follows the viewport, and what a viewport
draws on screen is built as before.
A crossing window inside the box of a dimension's text took nothing where
the viewport does not draw that text. With the text left out of the box,
a side of the rectangle the dimension is hit along ran through that
place and the window took the dimension. The rectangle now keeps the room
of the text the viewport leaves out; a window still needs only what the
viewport draws.
Session::start_from recorded the incoming origin and command number, then
cancelled the running command. Cancellation can abort a paused LISP routine
and run its *error* handler; a handler that starts a command records that
command's Program origin through its own Session::start_from. The new
command's factory then ran after that cancellation, and the INSERT and
MINSERT factories read the overwritten field, so a person's '-INSERT T …
replacing a waiting routine was taken for a program's and ATTDIA 1 opened
no dialog.
The origin and number are now recorded after the cancellation, so they
describe this start and the factory sees the origin this command was
started with; a handler's own commands keep their Program origin. The
handler's command also keeps its own number, which the dialog identity and
the Blocks palette's placing test use.
Regression tests replace (command "LINE" "0,0" pause), whose *error*
handler starts LINE, with a person's '-INSERT or '-MINSERT under ATTDIA 1:
both fail before the change (command_origin Program, no attribute entry),
in the engine and in the UI harness, and the handler's LINE is still drawn
as the program's. The UI test comment that called a fresh OK an old
confirmation now says what the test does.
A covered cell that still held text wrote it into the typed and formatted
values. The modern value block is now empty for covered cells; the legacy
groups are unchanged. The test keeps text in a covered cell.
A command a routine started was the program's only through
Session::start_programmatic, which (command …) uses for a start at Command:.
A token it feeds while a command runs takes the typed-input path instead
(Session::typed → typed_token), and that path called Session::start, which
records Origin::Person outside a script. With ATTDIA 1, the INSERT that
(command "LINE" "0,0" "'-INSERT" …) starts to replace LINE asked for the Edit
Attributes dialog, which the routine could never answer. MINSERT, COMMAND-S
and VL-CMDF reach the same path.
Session::lisp_drive now marks its slice as program input (Session::program_input,
saved and restored around the slice, a panic in it included), and Session::start
records Origin::Program for a command it starts then, as it does in a script. A
person typing the same tokens at the command line still gets the dialog.
A script's flag was the only origin INSERT consulted, and only Session::script
set it. A LISP (command "-INSERT" …) — in a LISP file, APPLOAD, or
engine.execute {"command":"lisp"} — started INSERT outside a script, so a
routine that ended before the first attribute answer left ATTDIA 1 to open a
dialog it could never answer; a routine resumed after a yield had the same gap.
Commands now record who started them for their whole life
(Session::command_origin(): a person at the command line or from a menu,
toolbar or palette, or a program), and INSERT opens the dialog only for a
person's command. Session::start_programmatic marks an AutoLISP (command …)
start, and Session::start takes a script's commands as the program's, so the
scripted INSERT still asks at the command line. A typed or menu INSERT keeps
the dialog.
One drained control batch can cancel the dialog's command and start another
INSERT of the same block before the next frame. The draft filter gave the
replacement its own defaults, but the window, its fields and OK kept the same
ids, and a click or Enter queued for the old dialog (ui.click and ui.key wait
in the app's synthetic input, one pointer event a frame) confirmed the
replacement with defaults nobody had seen.
The window and every widget in it now carry the drawing and command they
belong to, so a press on the old OK never ends on the new one and no focus or
keyboard state carries over; input queued before a dialog appeared is dropped
instead of handed to its replacement; and no answer is taken on the frame a
new owner's dialog first draws.
INSERT copied ATTDIA into the command without asking who started it. A
script that ends before the first attribute answer leaves INSERT waiting,
so a scripted -INSERT with ATTDIA 1 exposed the Edit Attributes dialog,
which a script cannot answer.
InsertM now records whether a script started it (Session::script_running)
for its whole life, and ATTDIA opens the dialog only for a command the
user started. A typed INSERT with ATTDIA 1 still asks in the dialog.
The dialog kept its draft by block name and row count alone. A cancel
through the control channel runs before the dialog frame, so a second
INSERT of the same block could reach its attribute prompts in the same
drained batch and then inherit the cancelled draft; OK, or a queued
confirmation, submitted those values to the new command. A redefined block
with the same name and row count got values meant for other tags.
Session::attribute_entry now stamps each entry with the active drawing's
uid and the command's number in Session::commands_started, and the dialog
shows its draft only while both still match. A replacement command starts
from its own defaults, so a confirmation left over from the old dialog can
only submit what the new one shows.
The pending snapshot and the dialog's stale-row check compared the fields a
row shows: tag, prompt, value, insertion point and flags. Two attributes can
match all of those and still be different attributes. With two editable `T=v`
definitions at the same insertion point, texts 1 and 2 high, typing into the
first Properties field and then running `battman {"name":"Twin","action":
"down","tag":"T"}` leaves every compared field equal while the reorder puts
the height-2 attribute in that place; Enter wrote the typed text there, and
the dialog applied its stale row the same way, both without a message.
The row now keeps the whole stored attribute: `AttributeRow::record`, the
engine's own `Attrib` (its text, its own layer, colour, linetype and
lineweight overrides, its modes and its multiline text). A pending edit and a
dialog row are bound to that record, so any stored property that differs
refuses the stale text and says so. The displayed fields stay for the list.
Equality is the drawing data's: two attributes identical in every stored
property are interchangeable, so a swap between them still applies. Text
holding a NaN never equals itself, so such a row refuses a pending edit; it
does not panic.
Tests: both paths write the height-2 attribute without the record comparison
and change nothing with it, checked by height.
The pending snapshot kept a tag and a value, and two attributes can share
both: with definitions `T=v` at [0,1] and [0,2], typing into the first row and
then running `battman {"name":"Twin","action":"down","tag":"T"}` left the
snapshot matching, because the swapped attributes still reported `T` and `v`,
so Enter wrote the typed text into the other one. The Edit Attributes dialog's
stale-row check compared the same two fields and had the same weakness.
The snapshot now keeps the whole row, whose insertion point is the new
`AttributeRow::at`, and the dialog compares every property it shows, so both
paths refuse a reorder that only moves attributes.
A frame that finds another attribute in the field's place also takes no input:
text and Enter queued for that frame were meant for the attribute the field
had, so they neither commit nor become a pending buffer for the one there now.
The field draws the drawing's value, inert for that frame, and editing resumes
on the next.
Tests: equal tag and value attributes swapped under pending text write the
wrong attribute without the stronger comparison, in the Properties palette and
in the dialog; input queued for the frame that finds the row stale reached the
new row without the inert frame.
A Properties attribute field is a place in the reference: `attedit` takes `at`
by index. The pending text was kept by drawing, reference and index alone, so a
reorder (`battman` order), a value edited from another path, or an undo that
put another attribute in that place handed the typed text to whichever
attribute was there. With attributes `[NO=7, NOTE=n]`: type into NOTE, run
`battman {"name":"Tag","action":"order","order":["NOTE","NO"]}` while it waits,
press Enter, and NO became `EG` while NOTE stayed `n`.
The pending text now carries the tag and value it was typed into. When the
place holds another attribute, the text is dropped, no `attedit` is sent, and
the command line says the value was not applied, as the dialog refuses a stale
row. An ordinary edit is unchanged, still one undo step.
Tests: a reorder, an edit from elsewhere and an undo under pending text each
write the wrong attribute without the snapshot check and change nothing with
it.
Main gained ATTREQ, Preset and Verify prompts (#2535) while this branch was
open, so what is new here is ATTDIA and the Edit Attributes dialog: the
setting and its SETVAR registration, Session::attribute_entry and its guard
hook, the dialog, and the tests. Main's prompt flow is kept as it is: every
attribute value at the command line (or in the dialog), then the Verify
attributes asked again.
INSERT counts its attribute answers per definition (`asked`) instead of by
tag, as main still does: a block with two definitions of one tag stopped
asking until the map grew, which it never did. The duplicate-tag test fails
without it.
docs/gaps.md and docs/ui-parity.md keep main's rows; the affected rows are
named in the pull request instead.
The editor tests cover opening the dialog, drawing switches, repeated tags and
stale rows, but not a value typed into the Properties field reaching the
drawing and coming back with one Undo. This adds that case: type into NOTE,
press Enter, see the new value, undo, see the old one.
Test shape follows PR #2912's Properties edit and Undo test.
The Attributes group labelled its rows with prop_row, which looks the label up
in the interface catalogs: a tag such as `To` read as `A` in Spanish, and a tag
matching any other interface string changed the same way. A data_row helper
takes the label as it is, for drawing text, and keeps prop_row translated.
Test: attribute_tags_in_properties_are_not_translated fails without the helper.
The helper and the test shape follow PR #2912, which fixes the same label in
its Attributes group; this change does not bring that PR's xdata group.
While a fence (Fence, or Quick mode's two-point fence) or a crossing window is drawn, every
piece it will remove (EXTEND: every stretch it will add) is highlighted with the same band as a
single pick.
- trimextend.rs: fence() and crossing() are split into fence_work()/crossing_work(), which find
what they cut, and run_picks(). picks_preview() works the same run out without changing the
drawing: each object at its picks in turn, against edges that include what the run has already
made of other objects (Overlay), so the preview follows a fence whose trims change each
other's edges.
- modify/trim.rs: trim_kind() and extend_kind() trim or extend a shape; edge_segments_over()
gathers edges with an Overlay in place of the objects it names.
- Interactive::highlight_all / Session::highlight_all; the canvas draws it in place of the
object under the cursor.
Tests: a fence highlighting both lines it crosses, the drawing untouched; a fence through a grid
and a circle removing exactly the highlighted length; Quick mode's two-point fence and a crossing
window; an EXTEND fence adding exactly what it highlighted.
The coverage test in uncovered() now works out each segment's box and piece ends once and
passes over a segment whose box is farther than the tolerance from the point before measuring
its distance. Same result, less work on long polylines and finely flattened curves.
At TRIM's "Select object to trim" prompt the rollover highlight showed the whole object under
the cursor. It now shows only the piece a click there removes, and the whole object only when
Quick mode would erase it; EXTEND shows the stretch a click adds.
- modify/trim.rs: `trimmed` and `extended` work a trim or an extend out without changing the
drawing; `trim` and `extend` apply them. The preview and the click share that code, so they
can't disagree.
- prompt.rs, guard.rs, session: `Interactive::highlight` (under the panic guard) and
`Session::highlight`: what the rollover highlight shows of the object under the cursor.
- trimextend.rs: TRIM/EXTEND's highlight is the object less the pieces a trim keeps (or the
object as extended less the object), split where a piece ends, so it works the same for lines,
arcs, circles, polylines, ellipses and splines. The edges of the object under the cursor are
gathered once while the drawing and the edges stay the same.
- canvas: the highlighted part replaces the whole-object highlight, worked out again only when the
object, the cursor, the zoom, the drawing or the prompt changes.
Tests: engine/tests/it/trim_highlight.rs (the piece between and past two edges, Quick-mode
erase, the drawing and undo untouched, the highlight matching what a click removes for seven
kinds of object, EXTEND, other prompts and locked layers, edges gathered again after a trim) and
a canvas test (the part is computed once while the cursor rests).
Follows the approach of #1126.
Co-authored-by: Marco Arnulfo <[email protected]>
- Fill tolerance follows the drawing unit, so arcs are sampled and fills
split into triangles to the same accuracy in metres as in millimetres.
- Nonzero fills test containment from a point on each contour's edge, so
an inner contour close to its parent's edge keeps the fill.
- A fill of two arc vertices (a disc) is kept.
- The same text drawn again after a shape or image is kept.
- A clip path that doubles back along an edge is not taken as a rectangle.
- PDF options that are not a JSON object are refused.
- The options window imports into the drawing it was opened for.
- The self-calling form test checks the outcome against a finite form.
PDFIMPORT (File > Import PDF...) adds a chosen page to the current drawing,
with page, scale, insertion point, password and content options. OPEN and
IMPORT take a PDF too; OPEN reads its first page into a new metric drawing,
and cadcraft-cli convert writes it to DXF or DWG.
The mapping is adapted from PR #2787 (MIT OR Apache-2.0) onto craft-pdf's
interpreter. Nonzero fills whose contours don't cross keep their loops and
arcs; crossing contours are split into triangles so the filled area matches.
Content the import leaves out or approximates is named in the read notes,
and a page with no vector content is refused instead of opening empty.
A cancelled request's answer could complete a newer held paste, whose
own answer was then dropped. Each RequestPaste now has an identity kept
with the held command, and a Paste completes the command only when it
answers that request; otherwise it is a stale answer that pastes
nothing (its text still becomes the clipboard, being the system
clipboard's) and the command keeps waiting for its own answer or
deadline.
Where the window answers in the next frame or not at all (X11, Windows,
macOS), a request is answerable for that one frame, counted in frames,
so a paste with no answer falls back at once and a later Ctrl+V is never
taken for it. Only native Wayland, which reads asynchronously with a 3 s
budget, keeps the time bound, now 5 s. The app tells the interface which
case applies from the display handle.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A typed UI command such as quickcalc left a held paste waiting, and the
one-second window for ignoring a late Paste could be consumed by a real
Ctrl+V or missed by a slow answer, so one request could paste twice.
Typed commands now drop a held paste before the UI-command branch. Each
RequestPaste is remembered for 3.5 s, the delivery budget egui-winit
gives its asynchronous Wayland read (elsewhere the answer arrives in the
next frame's input, and nothing arrives when the clipboard has no text).
A Paste is the answer to the oldest request still remembered, so one
whose command was escaped or gave up pastes nothing, while a Paste with
no request outstanding is an ordinary Ctrl+V. This replaces the time
window that swallowed a Paste.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A paste waiting for the system clipboard kept running after Escape, and
a wait that ran out in the same frame as the Paste event, or a Paste that
answered a request already given up on, started a second paste.
Escape (command line and cmdline.key) and starting any other command now
drop a held paste. A Paste event in the frame the wait expires completes
the held command instead of the timeout running it first. After a
timeout or a cancel of a request already sent to the window, one Paste
within one second is treated as that request's late answer and ignored;
a real Ctrl+V inside that second is swallowed once, and pressing it
again pastes.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
After the typed-order change of issue #2899, the sara aa glyph shows ำ in น้ำ and า in นา.
The PDF writer gives a glyph one ToUnicode entry, taken from its first use; krilla wraps a
later use with other text in its own /ActualText span. The test plots นา and น้ำ in one
drawing, in both orders, and reads the page glyph by glyph (ActualText where there is one,
else ToUnicode), which must give the typed words.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The typed-order assignment of a cluster's characters to its glyphs could put a character
second on a glyph where the previous assignment gave every character a glyph of its own.
With น typed before the tone mark and then sara u, the shaper draws sara u before the
tone mark (FreeSerif shapes นุ้ as no, sara u, mai tho): the typed pass matched sara u to its
glyph, so the tone mark went with no and its own glyph showed nothing. Render and the PDF
writer keep a glyph's first character only, so the tone mark dropped out of the PDF text,
where the previous assignment kept all three, out of order.
glyph_chars now takes the typed assignment only when it leaves at least as many glyphs
showing a character as the plain one, and the plain one otherwise. น้ำ, ฐ with sara u as
one glyph and the Devanagari vowel sign before its consonant come out as before; the unit
test gains the unusual order.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A TEXT or MTEXT with น้ำ plotted to PDF in a font such as FreeSerif or Garuda read
นำ้ in its text layer (the first part of issue #2899). The shaper splits sara am into
nikhahit and sara aa and draws the nikhahit before the tone mark. glyph_chars in
crates/fonts/src/complex.rs then gave sara am to the first glyph without a character of
its own, the nikhahit, so in drawing order, which is the order the PDF writes the glyphs
in, sara am came before the tone mark. Fonts that substitute the tone mark (Noto Sans
Thai raises it over the nikhahit) only read right because no glyph matched its own
character.
Within a cluster, own glyphs are now matched only in typed order, the other glyphs take
the remaining characters between them, and a character with no glyph of its own there
goes with the glyph before it, as a ligature's characters already go with the
ligature. In น้ำ the sara aa shows ำ after the tone mark and the nikhahit is drawn as an
outline; ฐ with sara u as one glyph still shows both. Where typed order would need a
character on a glyph before every glyph that shows one (a vowel sign drawn before its
consonant, as in Devanagari), the assignment stays as before: render and the PDF writer
take the first character of a glyph only, so moving a character onto another glyph
would drop it from the text. What is drawn does not change.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only Ctrl+V reached load_system_text, so a copy made in another CADCraft
window could not be pasted from the Edit menu, the context menu or by
typing PASTECLIP, PASTEBLOCK or PASTEORIG (issue #3320).
A paste started from a menu or typed on the command line is now held for
a frame while the window is asked for the system clipboard
(ViewportCommand::RequestPaste). The resulting Paste event goes through
the same path as Ctrl+V, so the newest of this window's clipboard and
the system's wins, and then the held command runs. If no text arrives
within half a second (the clipboard holds an image or nothing), or a text
field has the keyboard, the command runs at once with what this window
holds. The web build gets a Paste only from the browser's own gesture, so
it keeps its behaviour.
The paste items are offered while a drawing is open and nothing was
copied in this window, instead of being disabled; they report an empty
clipboard when it turns out to be empty. The engine is unchanged.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Discovery checked each reference's own transform, while opening it checks the
transform with everything above it: two small uniform scales together could be
offered and then refused.
Loading an xref drops its dimensions' associations, so writing it back leaves
them out of the file. When the part written back had associative dimensions,
the save says so and lists "dimension associations" in notSaved, pointing at
the backup that keeps them. A dimension drawn during the edit attaches to the
host's copies, whose handles mean nothing in the xref's file: it is written
without those associations, and counted too.
A host dimension style copied into the xref's drawing brings the blocks its
arrowheads are drawn with. A block the written objects still name that the
drawing lacks, such as another xref of the host added with REFSET, refuses the
save: the file, its backup and the edit stay as they were.
The merge replaced the PR's own loss report with main's lost_writing and
lost_message (the conflict was in cmd/file.rs). This covers a case the PR's copy
missed: a proxy an R2000 DXF xref can't keep is named, with the reason and the
backup that still has it.
refedit and refclose touch files, so they move to the FILES list. REFEDIT checks
that the xref's file may be read and written before an edit begins; REFCLOSE Save
checks the file it writes and its .bak before anything is read or written, so
roots put in force since the edit began hold too. A refused save leaves the xref,
its backup and the host as they were, and the edit stays open.
- tests/it/main.rs: keep extend_polyline_end_choice next to extrim.
- file_access/commands.rs: extrim touches no file.
- Two tests follow TRIM keeping the object's handle on its first piece.
ARRAYEDIT's columns, rows and items, measured in AutoCAD 2024's core
console, refuse 5.0, 5., 4.5, 1e1 and 8/2 and take +5, 05 and 5, as the
other count prompts do. A count runs from 1 to the MAXARRAY limit.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflict in crates/engine/tests/it/main.rs: keep both array_counts and
main's array_key_point (#2368).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflict in crates/io/src/dxf_read/entities.rs: keep the branch's
keeps_closing_tangent() and main's hatch curve budget parameter (#3306).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflict in crates/render/src/wide.rs dashed(): keep main's point budget
for segments() (#3306) and the branch's closed PLINEGEN anchor.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
From the second automated review of #2355:
- The "loaded" stamp was one per file for the whole process, taken from
the path after the bytes were read. Each xref block now keeps its own
baseline (Block::xref_stamp, session state), taken from the opened
file before and after the read (None when it changed meanwhile), and
another drawing loading the file no longer moves it. REFEDIT uses the
stamp of the one read its handles and version come from, and refuses
unless that is the drawing's baseline; an unknown stamp counts as
changed. The process-wide LOADED cache is gone.
- REFCLOSE Save checks the stamp before reading, of the read itself,
and once more just before the file is replaced (narrowing, not
closing, the window for another program's save).
- It refuses while the xref's file is open in another drawing tab (it
was checked only when the edit began).
- It refuses a file the xref could no longer load (more than
MAX_XREF_OBJECTS, counted as import counts: load::object_count).
- bring_symbols counts distinct symbols only, and refuses the save past
the budget instead of writing with symbols missing; it copies host
multileader styles (with their text style) and table styles (with
their cell styles' text styles) too.
- refedit.levels no longer offers a nested reference REFEDIT would
refuse (scaled differently in X and Y, flat), nor what is below it.
- Faded copies keep the object's own transparency; the renderer fades
them by the current XFADECTL, so changing it during the edit shows.
Each test's folder is now an owned guard removed on drop, so a skipped
symlink test or a failed assertion no longer leaves its files behind.
The save test drew its new line after a `layer` call that does nothing
in JSON (`.ok()` hid it), so the line stayed on layer 0 and the check
that host layers come along could not fail. It makes "Added" current
first (layer.new) and asserts the line and the file's layer table.
Review of #2355 (CodeRabbit, tests/it/refedit_xref.rs:30 and :117).
entity_parts asked RefEdit::is_working, a scan of the working set, for
every object drawn, and read XFADECTL from the header each time: 50,000
working objects meant about a billion handle comparisons per rebuild.
The working set is now a hash set built with XFADECTL once per display
list (render::Fade) and shared by the serial, parallel and viewport
builders.
Review of #2355 (CodeRabbit, render/src/draw.rs:50).
SAVE and SAVEAS list what the writer drops; the write-back wrote the
source drawing straight through and said nothing, so a DWG xref holding
types the DWG writer can't keep (or a 2013+ DXF one holding solids with
SAT-text geometry) lost them silently.
REFCLOSE now counts them as SAVE does, for the version the file is
written in (file::loss_writing: not_saved_as for DWG, sat_text_dropped
for 2013+ DXF), echoes the same warning prefixed with the file and
naming the backup that still has them, and lists them in the result's
notSaved. Nothing lost, no warning.
Review of #2355, point 3.
The write-back used IoHooks::write, which picks the version from the
drawing: an R2000 DWG xref came back as a 2004 DWG (a DWG is written at
2004 or later by default) and an R12 DXF one as R2000. An xref is often
someone else's file, and a version change can lock its author out.
REFEDIT now records the file's version (a DWG's from its first bytes, a
DXF's $ACADVER) and whether it is a binary DXF, and REFCLOSE writes it
back through the write_as hook at that version and form. A version
CADCraft doesn't write (R12) is refused before the edit begins, so no
work is lost; so is a build without the write_as hook. REFEDIT's result
names the version.
Review of #2355, point 2.
The write-back made its own temporary file (`<file>.cadcraft-tmp`, opened
with a plain truncating write) and copied the backup with fs::copy, so a
symbolic link planted at either path took the write: the drawing went
into the link's target and the xref's path became that link (CWE-59).
It now goes through what SAVE uses: the backup is file::backup (written
atomically, a link at the .bak replaced, never written through) and the
new file atomic_write::write_atomic_with (an exclusively created
temporary file renamed over the file). The file written is the one the
xref's path led to when the edit began; REFCLOSE refuses when the path
leads elsewhere by then (a link put there during the edit).
The backup is named by file::backup_path, as SAVE names it: site.dwg's
is site.bak, site.dxf's site.dxf.bak, so two xrefs of one name in one
folder no longer share (and overwrite) one site.bak.
Review of #2355, points 1 and 4.
Conflicts: the doc re-export (Raster next to XrefSource), the system
variable table (XCLIPFRAME next to XFADECTL), the canvas paint calls
(painter is a reference now), the Italian and Ukrainian labels (both
sides kept), and docs/gaps.md and docs/target-app-parity.md, taken from
main: pull requests don't edit those docs any more (AGENTS.md), so the
rows this change affects are named in the PR instead.
crates/fonts/src/complex.rs takes main's pedantic-lint style (#2568) with
this branch's glyph_chars that gives a ligature glyph every character of
its cluster.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The grid that finds which boundary point a hatch vertex sits on kept at
most 16 points per cell. When the point the vertex sat on was one of
those dropped, the vertex matched a kept point of another object, and
the loop followed a line the stretch had left behind.
Every point is kept now. A vertex with more than 16 points in its cell
and the eight around it matches none, and its loop keeps what it has:
it can't tell which object it sits on, and the cap still bounds the
work per vertex.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
An arc with one end inside a stretch frame moved whole. AutoCAD 2024
moves that end and keeps the arc's height over its chord: in its own
stretched copies of library blocks, 84 arcs whose ends moved apart kept
their height to 1.1e-14 of it.
An associative hatch whose loop is made of several lines didn't follow
them: only a loop of one closed polyline was filled again. A straight
loop whose every vertex is a line's end or a flat polyline's vertex of
its boundary objects (within a billionth of the largest coordinate) now
takes those points' new places. The points looked through are bounded.
A tilted arc, and an arc when the frame can't be tested, still move
whole.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A stretch action moved a selected WIPEOUT whole even when only part of
its outline was inside the frame. AutoCAD 2024 moves only the outline's
points inside the frame, as it does for lines and polylines: in its own
stretched copies of a library block, 324 of a 521-point wipeout's points
moved by the distance's change and the other 197 stayed.
The points that move are tested where the dynamic block has them; the
repeated closing point moves with the first. A frame that can't be
tested point by point still moves the wipeout whole, as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
crates/dwg is gone from main; this PR's bridge part (multileader contexts) is
ported to storytold/craft-libs#2005, and its DWG round-trip test is ignored
until the pinned craft-dwg has it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
crates/dwg is gone from main; this PR's bridge part (text and dimension
contexts) is ported to storytold/craft-libs#2005, and its DWG round-trip test
is ignored until the pinned craft-dwg has it (now through craft_dwg).
io/lib.rs keeps main's dxf_clip and this PR's dxf_anno.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- crates/dwg is gone from main (the bridge is craft-dwg in storytold/craft-libs
now); this PR's bridge part is ported there as storytold/craft-libs#2005.
Its DWG round-trip test is ignored until the pinned craft-dwg has it.
- dxf_raw.rs finish(): main's hard-owner liveness (`own`, `owner_of`,
`settle`) walks the kept objects and the refreshed contexts' added records;
the contexts get their owner chains from `own`.
- retained_objects: main's pass structure, with this PR's modelled_xdict_key.
- foreign.rs: main's `version` and this PR's `placements` both stay.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A dimension is hit anywhere inside the box of its text. That box was read
from the dimension's block without the viewport, so through an MSPACE
viewport a pick in the box of text on a layer frozen in that viewport
still took the dimension, although the viewport does not draw the text.
AutoCAD 2022 picks nothing there.
- doc: ViewportBounds::leaves_out tells whether a viewport leaves a part
of a block out for its layer, by the comparison its boxes already use.
- engine: the text test of a pick and of selection cycling's list skips
the text the viewport leaves out.
Not changed: the rectangle around a dimension is still hit along its
sides (#2991). With the text not drawn its top side runs through the box
of the text, so a pick within pick distance of that side and a crossing
window over it still take the dimension, where AutoCAD takes nothing.
Nothing changes where no layer is frozen in the active viewport: text on
a layer frozen for the whole drawing or turned off is tested as before.
Through an MSPACE viewport a block reference on a layer the viewport draws
was hit on a part whose layer is frozen in that viewport, and that part
took room in the box a window tests. The viewport does not draw the part.
- doc: ViewportBounds measures an entity as one layout viewport draws it,
without the block contents on the viewport's frozen layers.
- render: build_entities_in_viewport builds loose entities as a viewport
that freezes the given layers draws them.
- engine: a pick, selection cycling's list, a window, a crossing window, a
fence and the polygons test a reference against that box and that
geometry. The spatial index is unchanged: the viewport's box is never
larger than the indexed one.
- ui: the highlight of a reference inside the active viewport is built
the same way.
A clipped reference (XCLIP) stays selected by its boundary whatever the
viewport draws inside it, as AutoCAD 2022 selects it: it keeps the box
the drawing gives it.
Nothing changes where no layer is frozen in the active viewport.
Radhika and Mohan Raj reviewed CADCraft's Tamil interface in the running
app on 2026-11-14. ATTRIBUTION.md and docs/localization.md say so instead
of listing the newer rows as unreviewed.
This PR and #2915 each add a prompt to NO_OR and raise its array length
from 28 to 29, so with both merged the array holds 30 entries under a
length of 29 (E0308), whichever lands first. A slice has no length to
keep in step; both PRs make the same change to this line.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#2548 rewrites BREAK and deletes with_z; with both PRs in, this branch's
call to it no longer compiled (E0425), whichever landed first. Set the
elevation on the polyline lwpoly() makes instead: the same value, and
nothing of this branch depends on with_z any more.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings chord_interpolate's start-condition row ahead of the fit-point
rows, so its system stays banded. chord_closed builds closed chord fits
through it: control points are bit-identical, and a closed fit of 1,000
points took 17.4 -> 3.2 ms (dev profile).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
chord_interpolate added the start tangent or zero-curvature row after
all the fit-point rows, so its column-0 entry sat in row n and solve
swept the whole width. With the start row first, the system has a lower
and upper bandwidth of at most two. The control points come out
bit-identical; a fit took 17.5 -> 4.4 ms at 1,000 points and
414 -> 135 ms at 4,000 (natural ends, dev profile).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
chord_interpolate added the start tangent or zero-curvature row after
all the fit-point rows, so its column-0 entry sat in row n and solve
swept the whole width. With the start row first, the system has a lower
and upper bandwidth of at most two. The control points come out
bit-identical; a fit took 17.5 -> 4.4 ms at 1,000 points and
414 -> 135 ms at 4,000 (natural ends, dev profile).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's banded solve came with a dense-solver oracle test whose cases all
use chord-length knots; on this branch those go through
chord_interpolate, so the test no longer reached interpolate. Extend it
with square-root and uniform knots, with and without end tangents, and
a 1000-point square-root fit (the same change as on
fix/spline-file-tangent-length).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in main f9c0c96e. Main's clippy-pedantic refactor of
spline_fit.rs conflicted in three places: fit_sanitized takes main's
if-let form and keeps closed_fit's tangent argument, closed_fit keeps
main's #[expect] on its four-parameter signature, and the closed
tolerance test keeps main's bit-exact assert with this branch's comment.
Closed chord-length fits go through chord_closed on this branch, so the
dense-solver oracle's comments say so, and an n=150 closed square-root
fit keeps the large cyclic matrix compared.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With chord-length knots, open fit-point splines are now built by
chord_interpolate, so fits_are_bit_identical_to_the_dense_solver no
longer reached interpolate (a panic there left the test passing). Add
square-root and uniform knots, with and without end tangents, and a
1000-point square-root fit, so interpolate's matrices, its tangent rows
and the closed cyclic interpolation stay compared with the dense solver.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's clippy-pedantic refactor of spline_fit.rs restyled the body of
Spline::fit_with; this branch had moved that body into fit_sanitized.
Keep the split and apply main's if-let form inside fit_sanitized.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main gained the Polish catalog, Greek rows, and Additional Tools in place
of Express Tools.
- crates/fonts/build.rs, crates/fonts/src/craft_fonts.rs: keep main's
backticked names and the Tamil `Taml` web face.
- crates/ui-egui/src/i18n.rs: LANGUAGES holds 21 and Preference::ALL 22,
with both Polish and Tamil.
- ta.tsv: Express Tools becomes Additional Tools (கூடுதல் கருவிகள்), the
label every European catalog now translates.
A HATCH with extrusion (0,0,-1) had its boundary and hatch angle mirrored
into the world, but the pattern definition lines read from the file kept
their OCS direction, base point and offset. Lines at an angle other than the
hatch's were drawn on the wrong slant (ANSI31 at 45 instead of 135) and
multi-line patterns lost their alignment. Mirror each line the same way.
placement read `scale` only when `width` was omitted, so a call with
both a valid `width` and `"scale": "big"` attached the image. `scale`
is now checked first; a valid `width` still takes precedence.
A value of the wrong type for `at`, `scale`, `rotation` or `name` was
taken as omitted, so `"scale": "big"` attached an image one drawing unit
wide and `"at": "nowhere"` put it at 0,0. Each is now refused with an
error. An omitted or null value still takes its default.
When a drawing opened, each image loader checked the decoded total against
the 2 GB limit before decoding and added the image's size only after, so up
to four images of up to 512 MB each could decode at once past the limit.
A loader now starts a file only while the images decoded so far, plus the
largest image each file being decoded can become, fit under the limit, and
otherwise waits for a file to finish. With no other file being decoded one
file always starts, so the total runs past the limit by one image at most,
as it does with a single loader. A file that fails to decode counts nothing.
ta.tsv has 1,507 rows: 1,505 labels and the two count templates (one|other).
It covers every key of the existing catalogs the code still uses and the five
marked strings no catalog has yet, so `cargo xtask i18n` reports nothing
missing for ta. 1,289 rows come from the Tamil CADCraft and shared catalogs
in storytold/craft-i18n, reviewed there by native speakers; the other 218 are
AI-assisted and not yet native-reviewed.
egui's bundled faces have no Tamil letters, so Tamil follows the Arabic path:
an installed Tamil font whose first face has every letter the catalog uses
(theme::tamil_font), or a craft-fonts Taml face, loaded in the Tamil
interface only; the web build keeps Taml faces. Without either the choice is
kept, the interface stays English and the language command says why, and the
picker reads "Tamil" wherever Tamil can't be drawn.
The Properties header's All | My control sized each half 35 px, so a Tamil
"All" ran into "My"; each half now fits its label, and English is unchanged.
Options ▸ User Preferences gets "Check for updates when CADCraft starts"
(on by default, desktop only). Off, the startup check and its "Update and
Restart" prompt never run; Help ▸ Check for Updates… still checks. The
choice is the OPTIONS JSON key `checkUpdatesAtStart`, kept in the profile and
restored by Reset to Defaults, for people who manage updates themselves (an
offline machine, a package manager, a pinned version).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`tilted` took its points eagerly, so every bulged edge of every LWPOLYLINE and HATCH loop was
tessellated on read, also with extrusion +Z or -Z, where no point can move and the answer is
always "not tilted". It now takes the points as a closure and returns before gathering them
when the normal's x and y are exactly 0. For such a normal `Mat4::ocs` is the identity or
(-x, y, -z), so the result is the same as before.
Brings the branch up to main ca87680f. The one conflict is in
crates/render/src/linetype_text.rs, texts(): main's #2744 adds a point
allowance for the labels of a run, and this branch starts the run a period
before its start. Both are kept: the allowance is charged for each label
placed, and elements before the run's start are skipped before any charge.
Main's new test placed_labels_stop_at_the_point_allowance now passes the
Layout argument this branch added to texts().
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A font may draw a consonant and its below vowel as one ligature glyph:
GNU FreeSerif's Thai liga lookup replaces tho than + sara u with a
single tailless form. glyph_chars gave each glyph of a cluster at most
one character, so the characters left over in the cluster were
dropped and sara u was missing from the shaped text records.
glyph_chars now returns the characters each glyph shows, and the
cluster's last glyph takes any that are left over. push_glyph records
one text glyph per character against the same outline.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A top-level MTEXT with a non-zero AcadAnnoPO value is drawn upright, so its pick frame no longer turns with the stored rotation. Insertion points now keep a blank frame in the snap pool only when INS is enabled and the point is within the aperture circle, not just the square probe.
The reader drops one closing fit point from a closed spline, so the writer
now adds one whenever the reader will drop one: also after a list that
already ends with its first point (a kink where it closes, as a file can
give it). Before, [A, B, C, A, A] came back as [A, B, C, A], and a later
fit-point edit smoothed the seam. Three points ending with the first are
still written as they are, since the reader keeps them so.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings the branch up to main 6d744887, which has #2954's fix for
mtext::tests::strips_formatting, so the gate runs on a main that passes.
No conflicts.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings the branch up to main 6d744887, which has #2954's fix for
mtext::tests::strips_formatting. The one conflict is in
crates/geom/src/nurbs.rs, where main makes the derivative allocation-free
(#2434, basis_pair_into) and this branch adds reversed_loop. The merged
file is main's plus exactly this branch's own lines.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Blank MTEXT frames use cadcraft_doc::anno_scaled, is_blank_mtext no longer allocates, and
the crossing test accepts the frame. Out-of-reach blank frames no longer use up snap
candidate or intersection slots. Adds tests for each.
EXPERT 2 or more answers the "already exists. Redefine it?" question
Yes without asking, so a routine that inserts the same file repeatedly
finishes each INSERT. EXPERT below 2 still asks.
strips_formatting expected `\U+12` to strip to nothing. plain_mtext
dropped every unknown code up to the next `;` when that assertion was
written. #1036 limits this to the codes in takes_arg, and `\U` is not
one of them, so plain_mtext returns `+12`. The layout and paragraph
paths give the same text, and
unicode_escapes_are_decoded_in_every_parser already expects it.
The test has failed on main since both changes merged, and the failure
stops the gate at its test step. The test module now also checks the
short escape in both layout paths.
(cherry picked from commit 6f0f1fefa8)
Co-authored-by: .CooCoo <[email protected]>
AutoCAD 2024 joins only objects that lie in one plane with the polyline:
the plane the polyline and every line picked share, if they share one,
else the polyline's own. Measured: a triangle at Z 5 whose last side slopes
to Z 0 leaves that side out; a sloped line followed by a line turning off
their vertical plane joins neither; a sloped line followed by an arc joins
the line only. Before, a sloped line joined wherever its end met the chain
at the same height.
Also, after review: tests for the sloped line drawn either way, a chain
meeting its start at another height, arcs below Z 0 and mirrored above it,
thickness, the joined polyline's normal and bulges, fuzz in plan only, and
an exact pick on the arc; doc comments for the plane rule, the height
tolerance and tilted arcs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Share the blank MTEXT frame with multileader picking and extend the
candidate bounds used by both scans and the spatial index.
Cover empty and whitespace boxes and preserve normal text picking.
A click on a blank MTEXT is tested in its box turned with the text, not the
axis-aligned box around it (the spatial index and windows keep the larger box).
One helper holds the frame geometry for both.
PEDIT turned a line or an arc into a polyline at elevation 0, so a line at
Z 5 dropped to Z 0, and its Join took any object meeting the polyline in
plan. As AutoCAD 2024 does (measured):
- Convert puts the polyline at the line's height or the arc's centre
height and keeps the thickness; a line's polyline faces up whatever the
line's normal, a mirrored arc's keeps its normal and runs as the arc
does in its own coordinates.
- PEDIT's Join takes an object only where the ends meet at the same
height, and none facing the other way (an arc or polyline whose normal
points down Z where the polyline's points up, or the other way round;
a line counts as facing up). After a sloped line, the chain continues
from its far end's height.
- Multiple's Join leaves out objects facing the other way too, but takes
them at any height.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A blank or whitespace-only MTEXT has no glyph strokes and empty drawn bounds, so
a click inside it, and the spatial index, missed it. It is now picked (and
window/crossing selected) in its width x text-height box, placed by its
attachment point and rotation.
- An object is closed when it is (a closed polyline, circle, full ellipse,
closed spline), not when its ends happen to meet; a crossing at an open
outline's end doesn't count (as in trim), and one at a closed outline's seam
counts once. Preview and trim now agree on touching and ends-meeting cases.
- Each object's crossings with the edge and the trace are found once and
bracketed by binary search; at most 10,000 stretches per call.
- trim's edge_segments looks up the given edges by handle instead of scanning
the space for them.
- An arc's or elliptical arc's side is inside or outside its full circle or
ellipse, as OFFSET has it; the trace limit counts joined points.
- TRACE_GAP, a Side enum, and tests for arcs, ellipses, splines, bulged
polylines, two stretches, touching, ends meeting, the seam and the limits.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A closed object the edge crosses only once can't be trimmed open: it's left
out of the preview and counted in `skipped.uncut`, as is any planned cut the
trim refuses, with a line in the message.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pick a line, arc, circle, ellipse, polyline or spline, then the side. The edge
is traced a hair's breadth toward that side; every object the trace crosses
loses the stretch between its edge crossings there, trimmed at the stretch's
middle with the edge as the only cutting edge. Objects that don't cross, the
edge itself, blocks, hatches, text and locked layers stay (and are counted).
One undo step, a red preview band that follows the cursor, a JSON form, and
no zero-length pieces left behind.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
JOIN made the new polyline from a line or arc source at elevation 0, so
lines at Z 5 moved down to Z 0. It now takes the source's height, as a
polyline source keeps its elevation with a sloped line joined to it
(AutoCAD 2024, measured), negated when the polyline inherits a normal
pointing down Z. The new polyline itself wasn't measured: the core
console's JOIN never makes one.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A null rows or columns is 1 and a null rowSpacing or columnSpacing is 0,
as when the key is missing. Each count is tested null on its own; the
distances on a 2 x 2 grid, since one row or column drops its distance
anyway.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
JOIN compared chain ends in plan only, so an end meeting another only in
plan at another height was joined and collapsed onto the source's
elevation. Each piece now carries its ends' world heights (a line's own
Z, an arc's centre Z, a polyline's elevation, negated when its normal
points down Z), turned round with the piece, and ends must meet at the
same height too.
Onto a polyline source, an object facing the other way stays out: an arc
or a polyline faces its normal, a line always counts as facing up.
AutoCAD 2024 (accoreconsole, measured) joins a line with normal 0,0,-1
to a polyline facing up, no line to a polyline facing down, and an arc
or polyline only when it faces the polyline's way. A line or arc source
keeps the old behaviour: the core console can't measure it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The format-parity table marks R13 and R14 DWG reading as untested and
2018 as tested only on synthetic files; say the same in the README.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Say so wherever the docs describe a drawing keeping its own version,
as file-format-parity.md already does: save_as writes an explicit
version into $ACADVER, so later saves use it too.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The JSON form read rows and columns as numbers with no fraction, so 2.0 and
1e2 were counts. They must now be JSON whole numbers from 1 to 32767, as the
array commands' JSON counts already are; missing or null is still 1.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
main and this branch each added a row to NO_OR in prompt.rs ("Enter
option" and "Enter a copy mode option") on top of the same 27, and both
declared 28; the merge has 29 rows, so the declared length is now 29.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
These prompts ignored a point. AutoCAD 2024 (measured on INSERT and
MINSERT) takes one as the first of two at the Scale, X, Y, Z and Rotate
presets and at MINSERT's column spacing, asking "Specify second point:"
(the distance is the scale or spacing, the direction the rotation; Enter
there keeps a preset's default); at XYZ's Z a point gives its distance from
the insertion point; Y scale refuses a point. They now do the same, with
AutoCAD's messages at each prompt ("Value must be nonzero.", "Requires
numeric distance or two points.", "Requires valid numeric angle or two
points.", "Requires numeric distance or second point.", "Requires numeric
value."). Exploded INSERT's scale takes a positive number only ("Value must
be positive and nonzero."). The Rotate preset still reads typed text as an
angle, so <<45 stays 45 degrees.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The JSON spacing form made floor(length / spacing) + 1 items on every path,
so on a closed one the last sat on top of the first (or nearer to it than
the spacing). AutoCAD 2024 fills a closed path with floor(length / spacing)
items and an open one with one more, at its end (measured with Fill entire
path on a closed and an open square and a circle). The spacing form now does
the same, letting length / spacing fall 1e-9 short for rounding.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The count was read as a number with no fraction, so 5.0, 5. and 1e1 were
taken; a point gave its distance from the pick as the count; and Enter ended
DIVIDE. AutoCAD 2024 takes +5, 05 and 2 to 32767, and refuses all of those,
and 4.5, 1, 32768 and x, with "Requires an integer between 2 and 32767, or
option keyword." ("...32767." once Block has been chosen) and asks again
(measured). DIVIDE now does the same. MEASURE, which shares the prompt
machine, is unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Enter new order" took a number with no fraction from 1 to 1000, so 5.0 and
1e1 were taken, and a point went back to the vertex menu without a word.
AutoCAD 2024 takes +5 and 05, keeps the order on 4 (a cubic's), and refuses
5.0, 5., 1e1, 4.5, 3, 27 and a point with "Requires an integer between 4
and 26."; the range starts at the spline's own order (measured at orders 4
and 5). The prompt now does the same, and the JSON form's elevate uses the
same wording. The prompt's logic moves to input_order(), which keeps
SplineditM::input under clippy's complexity limit.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD 2024 doesn't apply MAXARRAY to COPY's Array: with MaxArray 100000,
four lines and 26000 items made 104000 lines. The count is now 2 to 32767
whatever the selection, as AutoCAD asks it. A point at "Enter number of
items to array:" was ignored; AutoCAD refuses it with "Requires an integer
between 2 and 32767." (measured with a LISP point), and so does COPY now.
So that a large selection can't run out of memory, the copies (items after
the first, times the objects) stay within MAX_ARRAY_ITEMS, ARRAY's own limit
whatever MAXARRAY says, checked before anything is made.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The JSON form read `count` with as_u64 and `spacing` with as_f64 and quietly
dropped what didn't fit: a count of 4.5, "8" or -3 made the default 6 items,
0 made 1, and a spacing of 0, -5 or "10" fell back to the count. They are now
refused as the other arrays' JSON forms refuse them: the count goes through
count_or (a whole number of at least 1) and the spacing through size_param (a
positive number). Missing or null keeps the defaults.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Specify a precision <10>:" read a number from 0 to 99 and rounded it, so
5.0, 5. and 4.5 were taken. AutoCAD 2024 refuses those, and 1e1, 8/2, 100,
-1 and a point, with "Requires an integer between 0 and 99." and takes +5
and 05 (measured). A point used to convert with precision 10; it is now
refused too.
The JSON form clamped `precision` to 99 and read any other value as 10. It
now refuses a precision that isn't a whole number from 0 to 99; absent or
null is still 10.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The row and column counts were read as a number with no fraction, so 5.0,
5. and 1e1 were taken. AutoCAD 2024 refuses those with "Requires an integer
between 1 and 32767." and asks again, and takes +3 and 03 (measured at the
rows, and 5.0 and +3 at the columns). A point at these prompts was ignored
without a message; AutoCAD refuses it with the same message (measured with
a LISP point at the rows).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Writing the header entries back went through doc_mut, whose copy on
write gave a clean drawing a new Arc, so a refused OPTIONS call marked
it changed. apply now keeps the drawing's Arc when SNAPUNIT or GRIDUNIT
is among the values and puts that same Arc back on a refusal; a call
that names neither never touches the drawing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Enter number of items along path" read the count as a distance and cut
it to an integer, so 4.5 gave 4 items and 1e1, 8/2 and 3' were taken.
AutoCAD 2024 takes a whole number from 1 to 32767 in plain decimals
there (5, +5, 05, 5., 5.0) and refuses 4.5, 1e1, 8/2, 3', 0 and 32768
(measured); the count is now read the same way.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The ARRAYRECT, ARRAYPOLAR, -ARRAY and ARRAYEDIT count prompts read a
number with no fraction, so they took 5.0, 4. and 1e1. AutoCAD 2024
refuses those, and 8/2, 3' and 4.5, and takes +3 and 03 (measured at
ARRAYRECT's rows and columns, ARRAYPOLAR's items and rows, and -ARRAY's
rows and items). The count is now read as a whole number.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
options::reset missed 15 profile variables (the Dynamic Input, selection
preview and area, grip, PICKSTYLE and MEASUREINIT settings), so a reset
left them as they were. It now restores all of them; SNAPUNIT and
GRIDUNIT, which the drawing keeps in its header, are still left alone.
apply is all or nothing, but a refused value left SNAPUNIT and GRIDUNIT
written to the drawing's header. Their raw header entries are now put
back as they were, or removed when the drawing didn't have them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
main added SHX shapes to complex linetypes in linetype_text.rs; this
branch lays linetype elements out with Layout and phase. Both are kept:
shapes go where texts and dashes go (centred on an open run), and
main's point budget counts only the elements placed. main's shape test
now expects the centred positions, as the text test does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A width given by a point far enough away to overflow is refused with the
message typed text gets, and the width is asked again. In the JSON form, a
point that can't be read says so instead of saying `points` is missing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD 2024 takes "+3" and "03" at "Enter number of items to array:"
(measured: three items each), which the count's integer parse already
does. Say so in the comment and test it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured in AutoCAD 2024's core console:
- Objects join whole, by their end points; a polyline is never split, and
one met only at an inner vertex stays as it is. The source is the first
pick JOIN can take (a circle picked first is passed over).
- Where an object meeting the chain at more than one place goes: a
polyline by its first vertex if it can, before the chain rather than
after; a line or an arc turned round if it can. A source that already
ends where it starts still takes more; a join that closes the chain
stops it; a source of no length takes nothing; a lone polyline whose
ends meet stays open.
- Arcs that come round make a circle with no tolerance at the source's
start, and the command line asks "Combined arc segments form a circle.
Convert to circle? [Yes/No] <Yes>:" first; No leaves the arcs. The JSON
form takes the default.
- A new polyline keeps another polyline's widths, and what JOIN makes
goes in the source's space.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Up to three leader points, a text width (not remembered; a point gives its
distance from the leader's end), then lines of multiline text. The text
sits DIMGAP past the end: with the middle of its first line level with it
when the leader runs right (attachment 1), of its last line when it runs
left (attachment 9), whatever DIMTAD. A hook line DIMASZ long is added when
the last segment slopes and text follows. Enter at the first line leaves
the leader alone. Measured in AutoCAD 2024's core console. Alias LE, and a
JSON form.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD 2024 refuses 4.0, 1e1, 8/2, 1' and 3" at "Enter number of items
to array:" (measured), so the count is read as digits, not as a number
with no fraction. Enter at the mOde prompt now runs COPY in the mode the
prompt shows, and OPTIONS reset puts COPYMODE back to 0.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review of #2705: REVERSE turned a closed spline's whole fit list round
while the curve still started at the old first fit point. The DXF
writer, which writes a closed spline's fit points from the first one,
then wrote another seam, and the next fit-point edit moved it.
Measured with AutoCAD 2024 (accoreconsole) on SPLINE (0,0) (4,0) (6,3)
(1,4) Close:
- REVERSE keeps the first fit point first and turns the others round
([f0, f3, f2, f1]); it turns the tangent where the curve closes
(12/13) round and reverses the control points and knots;
- SPLINEDIT Fit data Move, Delete (of the first fit point too) and
Open keep that tangent instead of working it out again from the
points.
So a closed fit spline with chord-length knots now keeps its tangent
where it closes as both end tangents, as AutoCAD keeps 12/13:
- refits, grips and SPLINEDIT take it;
- `Spline::reversed` keeps the seam first and turns the tangent round;
- the DXF reader keeps it for such a spline, and drops the curve's own
tangents that the writer gives the others (periodic knots, a fit
tolerance, a kink);
- SPLINEDIT Close still gives the closed curve its own tangent.
A new closed spline still ignores the tangents given with it.
Also:
- a closed kinked fit stores its fit points from the kink where the
curve starts;
- the closing tangent is divided by its length, not normalised, so a
short one is not a zero tangent;
- AutoCAD's 44 = 1e-10 (no fit tolerance) is read as 0, and a tolerance
too tight to approximate with gives AutoCAD's chord-length build, as
for an open spline.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD 2024 builds a chord-length spline through two points as the cubic
with control points at the thirds whatever the fit tolerance (measured with
tolerance 1: the same control points and knots as with 0, only group 44
differs). The tolerance no longer turns it into a line. The comment on the
interpolation fallback now says what was measured, and the test compares
the result with the tolerance-0 fit.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
COPYMODE (profile, 0 copies until Exit, 1 makes one copy) and the base point
options mOde (sets it) and Multiple (this command only). Enter at the first
second point copies by the base point taken as a displacement. Array asks for
2 to 32767 items, the original included, and spaces them a second point apart
or, with Fit, up to it; Undo takes back the last placement, an array at once.
MAXARRAY caps an array's copies as it caps ARRAY's.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lines on the source's line make it one longer line and arcs on its circle
join counterclockwise from its start, both keeping the source's handle;
arcs that come round to within 1e-6 rad of its start make a circle on the
source's layer. An open polyline source keeps its handle, its own vertices,
elevation, PLINEGEN and (with only lines and arcs) constant width; other
polylines keep their bulges and widths, lines and arcs take the widths of
the source's vertex at that end. The tolerance is AutoCAD's measured 1e-6,
absolute at any coordinate size. The message names a line, arc or circle.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A click on the last fit point adds nothing, but the preview still added
the cursor there, so it showed a corner the command would not make.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Chord-length knots now run to the fit points' length rather than 1, so the
roundtrip check sampled only the first part of those splines. It now
samples the spline's own domain and checks the domain survives the file.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD 2024 (accoreconsole, entget after STRETCH of a spline stored with
fit points only) moves the fit points inside the area and fits the spline
through them again, keeping its fit data (70 = 1064, 74 = 4); with all of
them inside, it moves whole. Here such a spline moved whole by its first
grip, or not at all. The test pins AutoCAD's fit points for three windows:
the last fit point, a middle one, and the whole spline.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD 2024 (accoreconsole, entget of a 4 by 2 rectangle) keeps corners
exactly as long as the shorter side allows: fillet 1, and chamfer 1 + 1 or
1.2 + 0.8, still fit. A hair longer (fillet 1.0001, chamfer 1.2 + 0.81) and
the corners stay square, each still written twice. The rule already matches;
this pins the six measured rectangles, including which way the two chamfer
distances run.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Stacks the closed fit-spline change on the DXF tangent-length one (#2703).
Both change the SPLINE reader; the merged reader keeps both rules:
- an open spline keeps a file's 12/13 tangents with their length and is
rebuilt from fit data with them as the end derivatives (#2703);
- a closed spline drops AutoCAD's closing fit point and takes its
closing tangent from the curve, not from 12/13.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`transform` dropped a tangent that the map shrank to under EPS of the
tangent's own length. So SCALE 1e-10 lost a (100, 0) tangent, although
the map is invertible.
The check now compares with the map's largest axis scale. An invertible
uniform scale, however small, keeps the tangent. A singular map, or one
that squashes the direction to under EPS of that scale, still drops it.
`scale_factor` (sqrt |det|) would not do: it is 0 for a singular map, so
rounding noise would survive as a direction.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`sanitized` kept tangents longer than 1e-12, but `Vec2::normalized`
returns zero up to 1e-9, so a direction between the two was stored as
Some(ZERO): a zero end derivative instead of no tangent. Such a direction
is now dropped.
`transform` scales a tangent by the lengths instead of going through
`normalized`, so a short tangent from a file survives MOVE, ROTATE, SCALE
and MIRROR. A map that flattens its direction still drops it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A closed spline through fit points with chord-length knots and no fit
tolerance is now the cubic AutoCAD 2024 builds (measured with
accoreconsole): the open chord-length interpolation through the fit
points and back to the first, clamped, with the same unit first
derivative at both ends. That tangent is the derivative at the first
point of the cubic through the first four points of the loop, with
square-root-of-chord parameters.
AutoCAD flags this spline periodic (group 70 bit 2) although its knots
are clamped: it sets the bit from the curve, the same first derivative
where it closes. `Spline::is_periodic` now means that (closed and smooth
where it closes); the knot shape it meant before is `Spline::wraps`
(unclamped knots, control points wrapping round), which SPLINEDIT uses
for its control-point edits.
DXF: AutoCAD rebuilds a spline with fit data from its fit points and end
tangents, and opened a closed spline written with its fit points once
as an open spline. The writer now adds the first fit point again at the
end and the tangent where the curve closes as 12 and 13, as AutoCAD
writes it; the reader drops the closing point and takes the tangent from
the curve. AutoCAD reads the written spline back as its own (70 = 1067,
the same control points).
Closed splines with square-root or uniform knots, or a fit tolerance,
are unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A DXF SPLINE stored with fit points and 12/13 tangents only is rebuilt
with each stored vector as its end derivative, length included: AutoCAD
2024 does so (12 = (0, 3) gives control points 2.67 from those of the
unit (0, 1)). The spline keeps the vector, so it is written back as read.
Refits (grips, SPLINEDIT, STRETCH) use it as stored, and transforms turn
it and keep its length, as AutoCAD's MOVE, ROTATE, SCALE, MIRROR and
SPLINEDIT Fit data Move do.
SPLINE, SPLINEDIT and the JSON options still take tangents as unit
directions: fit_with normalises them, and SPLINEDIT's input is already
normalised.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
An open spline through fit points with chord-length knots and no fit
tolerance is now the cubic AutoCAD 2024 builds (measured with
accoreconsole, `entget` of the control points and knots):
- the knots are the running chord length, not normalised, with the fit
points' own parameters as the interior knots;
- there are two control points more than fit points: an end with a
tangent has it as its first derivative, an end without one has no
second derivative (with one tangent too);
- two fit points without tangents make a cubic with its control points
at the thirds, no longer a line.
SPLINE also leaves out a click on the point before, as AutoCAD does,
instead of storing a repeated fit point (a kink).
Closed splines, the other knot parametrisations and fit tolerance are
unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Properties attribute field's edit buffer is now keyed by the drawing's uid as well as the
handle and place, so text typed in one drawing is not committed in another drawing's reference
that has the same handle.
Apply in the dialog checks that the reference still has the attributes (tag and value, in the
same places) the dialog listed. If another command or an undo changed them, nothing is written:
the rows are reloaded and the dialog says so, instead of the typed value landing on whichever
attribute now has that place.
Regression tests: a_stale_dialog_does_not_overwrite_another_attribute,
a_pending_properties_value_does_not_follow_a_drawing_switch.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
attedit takes `at: {index: value}` beside `values`: one attribute by its place in
the reference (indexes checked against its attributes). The Edit Attributes
dialog and the Properties palette send their edits that way, so on a reference
with two attributes sharing a tag (a DXF may carry them) editing one row no
longer overwrites the other. `values` still changes every attribute with the tag.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Id::unique for the window, Ui::scope_id for the palette's value fields, as the
rest of the UI does since main's egui update.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
attedit::open(app, handle, current) opens the dialog on a block reference
of the active drawing with the given attribute (an index in
cadcraft_engine::attributes order) current: its tag is bold, and its value
box takes the focus and scrolls into view in the first frame. Without one,
or for one that can't be changed, the first editable attribute is current.
It returns false, and opens nothing, for anything but a block reference
with an attribute that can be changed. ATTEDIT/EATTEDIT from a menu go
through it, and Apply keeps the current attribute.
This is what a double-click on an attribute needs (#1790).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The dialog kept only the reference's handle, and handles repeat across
drawings: with another drawing's tab chosen, it stayed open and Apply
or OK changed that drawing's reference with the same handle. It now
records the drawing (DocState::uid), closes when another is active, and
Apply does nothing there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Edit Attributes (ATTEDIT/EATTEDIT typed or from a menu) with one block reference selected
opens the Enhanced Attribute Editor: tag, prompt and value of each attribute; Apply and OK run
`attedit {handle, values}` with the values changed, one undo step each. With nothing selected
ATTEDIT asks at the command line as before, and now takes a selected reference at once.
- The Properties palette lists a block reference's attributes in an Attributes group; values
can be edited there (multiline values with line breaks and constant attributes read-only).
- `attedit` JSON: refuses objects that aren't block references, references on locked layers and
values over 64 KiB; leaves constant attributes alone and reports them as `constantTags`.
- `cadcraft_engine::attributes` gives the rows the palette and dialog show (prompt from the
attribute definition when the attribute has none).
- REFEDIT on a dynamic block reference names the dynamic block and points to BEDIT or Edit
Attributes, instead of "*U1 is generated geometry".
- Shortcut menu: Edit Attributes only when some attribute can be changed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
After #2603, dashes are laid out only with Options::linetypes on: the
runs stroked with a layout (open, or closed from an anchor) and the
polyline centre line keep that check, so hit tests still draw lines
whole.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three rules measured in AutoCAD 2024 that main's RECTANG does not follow:
- Area sizes the rectangle so that its outline, corners cut, encloses the
area: _C 1.5 2.5 ... _A 1442.93 _W 35.535 has length 40.817, the
area plus 2 x 1.5 x 2.5 over the width; a fillet adds (4 - pi) r^2.
When the corners then don't fit, they stay square and the area is
the full rectangle's.
- A fillet or chamfer too large for the shorter side leaves each corner
as two coincident vertices, eight in all, as AutoCAD stores them.
- A typed Rotation is an amount turned in the ANGDIR sense from +X,
ANGBASE aside: with ANGBASE 90 and ANGDIR 1, 30 turns the rectangle
30 degrees clockwise. The modes line and the prompt's default show it
as the drawing shows angles: "Rotation=120.00", "30d30'" with AUNITS 1.
The fit test is one function, shared by the vertices and Area. Of the
40 measured cases that set every mode, main's RECTANG matches 33; this
matches all 40.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#2554, now in main, rewrote RECTANG's vertex order, corners and
remembered modes along the same measurements as this branch. The
conflicts are resolved by taking main's RECTANG as it is. The next commit
brings back, on top of it, the rules this branch measured that #2554
left out.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A CANNOSCALE naming none of the drawing's scales wrote that name to the
variable dictionary while the default contexts were written at 1:1; the
variable now names the resolved scale too.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD keeps the current annotation scale in the named object dictionary's
AcDbVariableDictionary, as a DICTIONARYVAR CANNOSCALE naming the scale.
CADCraft read only its own record, so AutoCAD's drawings opened at 1:1
whatever their scale (annotative objects then showed at their first scale),
and the variable was written back as read, so AutoCAD reopened a drawing at
its old scale after CADCraft changed it.
The variable is read when the scale is in the list (after CADCraft's record:
AutoCAD keeps that record as it was, so the variable is the newer one), and
the kept variable is written with the drawing's current scale. Annotative
objects are written at that scale.
Checked in CADCraft and AutoCAD: an AutoCAD drawing at 1:2 opens at 1:2;
switched to 1:10 and saved as DXF and DWG, AutoCAD opens both at 1:10.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
An annotative multileader's scale context (ACDB_MLEADEROBJECTCONTEXTDATA_CLASS)
holds the multileader's whole CONTEXT_DATA body at that scale: overall scale
(40), text height, arrowhead size, landing gap, content position and the
leaders. CADCraft dropped AutoCAD's on read and wrote none, so annotative
multileaders came back plain at the default scale's size, and AutoCAD showed
CADCraft's at one size at every scale.
Multileaders now go through the annotation scale contexts like text, MText
and dimensions: written at the default scale with AcadAnnotative xdata and a
context per scale (the entity writer's CONTEXT_DATA at that scale, with its
overall scale and landing gap set), read back at paper size. The DWG bridge
gives acadrust the CONTEXT_DATA{ group it reads the context after, and takes
acadrust's braces and marker out again.
Checked in AutoCAD: its own annotative multileader reads back at 1:2 and
1:10 at paper size, and the saved file reopens with text 0.18 / 0.9 as
before; one made in CADCraft opens with text 2.5 / 25 at 1:1 / 1:10, the text
moved with the scale.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Annotative text and MText went through the dimension block planning too and
left one empty anonymous *D block per scale in every saved file. The hostile
contexts test now saves, opens the file again and checks the scales and that
every context names a written SCALE.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD keeps an annotative object's size at each annotation scale it
supports in scale contexts (extension dictionary AcDbContextDataManager,
ACDB_ANNOTATIONSCALES, one *OBJECTCONTEXTDATA_CLASS per scale), with the
object's own groups at its default scale. CADCraft dropped AutoCAD's contexts
on read, so those objects opened as plain text at the default scale's size
and lost their scales on save; its own annotative objects went out with only
CADCraft's private record, so AutoCAD showed them at one size at every scale.
Text, MText and dimensions in model space and layouts are now written at
their default scale (the current one when supported) with AcadAnnotative
xdata and a context per scale: text insertion and alignment points, MText
width and columns, a dimension's text position and a *D block with its
geometry at that scale (sharing the DIMASSOC's extension dictionary when
there is one). Scales missing from the list are added. Reading takes the
scales from the contexts and the sizes back to paper size. Files before the
2007 format keep CADCraft's record as before. The DWG bridge gives acadrust
text contexts its way (marker, radians) and dimension contexts' blocks as
BLOCK_RECORD handles, and turns them back.
Checked in AutoCAD: it opens the output, keeps both contexts of each
object, and draws the dimension at 0.18 / 9.0 text height at 1:1 / 1:50.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
main now denies cognitive_complexity over 30 and too_many_arguments over 7.
This PR's additions took read to 32 and finish to 31, and retained_objects
to 8 arguments: the block-reference and attribute bookkeeping now lives in
insert_handles, of_insert, keep_attrib_dictionaries, keep_placements,
written_attribs and refreshed_contexts, and retained_objects takes the root
and its entries as one pair.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A kept attribute placement was looked up by its index among the reference's
attributes now, which differs once they are reordered or replaced (ATTSYNC).
It is now found by tag and place among that tag, like the attribute's contexts.
The rotation change is measured from the attribute as read too, not from its
default context, so an unchanged save no longer turns every context when the
ATTRIB (at the current scale) and the default context differ.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream now believes handles above 2^48 (AutoCAD writes them), so new
annotation contexts can no longer take stand-in handles from 2^48 up: they
start above the written handles, $HANDSEED, the kept objects and their targets.
Test: a drawing whose reference sits at 2^48 + 1 gains a scale and every
written handle stays unique (red with the old 2^48 base).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A kept context is brought up to date by what its block reference did since
the file was read. That baseline was the default context, which needn't be
where the reference was (an unchanged save then moved every context); the
reference and its attributes as read are now kept (`Foreign::placements`)
and used, the default context only for data without them.
A context's own offset from the reference now scales and mirrors with it
(back into the reference's frame then, scaled, turned to its frame now), not
only turns.
The default context is the one whose first 290 group is 1 everywhere (an
attribute context has a later 290 of its own).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the default context's scale had been deleted from the drawing's list,
a reference CADCraft keeps annotative got no new contexts for its added
scales; the template is now its default context, else its first, among
those whose SCALE is written.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A kept block reference or attribute context whose SCALE is no longer in the
drawing's list is not written (its dictionary entry goes with it), so no
context points at a null scale. A reference CADCraft's model keeps annotative
has a context for exactly the scales it supports: contexts of scales it
dropped go, and one per new scale is made from the default context, scaled
by the ratio of the scales about the reference's insertion point. One
context stays the default.
Attributes are identified by reference, tag and their place among the
reference's attributes with that tag, so two attributes with one tag keep
their own extension dictionaries and contexts.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD's DXF has a block reference context's rotation (50, degrees),
insertion point and scales straight after its scale (340). acadrust 0.6.4
reads them after an AcDbBlkRefObjectContextData marker, with the rotation in
radians, and without the marker read zeros: a drawing saved as DWG had every
annotative reference at scale 0 at its other annotation scales, where
AutoCAD then drew nothing. The DWG bridge now gives acadrust the contexts its
way (marker, radians) and turns its DXF back into AutoCAD's (no marker,
degrees).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The attributes of an annotative reference hold their own contexts (insertion
and alignment points and rotation at each annotation scale, under the ATTRIB's
extension dictionary), dropped like the reference's were. CADCraft writes
attributes with new handles, so their extension dictionaries are now kept by
attribute, as its reference's handle and tag, and put back on the attribute
written with that reference and tag. On writing each context keeps its own
place in the block at its scale, moves by what the attribute did in the block
since (its default context then, the attribute now), and is placed by the
reference's context for that scale as it is now: a reference left alone keeps
them as read; one moved, turned or scaled carries them exactly.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A reference to an annotative block holds its scale at each annotation scale in
its extension dictionary (AcDbContextDataManager, ACDB_ANNOTATIONSCALES).
CADCraft dropped it with the other annotation contexts it means to write from
its model, but it models none for references: with the block's annotative
flag kept, AutoCAD then scaled the reference once more by the current
annotation scale (5 became 25). A reference's contexts are now kept, and
refreshed on writing: each moves, turns and scales by what the reference did
since the file was read (its default context was the reference then), so a
reference left alone keeps them as read. The scales they name are found by
name (SCALE group 300), as the scale list is written again from the model.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A BLOCK_RECORD's AcadAnnotative xdata (references to the block are
annotative) was dropped on reading, AcadAnnotative being among the
applications CADCraft writes itself, and never written: a saved drawing's
annotative blocks came back plain, and AutoCAD then scaled their references
by units instead of the annotation scale (a metre block showed Unit factor
1000 and Scale 0.005). Group 281 (scale uniformly) was dropped too. Both are
now read into the block (`Block::annotative`, `Block::scale_uniformly`) and
written back.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The 50,000-period guard is for a display zoomed out a lot, so it now applies only where there
is a level of detail (min_pattern above 0). A plot or export has none and keeps the pattern on a
run of any length, bounded by the two-million-element work limit; linetype text follows, through
phase. This is the plot exemption of #1277 (#1069) in the new layout.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The anchor was the length of the first drawn segment, so when the first two
vertices coincide (Polyline::segments leaves that pair out) the pattern was
anchored at the third vertex. It is now the chord length from the first
vertex to the second (wide::second_vertex_at), 0 for that pair, and the
thin run and the wide band share it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The rewritten layout capped runs at 50,000 periods but dropped the
earlier limit of 2,000,000 pattern elements, so a long pattern repeated
that often could produce millions of ranges. A run past either limit is
drawn continuous again.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A JSON pline without a width now takes PLINEWID, as the command does,
unless its vertices give their own widths; an explicit width, 0
included, is kept. FILLET and CHAMFER's JSON forms already fall back on
their variables the same way.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The anchor of a closed PLINEGEN polyline is now the length of its first
segment tessellated at the drawing tolerance, as the run is measured,
not the arc length. With an arc first, a dash now starts right at the
second vertex, matching the filled band, which already measured it so.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With fill off, a polyline with width draws its centre line. It now goes
through the same layout as a polyline without width: stretched around a
closed PLINEGEN one from its second vertex, along the whole of an open
PLINEGEN one, and restarted at each vertex otherwise.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured in AutoCAD 2024 with ANGBASE 90 and ANGDIR 1: Rotation 30 turns
the rectangle 30 degrees clockwise from +X (ANGBASE aside), and the next
RECTANG shows "Current rectangle modes: Rotation=120.00", the rotation
from ANGBASE in the ANGDIR sense; the rotation prompt's default reads
<120.00>. With AUNITS 1, 30.5 shows as "Rotation=30d30'". The typed
rotation is now an amount turned in the ANGDIR sense, and both the
modes line and the default use the drawing's angle settings and units.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A closed PLINEGEN polyline with width now lays its pattern out like a
thin one: stretched around the run from the second vertex
(linetype::ranges_as with Layout::Closed), not centred as an open run.
phase() now gives where the periods of a gap-first pattern start when
the run leaves room for a piece of dash at its start: a gap before the
second element at x, as gap_first lays them, so text in the linetype
sits with its dashes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Patterns were laid out from the start of every run with the first dash
whole. AutoCAD 2024 plots, read back stroke by stroke, show otherwise:
an open run is drawn continuous when shorter than one period, and
otherwise the pattern is centred (n = floor(L / period),
p0 = (n·period + first − L) / 2), the first dash starting at the run's
start and the last ending at its end; a pattern opening with a dot puts
dots at both ends, and one opening with a gap has a rule of its own. A
closed run (a circle, a whole ellipse, a closed PLINEGEN polyline) is
stretched to round(L / period) periods from its anchor (angle 0, or the
second vertex).
linetype::layout makes the drawn stretches for both; apply, apply_as
and ranges use it, the draw code picks the closed layout for circles,
whole ellipses and closed PLINEGEN polylines, and text in complex
linetypes follows the same phase. The measured lines, dots, circle,
rectangles and 33 gap-first cases are pinned in the linetype tests.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream (#1989) builds each crate's tests as one binary; dynblock_params.rs moves into tests/it, and dynamic_grips.rs's new fixture path is one level deeper.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A rotate or scale action with a fixed base point still acts about where the
dynamic block has it after a base point parameter has moved the reference;
AutoCAD replays the whole history instead. The PR said so; the row now does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- An action that moves a base point parameter moves the reference's insertion point with it and
the block's objects and parameters back, as AutoCAD saves it.
- Alignment parameters: type read, a grip at the base point; dragged next to an object the
reference moves onto it and turns along it, its right side toward the cursor (measured in AutoCAD).
- Lookup columns UpdatedAngle, UpdatedFlip, UpdatedDistanceX/Y, UpdatedX/Y (and polar distance
and angle) set and read, including the reverse lookup; any changed parameter re-evaluates the
lookups that read it.
- A distance of 0 is taken, as AutoCAD takes it.
- A first-time flip value is saved with its state after its points and the flip grip's record
without a point; AutoCAD dropped the reference's dynamic properties otherwise.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream gathered each crate's integration tests into one binary (tests/it); the scale and polar
stretch tests move there. The scale action's doc now says an XY parameter scales by its diagonal,
as the code does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A polar stretch action turns its objects about the polar parameter's base by the change of its
angle and moves the vertices in its frame (and the objects it doesn't stretch) with the end, as
AutoCAD does; its rotate-only objects just turn. Parameters in its selection are carried.
A scale action driven by an XY parameter scales uniformly by the parameter's diagonal, as AutoCAD
does (the X-only and Y-only choices live only in DWG data that isn't read).
Stretch and move actions on polar and XY parameters were checked against AutoCAD: they already
match.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A scale action scales its objects about its base point by how much the distance it follows grew
(an XY parameter's horizontal and vertical distances each on their own axis), as AutoCAD does,
carrying the parameters in its selection. Factors that would scale to nothing or overflow are
refused.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream (#1989) builds each crate's tests as one binary, tests/it/main.rs; these files moved with their fixture paths.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Custom angle properties were formatted to AUPREC decimals straight from
the value, so 359.7 degrees with no decimals showed as "360". They are now
rounded first and wrapped back into 0 to 360.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
blocks.reference.grips listed an XY parameter's corner grips as baseXEndY
and baseYEndX (serde's camelCase), but blocks.reference.grip takes
basex-endy and basey-endx, so a caller passing a listed grip back was
refused. The corners are now listed by the names a drag takes, and the
command's params doc names them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A dynamic block reference now repeats its arrayed objects as AutoCAD does:
along a linear or polar parameter one copy per whole column offset in its
distance, across an XY parameter a whole number of columns by rows (just the
object when either is short of one), following the parameter's base point.
Copies after the first carry AutoCAD's AcDbBlockArrayActionTag; without it
AutoCAD can't change the reference again ("Invalid input").
Polar parameters show Distance1 and Angle1, XY parameters X Distance1 and
Y Distance1, in Properties (editable, value sets applied; an XY distance
below its minimum is refused as AutoCAD refuses it), with square grips at
the base and end and an XY parameter's two other corners.
Checked against AutoCAD with a linear, a polar and an XY array block: copy
counts and positions match for each value tried, AutoCAD reads CADCraft's
saved values and geometry, and changes them again.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The rotation grip is drawn where its grip object is, which can be off the
radius' end; its stops are now marked there too (the grip object's angle and
distance from the base added to each value), not at the radius' end.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A distance or angle whose values are a list, or go by an increment, stops
only at those values; while its grip is dragged, the preview marks each stop
with a short tick across the grip's travel (a few pixels, whatever the zoom),
as AutoCAD does. `dynblock::grip_stops` gives the stops: along a distance from
the point that stays, or from its midpoint, and round an angle's circle (a
full turn being no turn).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
main now denies cognitive_complexity over 30: apply() was at 35 with the
rotate and flip actions. The action loop becomes ActionRun, one method per
kind of action (rotate and flip, stretch and move), and the carrying of a
parameter by a stretch is shifted(). No change in what the actions do.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A repeated handle queued the transform twice: a flip mirrored the object back
while its value recorded the flip. Repeats are skipped, as the stretch and
move path does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A new flip value from a one-point record had its state (70) written before
the end point was added, between the two points.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
It still said only visibility states and lookups could be changed and
that only stretch and lookup actions were read. Distances and positions
(stretch, move), angles (rotate) and flip states (flip) can be changed,
and their value records are saved.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A flip record was told from another two-point record by a group 70 after
its points. A stray 70 on a linear or rotation record made its value a
flip (and ignored), and a flip record without its state was read as
plain points. The parameter the record is keyed by now decides.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
At a rotation grip AutoCAD's Dynamic Input asks for the angle alone; CADCraft
showed a distance and an angle from the grip. A prompt can now say it asks for
an angle about its base (`Prompt::angle`), and a command can give the value
the cursor would give (`Interactive::live_value`, under the crash guard;
`Session::live_value`). The rotation grip does both, with the angle as
Properties will show it, and the canvas draws one box: what was typed, else
that live value.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A flip mirrors text and attributes but AutoCAD draws them readable (MIRRTEXT
0): the text keeps the mirrored footprint, so text that ran away from the
symbol still runs away from it on the other side. CADCraft mirrored only the
text's anchor, so flipped text ran back across the block. Text carried by an
action that mirrors now reads in whichever mirrored direction is nearer its
own, and swaps left and right justification when its footprint is reversed
along it (AutoCAD keeps the justification and moves the start back by the
text's width, which draws the same; it re-derives attributes from the block
when it next changes them), top and bottom when reversed across it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The flip grip was a narrow triangle; AutoCAD draws a block arrow, a short
shaft and a head about as wide as a square grip. Its shaft and head are filled
apart (the painter fills convex shapes) and outlined as one.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD shows an angle parameter's value as it shows any angle: from ANGBASE,
clockwise when ANGDIR is 1. In a drawing measured clockwise from north it shows
an Angle1 of 0 as 90, and 0.5 rad as 61.35 (checked in AutoCAD). Properties and
typed values (blocks.reference.set, a value typed at the rotation grip) now
convert the same way; the stored value is unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD draws a rotation parameter's grip where the block's grip object is,
which need not be the radius' end (a well-centre symbol has it a quarter turn
round), and turns it with the angle. CADCraft drew it at the radius' end. The
grip is now placed from its grip object, kept along and across the radius as
it turns (as the flip grip already was), and dragging it subtracts the grip's
offset from the radius, so the block turns by the cursor's turn instead of
jumping to the cursor's direction.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A rotation parameter's grip (a circle at the radius' end) turns the angle when
dragged (a typed number sets it, in degrees); a flip grip (an arrow across the
reflection line, placed from its grip object and turning with the line) flips
at a click. A flip value record keeps its state after its points, also in a
record CADCraft writes without a template. A synthetic Symbol fixture covers
reading, turning, flipping, grips and bad values. Also: #967's test
expectation counts positions from 0.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Angle1 (degrees, as Properties shows them) turns the rotate action's objects
about its base point; Flip state1 mirrors the flip action's objects across
the current reflection line (text stays readable). Parameters in the
selection are carried along, attributes follow, the flip grip's record and
the history are written as AutoCAD writes them. Checked against AutoCAD's own
output for the same changes: value records, history and geometry match.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Picks up #2302, which formats crates/render/src/dim/linear.rs; the
gate's fmt step failed on that file, not on this branch's changes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A full-sweep arc (start = end) has a zero chord, so rebuilding it from
the moved ends gave nothing and STRETCH left it in place even when the
window held all of it. When both ends move, translate the arc instead;
rebuild from the ends only when one of them moves.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#2239 replaced stretch.rs's glob import with an explicit list, and the
new arc rule names cadcraft_geom::Arc, which only the glob brought in, so
the branch no longer compiled on main. `use cadcraft_geom::Arc;` after
the use super::{…} block is the only change the merge needs. Reported in
review.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#2239 replaced rect.rs's glob import with an explicit list that names
rect_with_corners, which this PR removes (the new vertex builder replaces
it), so the branch no longer compiled on main. Dropping the name from the
list is the only change the merge needs. Reported in review.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bounds2 skips non-finite points, so a glyph with one overflowing corner
could be culled from the few corners left. Any non-finite corner now
leaves the glyph to the mesh code.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Screen builds left out a filled glyph when a fixed font-unit box
(-1000..2000) placed by its transform missed the view, so ink reaching
more than an em past its box (flourishes, long ligatures, tall stacks,
large operators) vanished when the view saw only that part. Each
outline now records its font-unit bounds once as it is built, exposed
as ttf::glyph_bounds through the same per-thread and shared outline
caches, and may_show places those four corners instead: exact, and
still four points per glyph however long its outline.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD's published system variable reference gives ATTDIA an initial
value of 0: a typed INSERT asks for attribute values at the command line,
which also keeps scripts and agents typing through the command line as
before. ATTDIA 1 still opens the Edit Attributes dialog. The dialog tests
set ATTDIA 1 themselves; a new check shows the default opens no dialog.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Two review questions, answered by measuring AutoCAD 2024 (accoreconsole,
read back with entget):
- A crossing window that holds a spline's control point but misses the
drawn curve selects nothing in AutoCAD ("0 found"), so the spline stays
put; CADCraft does the same. Only a window that also crosses the curve
moves the control point, (10,100) to (15,103). Both cases join the test.
- An arc end stretched onto the other end: AutoCAD collapses the arc into
a zero-radius arc at that point (radius 6e-16). CADCraft keeps the arc
rather than make an object nothing can draw or pick; the code says so.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
PLINE now starts at PLINEWID and stores its widths back, but the
variable itself was out of reach: typing PLINEWID was an unknown command
and GETVAR an unknown variable until a Width answer happened to set it.
It joins the header-variable table (a real of at least 0, default 0, as
in AutoCAD), so GETVAR reports 0, SETVAR and the typed name set it, and
SETVAR ? lists it. Suggested in review.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With chamfer, fillet, width, elevation, thickness and rotation carried
over, a plain RECTANG can draw something its own command never asked for,
and nothing said so. It now opens with AutoCAD's line, in AutoCAD's words
and order: "Current rectangle modes: Chamfer=1.6574 x 2.8497 Rotation=50.50",
"Current rectangle modes: Elevation=7.5000 Thickness=2.2500 Rotation=30.96"
(both from AutoCAD 2024's log for the same inputs); no line when every
mode is off. POINT already echoes its modes the same way. Suggested in
review.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every attribute of a block reference had a grip, also those locked in
position and invisible ones, which AutoCAD gives none. Dragging a multiline
attribute's grip moved its position but not its multiline text, so the grip
moved and the text stayed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The moved attribute's insertion and its multiline text's are checked
again after saving to DXF (in the drawing's version; R2000 DXF has no
multiline attributes) and reopening.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reference's attribute moved with its definition, but a multiline
attribute's text (its embedded MTEXT) stayed behind; the grip preview drew it
as one line. Both landed before multiline attributes (#854) and couldn't use
them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A typed or menu INSERT asks a Verify attribute's value twice and gives
Preset (and constant) attributes their defaults without asking. ATTREQ 0
gives every attribute its default; ATTDIA 1 (the default) asks for the
values in an Edit Attributes dialog, typed answers still working. Both are
user settings, as DWG keeps them in its header only before R2000. Answers
are counted per prompt, so two definitions with one tag no longer ask the
second for ever. The JSON form never asks.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
REFEDIT on an xref (or a block that came with one) edits it in place, and
REFCLOSE Save writes the change into the source drawing (the old file
kept as .bak, symbol prefixes removed, host symbols copied, handles kept)
and reloads the xref. Refused for read-only files, files locked by
another program or open in another tab, and files changed since they
were loaded or during the edit. Nested references are picked through
their parents (path, nested, refedit.levels, "Select nesting level
[OK/Next]"). Everything outside the working set is drawn faded
(XFADECTL), and an Edit Reference bar offers Add to/Remove from Working
Set and Save/Discard Changes. Gap F2.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
#2220 moved STRETCH to cmd/modify/stretch.rs; keep_height and the arc,
polyline-bulge and spline rules move with it, unchanged, below the doc
comment #2220 gave stretch_entity.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#2220 moved PLINE's prompt machine to cmd/draw/line_pline.rs; the fix
(PLINEWID as the starting width, Undo returning to the last segment's
mode) moves with it, unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#2220 moved RECTANG from cmd/draw2.rs to cmd/draw2/rect.rs and LastUsed
from lib.rs to last_used.rs. The fix moves with them: rect.rs carries the
AutoCAD vertex rules, draw2 re-exports RectangModes, and LastUsed keeps
the remembered RECTANG options.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Area sized the rectangle so that its cut corners take nothing off the
area asked for, but it did so even when the fillet or chamfer turned out
too large for the resulting sides and the corners stayed square: Area 4,
length 4, fillet 2 drew a square-cornered 4 x 1.858 rectangle. When the
corners don't fit, the sides now come from the area alone (4 x 1), in the
JSON form and at the prompt. Pointed out in review.
The fit test now lives in one place (corners_fit, with corner_cuts) and
is shared by the vertex builder and the Area sizing. All 64 measured
AutoCAD cases still match vertex for vertex.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
When a stretch brings both ends of a polyline arc segment together, the
chord is zero and there is no arc height left to keep; keep_height still
returned the old bulge, which then sat on a zero-length segment. It now
returns 0 (also for a NaN chord). Pointed out in review.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
STRETCH was checked against AutoCAD 2024 black-box: 36 crossing-window
cases run in accoreconsole (lines, polylines, arcs, circles, text,
ellipses, splines, points, block references), each object read back with
entget. Lines, straight polylines, circles, text, full ellipses, points
and block references already matched; three kinds of object did not.
- Arcs moved whole when their centre was inside the window and were left
alone otherwise. AutoCAD moves the ends that are inside and keeps the
arc's height, bulge x chord / 2: the arc (0,0) r20 0-90 deg with its
start stretched by (5,3) becomes centre (3.1798, -2.2061), radius
22.4326. The centre alone moves nothing.
- Polyline arc segments kept their bulge, so they ballooned or flattened
as a vertex moved. AutoCAD keeps their height too: bulge 0.5 over a
chord of 25 becomes 0.6338 when the chord shrinks to 19.72 (and -1.5
becomes -1.2303 over a longer one).
- Splines moved whole when their first grip was inside, and stayed put
otherwise. AutoCAD moves the control points inside the window. Splines
built from fit points keep the old behaviour, which was not measured.
An elliptical arc with one end inside is still left as it was: AutoCAD
changes the whole ellipse there by a rule one measurement does not pin.
The new test stretch_arcs_bulges_and_splines_match_autocad pins nine of
the measured cases.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
PLINE was checked against AutoCAD 2024 black-box: 76 typed inputs run in
accoreconsole, read back with entget and GETVAR. 72 matched; with this
change all 76 do.
- Undo after an arc segment stayed in arc mode, so a following `_L` was
arc mode's Line instead of line mode's Length and the point became a
plain vertex. AutoCAD returns to the mode of the segment now last:
`_A` point `_U` `_L` point continues the last line by the point's
distance, ending at (64.48701958199356, 48.21692560701169) in the
measured case.
- PLINEWID was ignored: AutoCAD starts every polyline at that width
("Current line-width is 0.7500") and stores the ending width of the
last Width or Halfwidth answer back into it (`_H 0.5 0.5` leaves
PLINEWID 1).
The new test pline_undo_mode_and_plinewid_match_autocad pins both with
the measured numbers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
RECTANG was checked against AutoCAD 2024 black-box: 64 typed inputs run
in accoreconsole, each polyline read back with entget. 18 matched; with
this change all 64 match vertex for vertex.
- Vertex order: AutoCAD starts at the first corner and runs along the
first axis towards the other corner, so a rectangle is clockwise when
the corners are picked down-right or up-left. CADCraft always started at
the lower-left corner and ran counterclockwise.
- Chamfer: the first distance is cut on the edge into each corner and the
second on the edge out of it, in drawing order. CADCraft cut the first
along x and the second along y, which mirrors the corners whenever the
two distances differ.
- Fillet bulges follow the drawing direction: negative on a clockwise
rectangle.
- A fillet or chamfer too large for the shorter side leaves each corner
as two coincident vertices (8 vertices, no arcs), not 4 vertices.
- Chamfer and Fillet replace each other: the option set last wins.
CADCraft kept the fillet when a chamfer was set after it.
- Area sizes the rectangle so that the outline, with its corners cut
off, encloses the area given: L = (A + 2*d1*d2) / W for a chamfer and
(A + (4 - pi)*r^2) / W for a fillet. This applies to the JSON form too.
- Chamfer, fillet, width, elevation, thickness and rotation carry over to
the next RECTANG (AutoCAD opens it with "Current rectangle modes:
Fillet=2.0000" or "Elevation=7.5000 Thickness=2.2500 Rotation=30.96").
They are kept in LastUsed; the JSON form stays stateless.
The new test rectang_vertices_match_autocad pins 12 of the measured
cases, one or more per rule. Three older tests change with the measured
behaviour: an oversized fillet now gives 8 coincident-pair vertices, and
two tests that draw several rectangles in one session set the remembered
rotation or fillet back explicitly.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each thread kept up to 8192 glyph outlines in front of the shared cache with no size limit, and
held them after the shared cache let them go. They are now held within MAX_SHAPED_POINTS / 16
points per thread, and an outline above a quarter of that is read from the shared cache instead.
The generation test reads the cache before checking the generation, so another test's change in
between can't fail it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each thread's text meshes were capped at 4096 entries but not by size; CJK text at full detail
could hold hundreds of MB per core. They are now capped at 16 MiB per thread (with the shared
cache's size estimate), and a mesh above a quarter of that is read from the shared cache instead.
A font lookup that ran while a font was being registered could keep the old answer (a "not
found") on that thread until the next change. The generation is read before the lookup, and the
answer is kept only under that generation, so a lookup overtaken by a change starts over.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Display lists are built on all cores, but every text looked its font up,
and every character its font lacks (all of a CJK text's) its fallback
font, glyph outline and glyph mesh, through shared tables behind global
locks; text-heavy drawings spent most of the build waiting on them.
Font lookups, fallback faces, FONTALT, glyph outlines and glyph meshes
now have per-thread caches in front of the shared ones (a generation
counter empties them when fonts or FONTALT/FONTFALLBACK change).
On screen, filled glyphs outside the area being looked at are left out,
as hatch patterns already are (the canvas builds again when the view
leaves that area); plots and exports keep every glyph. Zoomed in, every
glyph of every text was filled at that zoom's detail and drawn each
frame, i.e. on every mouse move.
Synthetic 3.8 MB drawing (24,000 TEXT and 2,500 MTEXT in Chinese, 30,000
lines), macOS, Apple silicon: display list at fit 335 -> 103 ms;
triangles at 16x zoom 11.2 M -> 0.44 M, at 64x 19.0 M -> 45 k.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 09:58:53 -06:00
577 changed files with 70205 additions and 5510 deletions
Checks for the crates you changed: `cargo test -p <crate>`, `cargo clippy -p <crate> --all-targets -- -D warnings`, `cargo xtask layers`, `cargo xtask assets`, `cargo xtask wasm`, `cargo xtask parity` (regenerates `docs/parity-checklist.md`).
Headless column ([RFC-0052](https://github.com/storytold/craft-contrib/blob/main/rfcs/0052-headless-reach.md)): `cargo xtask parity` marks a covered menu item `headless: yes` because its command is in the engine registry that `cadcraft-cli` and the MCP server load. An uncovered item takes `no`/`partial` and a `reach` (`window`, `os`, `engine-gap`) from `HEADLESS` in `xtask/src/parity.rs` (a path ending in ` > ` covers its submenu), or reads `unknown`. Never write `yes` there. A covered leaf is `yes` whatever its marks say, so a submenu mark stays while any leaf under it is uncovered; drop a mark only once commands cover every leaf it matches (the check then fails on it as stale).
Paths and conventions:
- No crate allows `unsafe` (`unsafe_code = "forbid"` in the workspace).
@@ -25,6 +25,7 @@ Generated-in-code assets are original and have no file to list:
| Asset | Author | Source | Licence | Notes |
|---|---|---|---|---|
| `crates/ui-egui/src/i18n/zh_shared.tsv` | @V1dalTheAbidal | [craft-i18n #444](https://github.com/storytold/craft-i18n/pull/444), [pinned Simplified Chinese CADCraft catalog](https://github.com/storytold/craft-i18n/blob/9fa32aecf2759cd61bb216a958df68da619798f3/locales/zh-hans/cadcraft.tsv#L201) | MIT OR Apache-2.0 | Exact generated one-row projection for offline builds; AI-assisted, not native-speaker reviewed. |
| `licenses/jpeg-encoder-0.6.1/` | jpeg-encoder contributors and Independent JPEG Group | [jpeg-encoder 0.6.1](https://crates.io/crates/jpeg-encoder/0.6.1) | (MIT OR Apache-2.0) AND IJG | Dependency license and SIMD notices; source hashes in SOURCE.json. |
| `epaint_default_fonts::EGUI_ICONS`, `epaint_default_fonts::EMOJI_ICON` (dependency font inputs) | John Slegers | [egui 173cc737](https://github.com/storytold/egui/tree/6d518fc799681571963842f95b55a6b68431b15a/crates/epaint_default_fonts/fonts), [emoji-icon-font](https://github.com/jslegers/emoji-icon-font) | MIT (Copyright (c) 2014 John Slegers; full upstream text in `NOTICE`) | egui-icons.ttf is the five-glyph subset; emoji-icon-font.ttf is the full monochrome fallback. Registered by the production default font definitions; dependency assets unmodified here, no font file copied into this repository. |
| `krilla 0.8.2 / icc/sGrey-v2-magic.icc` (dependency-embedded) | Clinton Ingram | [craft-libs 9f89fe8 vendor/krilla/icc/sGrey-v2-magic.icc](https://github.com/storytold/craft-libs/blob/9f89fe8f6d72ab4db4cc06f186381a6a254463ab/vendor/krilla/icc/sGrey-v2-magic.icc) (Krilla 0.8.2 upstream 3ffdf0588cf98050aad6edba51ca70162e1fb5b5) | CC0-1.0 | Embedded by the pinned PDF writer (`craft-pdf` 0.1.0, Krilla 0.8.2); unmodified dependency asset, no file copied into this repository. SHA-256 `4110169287e5f1b5149ca9f1da1814d32943905bba8030e849d1a3b729a19481`. |
@@ -85,7 +86,43 @@ Generated-in-code assets are original and have no file to list:
| `crates/ui-egui/src/i18n/ko.tsv` | @huk082 (AI-assisted) | Original Korean translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied; no font assets added |
| `crates/ui-egui/src/i18n/ar.tsv` | @hasan-sdaif | Original Arabic translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied |
| `crates/ui-egui/src/i18n/hu.tsv` | @Skaywalker | Original Hungarian translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied |
| `crates/ui-egui/src/i18n/tr.tsv` | @ogzhnklvz (AI-assisted) | Original Turkish translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied; written from the English strings, no other catalog used as a source; the running app reviewed by a native speaker |
| `crates/ui-egui/src/i18n/tr.tsv` | @ogzhnklvz (AI-assisted); 870 later rows: @HolyZephyros (AI-assisted) | Original Turkish translations of CADCraft English strings (original catalog by @ogzhnklvz; 870 later rows written from CADCraft's English strings in #3291) | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied; written from the English strings, no other catalog used as a source; the running app for the original catalog was reviewed by a native speaker; the 870 rows added in #3291 have not yet been reviewed by a native speaker |
| `crates/ui-egui/src/i18n/el.tsv` | @Camthalion77 with ChatGPT (AI-assisted); 46 later rows: @V1dalTheAbidal with Claude Code (AI-assisted) | Original Greek translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied; the 46 later rows were read by their contributor, a native Greek speaker; independent native proofreading of the whole file pending |
| `crates/ui-egui/src/i18n/vi.tsv` | @2ez4gcx with Claude Code (AI-assisted) | Original Vietnamese translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied; terminology chosen with a native speaker, full proofreading pending |
| `crates/ui-egui/src/i18n/vi.tsv` | @2ez4gcx with Claude Code (AI-assisted) | Original Vietnamese translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied; terminology and the craft-i18n#401 phase 1 changes reviewed by a native Vietnamese speaker; older rows not yet proofreadin full |
| `crates/ui-egui/src/i18n/ka.tsv` | Davit Matchakhelidze (@devius), native speaker, with Claude Code | Original Georgian translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied; written from the English strings, no other catalog used as a source; terminology and doubtful strings decided by a native Georgian speaker; no font assets added (the Georgian face comes from craft-fonts) |
| `crates/ui-egui/src/i18n/ta.tsv` | @newsbaba24x7 (AI-assisted) | Original Tamil translations of CADCraft English strings, shared with storytold/craft-i18n `locales/ta/` | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied; written from the English strings; the 1,289 rows from craft-i18n reviewed there for language and terminology by native speakers, and the whole Tamil interface reviewed in the running app by native speakers Radhika and Mohan Raj (2026-11-14); no font assets added (Tamil comes from an installed font or the craft-fonts face) |
## PDF import
The CAD mapping and initial synthetic PDF tests are adapted from CADCraft contributor
direct distance entry, window and crossing selection, grips, and right-click-to-repeat behave
the way decades of drafting habit expect.
- **Open files.** DXF is read and written natively (ASCII and binary, R12 through 2018), and DWG
files (R13 through 2018) open and save through the open-source acadrust library. Export to SVG
and PNG today.
- **Open files.** DXF is read natively (R12 through 2018, with binary support from R13) and
written as 2000 through 2018 (ASCII and binary). DWG files (R13 through 2018; R13 and R14
untested, 2018 tested only on synthetic files) open through the open-source acadrust library
and save as 2000 through 2018. New drawings default to
2018 (AC1032) in both formats. In the app's Save dialog, File ▸ Default Save Format
(also Options ▸ Open and Save, `saveVersion`, default 2018) sets the version Save As and
Export write, for opened drawings too; Save (QSAVE) of an opened file keeps its own version,
subject to supported-version mapping and the DWG minimum. SAVEAS `version` overrides this choice and is remembered for later
saves. Export to SVG and PNG today.
- **Fast and native.** Pure Rust and egui, no Electron, no web view. One binary on macOS
(universal), Windows, Linux and FreeBSD, plus a WebAssembly build for the browser.
- **Built for agents.** Every menu item, tool and prompt is a command. Agents can type at the
@@ -114,11 +120,11 @@ numbers):
| Layers & properties | Layers palette and Layer Properties Manager (on/off, freeze, lock, plot, colour, linetype), layer tools (isolate, freeze, off, lock, match, previous), Properties palette with per-object editing, linetypes, lineweights, colour index and true colour |
| Annotation | All DIM* commands with full DIMSTYLE variables, overrides and every arrowhead, associative dimensions that follow geometry, MLEADER, TABLE, TrueType fonts (`.ttf`, `.otf`, `.ttc` collections), MTEXT formatting codes (fonts, heights, colours, stacked fractions), our own single-stroke drafting font |
| Hatch & blocks | Pick-point hatch boundaries with islands, pattern, solid and gradient fills from our own pattern library, BLOCK/INSERT, attributes and nested blocks |
| Files | DXF read (R12–2018, ASCII and binary) and write (R2000), including dimension styles, associativity, tables and constraints; DWG read (via the acadrust library) and write (R2000); PDF plotting, SVG and PNG export. Entities CADCraft doesn't model yet are not kept on save: see [file-format parity](docs/file-format-parity.md) |
| Files | DXF read (R12–2018, binary from R13) and write (2000–2018, ASCII and binary), including dimension styles, associativity, tables and constraints; DWG read (via the acadrust library; R13 and R14 untested, 2018 tested only on synthetic files) and write (2000–2018). New drawings save as 2018 (AC1032); opened drawings keep their supported version, except DWG defaults to at least 2004. In the app's Save dialog, File ▸ Default Save Format (also Options ▸ Open and Save, `saveVersion`, default 2018) sets the version Save As and Export write, for opened drawings too; Save (QSAVE) of an opened file keeps its own version, subject to supported-version mapping and the DWG minimum. SAVEAS `version` overrides this choice and is remembered for later saves. DXF uses R2000 structure with the chosen `$ACADVER`. PDF plotting, SVG and PNG export. Entities CADCraft doesn't model yet are not kept on save: see [file-format parity](docs/file-format-parity.md) for version selection and fidelity |
| Parametric | Geometric and dimensional constraints, AUTOCONSTRAIN, PARAMETERS with expressions, conflict detection; constraints re-solve after every edit |
| Grips | Hot grips with Space to cycle Stretch, Move, Rotate, Scale and Mirror |
| Interface languages | English, Ukrainian (Українська), Brazilian Portuguese (Português (Brasil)), German (Deutsch), Spanish (Español), Czech (Čeština), Russian (Русский), French (Français), Simplified Chinese (简体中文, with an installed CJK font), Italian (Italiano), Korean (한국어, with an installed Hangul font), Swedish (Svenska), Arabic (العربية, with an installed Arabic font), Hungarian (Magyar), Turkish (Türkçe), Greek (Ελληνικά), Bosnian (Bosanski) and Georgian (ქართული), live switching and a remembered Auto/system-language choice; [details](docs/localization.md) |
| Interface languages | English, Ukrainian (Українська), Brazilian Portuguese (Português (Brasil)), German (Deutsch), Spanish (Español), Czech (Čeština), Russian (Русский), French (Français), Simplified Chinese (简体中文, with an installed CJK font), Italian (Italiano), Korean (한국어, with an installed Hangul font), Swedish (Svenska), Arabic (العربية, with an installed Arabic font), Hungarian (Magyar), Turkish (Türkçe), Greek (Ελληνικά), Bosnian (Bosanski), Georgian (ქართული) and Tamil (தமிழ், with an installed Tamil font), live switching and a remembered Auto/system-language choice; [details](docs/localization.md) |
**Stage: pre-alpha** · next: alpha, when the six rows of the [alpha gate](docs/roadmap.md#alpha-gate) pass (five fail today; the gate was revised on 2026-11-19 and its hours are not re-estimated yet)
> **Last reviewed:** 2026-11-19 · **Last updated:** 2026-11-20 · **Change:** minor (Upcoming updated for what merged on 2026-11-19 and 2026-11-20; previously major: alpha gate revised from user reports: six rows, Windows first; Upcoming re-ranked into three priority tiers; previously minor: re-audit against main 41d9b5e95) · **Target:** Autodesk AutoCAD 2027
> **Last reviewed:** 2026-11-19 · **Last updated:** 2026-12-01 · **Change:** minor (Upcoming updated for what merged from 2026-11-25 to 2026-12-01; previously minor: Upcoming updated for what merged from 2026-11-21 to 2026-11-25; previously minor: Upcoming updated for what merged on 2026-11-19 and 2026-11-20; previously major: alpha gate revised from user reports: six rows, Windows first; Upcoming re-ranked into three priority tiers; previously minor: re-audit against main 41d9b5e95) · **Target:** Autodesk AutoCAD 2027
CADCraft targets full parity with AutoCAD (2D drafting first, then annotation, layouts and
plotting, DWG, parametrics and 3D), plus what AutoCAD doesn't have: agent control over MCP, a
@@ -84,8 +84,8 @@ Hours are Opus 5.5 agent wall-clock hours, calibrated on this repo's own build:
## Languages
AutoCAD 2027 for Mac ships 8 interface languages; CADCraft ships English plus eighteen catalogs
AutoCAD 2027 for Mac ships 8 interface languages; CADCraft ships English plus twenty catalogs
(Ukrainian, Brazilian Portuguese, German, Spanish, Czech, Russian, French, Simplified Chinese, Italian, Korean, Swedish, Arabic, Greek, Hungarian, Turkish, Bosnian, Georgian, Vietnamese, Polish and Tamil; Tamil needs an installed Tamil font or a build with the craft-fonts face, and without one the interface stays in English). Detail: [localization-parity.md](docs/localization-parity.md).
| Language | Status | UI translated |
|---|---|---:|
@@ -103,7 +103,7 @@ AutoCAD 2027 for Mac ships 8 interface languages; CADCraft ships English plus ei
Other languages shipped: Ukrainian (1,357 rows, the reference catalog, #36), Czech (1,215), Russian (1,005), Italian (1,352), Swedish (1,382), Hungarian (1,326) and Turkish (1,330), counted 2026-10-24; engine messages stay English. Every catalog but Ukrainian's has strings added since it landed that still fall back to English: 6 (Italian, Swedish) to 296 (French) per `cargo xtask i18n` ([localization-parity.md](docs/localization-parity.md)).
Other languages shipped: Ukrainian (1,357 rows, the reference catalog, #36), Czech (1,215), Russian (1,005), Italian (1,352), Swedish (1,382), Hungarian (1,326) and Turkish (1,330), counted 2026-10-24; engine messages stay English. Since those counts Polish (#218) and Tamil (#3105) landed and the Russian (#3378), Czech (#1579) and Vietnamese (#3500) catalogs were brought up to date; the counts here are not redone. Every catalog but Ukrainian's has strings added since it landed that still fall back to English: 6 (Italian, Swedish) to 296 (French) per `cargo xtask i18n` ([localization-parity.md](docs/localization-parity.md)).
## Upcoming
@@ -112,16 +112,18 @@ already written and waiting in a pull request lands before new work starts, whoe
and the beta checklist are in [docs/roadmap.md](docs/roadmap.md).
**1. Urgent: security fixes, leaks, crashes and lost work.**
- The open findings of the security audit (#1919–#1935): check each against the input limits that
- The open findings of the security audit (#1922, #1925, #1931, #1932 and #1935 of #1919–#1935; the others are closed): check each against the input limits that
landed on 2026-11-11, close what is fixed and fix the rest. A crafted handle that makes new entities
overwrite existing ones (#1921) is fixed by #1276.
- A saved file that crashes AutoCAD 2021 (#3303) and dimension text lost on save (#3299).
- Crashes and hangs with a reproduction: the web build on a large DXF (#1603), a DWG with 3D content
(#2174), startup on older graphics hardware (#1724, #1631,#3222).
- A saved file that crashes AutoCAD 2021 (#3303); dimension text lost on save (#3299) was fixed on 2026-11-20.
- Crashes and hangs with a reproduction: the web build on a large DXF (#1603; bounded by #3594 and
#3622, still open), a DWG with 3D content (#2174), startup on older graphics hardware (#1724, #1631,
#3222).
**2. Parity with AutoCAD: the alpha gate rows, then the beta checklist (apart from its items named under tier 3).**
- It starts on common hardware: an automatic fallback renderer (`CADCRAFT_STENCIL=0` is the manual
switch since #3336).
- It starts on common hardware: the automatic fallback renderer landed (#3685; `CADCRAFT_STENCIL=0`
is the manual switch since #3336); waiting for the reporters to confirm, and older Intel Macs (#1631,
#2146) are not covered.
- It opens the DWG and DXF files people already have: large files (#3102, #2633, #1088), layouts and
paper units (#1672, #2836), and a corpus of real files run in CI.
- Saving loses nothing and other CAD programs open the result (#2904, #1687, #3234, #2632).
@@ -131,16 +133,20 @@ and the beta checklist are in [docs/roadmap.md](docs/roadmap.md).
- The prompt options that still say "not available yet" (gaps F1).
- Layouts print at scale on a system printer (#3216); the menu bar and panels can be restored since
#3308.
-661 pull requests are open (2026-11-20; 714 the day before). About 230 were mergeable, passed CI and were small; they are
-586 pull requests are open (2026-12-01; 602 on 2026-11-25). About 230 were mergeable, passed CI and were small; they are
reviewed and landed in this order, the longest-waiting authors first within a row.
**3. Lower priority: affects fewer people and nothing breaks without it.**
- Dynamic-block authoring, editing an xref in place, exact ellipse and spline geometry, correct
polyline offsets.
- Dynamic-block authoring, the leftovers of editing an xref in place (landed in #3352), exact ellipse
and spline geometry, correct polyline offsets.
- Prompt options that need 3D (DVIEW's camera options, -RENAME Material); 3D itself comes after 1.0,
but a file with 3D content must open safely (tier 1).
- Menu breadth against AutoCAD for Mac as a headline number.
Done from 2026-11-25 to 2026-12-01: REFEDIT, REFSET and REFCLOSE on xrefs, writing the xref's drawing back in the version it was read in (#2355 in #3352; not on the web); an automatic fallback renderer when the graphics can't start (#3685 in #3692; not yet confirmed by the reporters, and older Intel Macs are not covered); TRIM highlights only the part a click removes and EXTEND what it adds, and EXTRIM (#3382, #2808 in #3471; follow-ups #3526 in #3690); SCALE Reference Points and Copy, and grip Scale of text heights (#3288 in #3472); QLEADER at the command line (#2740; its Settings dialog is not available yet); OFFSETGAPTYPE (#1506); FILLET and CHAMFER with two polylines and with middle, closed and arc segments (#1223); prompts and results of COPY, JOIN, PEDIT, RECTANG, STRETCH, PLINE, SPLINE, SPLINEDIT, ARRAY, ARRAYPATH, DIVIDE, INSERT and MINSERT brought closer to AutoCAD's (#2726, #2725, #2906, #2790, #2204, #2209, #2205, #2699, #2703, #2705, #2772, #2778, #2761, #2762, #2774, #2782, #2780, #2784, #2766, #2789); spreadsheet text pasted as a TABLE (#3290 in #3470), with wrapped cell text and Enter to repeat (#3584, #3587 in #3690); GROUPDISPLAYMODE, group copies and draw order across every layout (#2152); New Layout from Area (#2080); drawing locks and WHOHAS, which say when a drawing is open elsewhere (#1018, part of #540); REVCLOUD arcs that other readers recognise as a cloud (#1692); hatches by internal point that keep their arcs (#1474); `\X` dimension text below the line (#1084); JIS and Japanese paper sizes (#1810); a translucent fill in the AREA preview (#1303); selection through a viewport that leaves out block parts on its frozen layers (#3214 in #3692); saves that keep covered cell text, WIPEOUTFRAME, LAYOUT flags, VPORT group 72, attributes on layer 0 and DIMLFAC measurements (#3520, #3611, #3668, #3670, #3613 in #3689; #3540 in #3692), and RENAME that keeps foreign data (#1020); the web build's display list, selection highlight and plot style outlines bounded (#3594, #3622 in #3692; #1603 stays open); hostile-input fixes toward the security audit (#3482, #3491, #3536 for #1923; #3610, #3647 for #1922; #3588 for #1925; #3609 for #1935; #3484, #3539, #3562, #3590 for quadratic-time opens); LISP and script fixes (#3519, #3572, #3576, #3642, #3646, #3651); the move to the shared UI framework, with floating palettes as OS windows and Ctrl+= and Ctrl+- for the interface scale (#3449); the Tamil catalog (#3105 in #3470) and the Russian, Czech and Vietnamese catalogs brought up to date (#3378, #1579, #3500).
Done from 2026-11-21 to 2026-11-25: PDFIMPORT, a PDF page as editable lines, polylines, solid hatches and text (#3375 in #3419); dynamic block references that rotate, flip, array, scale, stretch polar, align and look up, with their grips (#963, #993, #1030, #1098, #1699, #1723, #1752 in #3424; authoring is still open); the proxy graphics of other applications' objects drawn (#2697, #3435, #3437) and dimensions kept as read drawn from their `*D` block (#3439); saves that keep layout plot settings (#3233, #3386, #3390), DXF 2007+ table cell text (#3392), hatch boundary flags (#3389), fit text (#3391) and registered applications (#2918); the Array window for ARRAYRECT and ARRAYPOLAR (#3394); ATTDIA and the Edit Attributes dialog on INSERT (#3411) and constant attribute values drawn (#3462); Edit > Paste from the system clipboard (#3366, #3460, #3461; #3320 open); opening from Finder and quit prompts on macOS (#1347 in #3344, not yet run on a Mac); an already-open drawing selects its tab when opened from the interface (#899 in #3422; the control channel, MCP, scripts and LISP still open a second copy); Tab through every object snap candidate (#1673); the Write Block dialog for WBLOCK (#1778); Generate Boundary (#2804); mitred wide polylines (#3453; the extents leave out the mitre tip, #3443); DIMASSOC 1 (#2977); crossing selection of block references by what they draw (#3445); an option to turn off the update check (#3097).
Done on 2026-11-19 and 2026-11-20: the hostile-input fixes #1276, #2820, #2821 and #2765 (#3304, #3305), clicks while the mouse moves and right-click or Space as Enter (#3307), the interface reset (#3308), paper units (#3309), the UCS command (#3310), -ATTEDIT, -RENAME and -LAYER options (#3311), TRIM/EXTEND depth (#3312), dimension values kept on save (#3335), the stencil switch (#3336), a typed OPEN path (#3343) and double-click text editing (#3345).
Done before that: precision input (#379, #441, #60, #519), prompt options in TRIM/EXTEND,
@@ -170,6 +176,8 @@ REFEDIT (#818), XCLIP (#2354), dynamic block references (#838–#883), and the D
| Date | Change | Summary |
|---|---|---|
| 2026-12-01 | minor | Upcoming updated for the merges of 2026-11-25 to 2026-12-01 (REFEDIT on xrefs, the automatic fallback renderer, TRIM/EXTEND highlight and EXTRIM, SCALE Reference, QLEADER, OFFSETGAPTYPE, FILLET/CHAMFER with polylines, spreadsheet paste as a TABLE, groups and draw order, New Layout from Area, drawing locks and WHOHAS, what saves keep, web display-list bounds, security-audit fixes, the shared UI framework); languages list now twenty catalogs (Polish, Tamil); pull-request count 602 → 586; percentages and hours not re-scored |
| 2026-11-25 | minor | Upcoming updated for the merges of 2026-11-21 to 2026-11-25 (PDF import, dynamic block reference actions, proxy graphics, what saves keep, Array window, ATTDIA, system clipboard paste, macOS opening from Finder, WBLOCK dialog, Generate Boundary); #3299 fixed; pull-request count 661 → 602; percentages and hours not re-scored |
| 2026-11-20 | minor | Upcoming updated for the merges of 2026-11-19 and 2026-11-20 (security stacks, input, interface reset, paper units, UCS, prompt options, TRIM/EXTEND, text editing in place); pull-request count 714 → 661; percentages and hours not re-scored |
| 2026-11-19 | major | Alpha gate revised from user reports (six rows, Windows first; block authoring, xref editing in place and exact curve geometry moved to beta); Upcoming re-ranked into three tiers: urgent (security, leaks, crashes, lost work), parity, lower priority; percentages and hours not re-scored |
| 2026-10-24 | minor | Re-audit against main 41d9b5e95: language table, CI gate and open-PR count re-checked against main 41d9b5e95 |
(CONFIG_DIR,"the settings folder (logs, autosave, workspace, plotters); empty means no settings folder"),
(LOCALE,"the interface language, instead of the system's"),
(VSYNC,"1 presents with vsync, 0 without it (default: without on Linux and BSD)"),
(STENCIL,"0 opens the window without a stencil buffer, for drivers that show a black window; clipped layout viewports then draw unclipped"),
(
STENCIL,
"0 opens the window without a stencil buffer, 1 keeps it on every attempt; unset, a start that can't draw with it drops it (clipped layout viewports then draw unclipped)",
),
(WAYLAND,"1 keeps the native Wayland backend instead of XWayland; 0 or unset is off"),
(NO_NATIVE_MENU,"macOS: 1 keeps the menus inside the window; 0 or unset is off"),
(SYSTEM_CURSOR,"1 uses the system cursor instead of the drawn crosshair; 0 or unset is off"),
@@ -46,8 +49,10 @@ pub(crate) struct Env {
pub(crate)locale: Option<String>,
/// Present with vsync (default: off on Linux and BSD, on elsewhere).
pub(crate)vsync: Switch,
/// Off: the window has no stencil buffer (default: on). Some old drivers (Mesa on Intel HD
/// 4000, old Intel drivers on Windows) accept a stencil pass and then present a black window.
/// Off: the window has no stencil buffer; on: it keeps one on every attempt at starting the
/// graphics. Default: it starts with one, and a start that can't draw with it drops it (see
/// `renderer`). Some old drivers (Mesa on Intel HD 4000, old Intel drivers on Windows) accept a
/// stencil pass and then present a black window.
pub(crate)stencil: Switch,
/// Keep the native Wayland backend instead of XWayland.
/// Drain queued menu events into commands (Discord opens externally), rebuild Open Recent, retranslate on a language change and refresh enablement when 300 ms have elapsed.
.params("{name (\"*NAME\": exploded), file?: DXF/DWG path (defines or redefines block `name`, default the file name, from its model space; base point $INSBASE), at: [x,y], scale?: number | [x, y], rotation? (degrees), basePoint?: [x,y] (block coordinates), attribs?: {TAG: value}, explode?: bool}")
.params("{handle (a dynamic block reference), name (a custom property as Properties names it: a visibility state, a lookup, a distance or\"Position1 X\"), value (lengths in drawing units)} → {properties}")
.params("{handle (a dynamic block reference), name (a custom property as Properties names it: a visibility state, a lookup, a distance,\"Position1 X\", an angle or a flip state), value (lengths in drawing units, angles in degrees; a flip state by name or 0/1)} → {properties}")
.params("{handle, node (the parameter's graph id), part: base|end|at, to: [x,y] (drawing coordinates)} → {properties}: a distance's arrow changes the distance (snapped to its values), a position's square moves it")
.params("{handle, node (the parameter's graph id), part: base|end|at|basex-endy|basey-endx, to: [x,y] (drawing coordinates)} → {properties}: a distance's arrow changes the distance (snapped to its values), a position's square moves it, a rotation's circle turns its angle, a polar or XY parameter's squares move its base, end or corners")
.params("{handle, values: {TAG: value} (tags in any case)} → {changed, unknownTags?}")
.params("{handle, values?: {TAG: value} (tags in any case; every attribute with the tag), at?: {index: value} (one attribute, by its place in the reference, for repeated tags); constant attributes are left alone} → {changed, unknownTags?, constantTags?}")
.params("{p1, p2 | dimensions: [l, w] (p2 picks the quadrant) | area + length|breadth, rotation? (deg), fillet?, chamfer?: [d1, d2], width?, elevation?, thickness?, center?: bool (p1 is the centre, not a corner; the size spans it evenly)}")
.params("{p1, p2 | dimensions: [l, w] (p2 picks the quadrant) | area + length|breadth (the outline encloses it, cut corners included), rotation? (deg), fillet? (wins over a chamfer), chamfer?: [d1, d2], width?, elevation?, thickness?, center?: bool (p1 is the centre, not a corner; the size spans it evenly)}")
Input::Text(t)=>self.rotation=s.angle_settings().direction(&t).ok_or_else(||other("Requires a valid angle."))?,
// An amount turned in the ANGDIR sense from +X, ANGBASE aside, as AutoCAD takes it.
Input::Text(t)=>self.rotation=s.angle_settings().rotation(&t).ok_or_else(||other("Requires a valid angle."))?,
_=>{}
},
RAsk::RotPick1=>{
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.