* 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]>
* 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]>
* 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]>
* 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]>
* 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]>
* 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]>
* 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]>
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]>
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]>
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]>
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).
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.
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.
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.
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 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.
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.
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]>
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.
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]>
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.
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]>
* Add the Write Block dialog for WBLOCK
WBLOCK typed or started from a menu now opens a Write Block dialog instead of
failing with "`path` is required": source (block, entire drawing or objects),
base point and destination file, with Select objects and Pick point that hide
the dialog for a canvas pick and bring it back. JSON calls are unchanged.
A new WBLOCKPICK command runs those picks and keeps the result in
Session::wblock_picks, like HATCHPICK does for the Hatch dialog. Escape closes
the dialog, and ends the command while picking.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(wblock): address CodeRabbit review comments
- WblockPickM Objects: use SelectPhase::default() instead of begin(s)
so canvas picking always prompts explicitly, even with a pre-existing
selection (the dialog pre-fills handles itself)
- wblock.rs: reject non-numeric/non-finite base coordinates with an
error message instead of silently defaulting to 0
- Add i18n strings for the two new coordinate-error messages (it)
- Add test: preexisting_selection_still_prompts
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
* fix(wblock): address review comments from skylartaylor
1. EntireDrawing now passes `name: "*"` to run_wblock, which clones the
whole drawing (all layouts, paper space, INSBASE preserved) instead of
sending only d.model handles and resetting INSBASE.
2. Add integration tests in wblock_dialog.rs that call run_wblock and
read back the written file for EntireDrawing and Objects+base modes.
3. Reformat parse_coord's early return to satisfy rustfmt.
4. Drop the two "Mouse wheel zooms…" rows from it.tsv; they belong to
the wheelzoom PR, not this one.
5. resume() now checks that the current drawing UID matches the one the
pick started in, mirroring hatchdlg::resume; start_pick restores the
dialog when wblockpick fails to start instead of closing silently.
6. Add all wblock dialog labels to uk.tsv (Source, Destination, Base
point, Pick point, File name and path, etc.); fix the period mismatch
in the "No objects selected" error key.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
* test(wblock): call confirm() directly and add layout-entity coverage
- Make confirm() and picked_handles pub so integration tests can reach them.
- wblock_dialog.rs now calls wblock::confirm() instead of app.run, so the
test fails if confirm constructs wrong params (addresses CodeRabbit comment).
- app_with_two_entities adds one paper-space entity via Drawing::add so the
EntireDrawing test can also assert j["layouts"] == 1 (second CodeRabbit
comment).
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
* test(wblock): assert base-point translation and INSBASE preservation
- write hook now records Line endpoints so the Objects test can verify
that the base-point offset is actually applied to entity coordinates:
line (0,0)→(10,0) with base (5,3) becomes (-5,-3)→(5,-3).
- EntireDrawing test sets INSBASE to (7,3) before confirm() and asserts
the exported drawing still carries (7,3), covering the preservation
behaviour of whole-drawing mode.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
* wblock: the chosen path clears an earlier file-dialog refusal
Clicking "…" while the save panel is still open shows "A file dialog is
already open; answer it first." The message stayed after the panel was
answered; the path chosen now clears it. The button's code moves into
browse(), with a test.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* wblock: the dialog belongs to the drawing it was opened on
Opened on drawing A and left open while drawing B was shown (its file tab),
OK applied the retained source, handles and destination to B: with
drawing-local handles colliding, B's objects were written to A's file.
The dialog now keeps the drawing's uid when it opens (and binds to the
current drawing when opened by name with no state). It closes once another
drawing is shown, as the Hatch dialog does, and confirm() refuses to write
from another drawing, saying why.
Tests: for Objects, Block and Entire drawing, the dialog opened on A, B
shown through document.switch (what the tab runs), B holding the same
handles and a block of the same name: confirm() writes nothing, one frame
closes the dialog, and back on A nothing is written either. The two
existing confirm() tests now open the dialog first.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* wblock: English keys only, and the completion message through i18n
As AGENTS.md rule 16 asks, the Italian and Ukrainian rows this PR added
to the app catalogs go to a linked storytold/craft-i18n PR instead. The
Chinese row for the WBLOCKPICK command label stays: every command label
must be in zh for chinese_menus_and_commands_are_fully_translated, and a
test can't be weakened to make a check pass (rule 31).
The completion message ("N objects written to …") and the dialog's
selected-object count were English built with format!; they now go
through crate::tf! and crate::i18n::count, so each has a catalog key
and a plural form.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
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.
* #1336: test that the DXF LAYER table stops at the record cap
The LAYER, LTYPE, STYLE and DIMSTYLE tables had no record cap, unlike VIEW, UCS and VPORT. The test reads a DXF with over a million LAYER records and checks the layer list stays at the cap; without the guard it holds every record (1000102 layers). The other three tables scan their lists linearly per record, so a million-record file is too slow to build in a test and they stay uncovered.
* #651: test that small filled text is simplified on screen and keeps full detail in plots
Filled TrueType text was triangulated at full outline detail at every zoom, which froze the canvas on pages of small text.
The test draws four O glyphs in a font built in the test itself (a 128-point ring registered through `cadcraft_fonts::ttf::register`), so it needs no installed font and no font file in the repository, and it never skips. At 10 px per cap height the rings are simplified and the shapes keep their extent; with an em under two pixels each glyph is the ink's box, two triangles; a plot keeps every point. Without the fix the on-screen build has the plot's 1024 triangles.
`crates/render/src/text.rs` gains the same policy without any font: `detail` returns Full for a plot, Box for an em under two pixels and Reduced for a small one, and `simplify` drops the points of a flattened curve at a coarse band and keeps them at a fine one.
* #618: test that OFFSET takes a clicked distance and picks its source under grid snap
OFFSET only accepted a typed distance, and with grid snap on a click meant to pick the source object was moved to the nearest grid point.
The engine test clicks two points for the distance and checks the second-point prompt and its base, the guide line in the preview, OFFSETDIST and the resulting offset. The canvas test does the same through grid-snapped clicks, then picks the source line and checks the side click puts the copy 5 units up, that OFFSET asks for the next object and that Enter ends it. Both live in the per-crate integration-test binary (#1989).
Without the fix the engine and canvas tests stay at the distance prompt; with only the cursor's point-prompt test reverted the canvas test never picks the line.
* Tests: one synthetic TrueType builder for render and PDF, and the exact LAYER cap
Sonar's duplicate-lines gate flags 84 of the 334 new lines (25.15% against a 3% limit): the render
level-of-detail fixture's `fixture_font_bytes` and the PDF writer's `test_font` build the same sfnt
tables, so the two suites carried a copy each.
Both now build their fonts with `crates/fonts/tests/support/sfnt.rs`, which the two suites include
with `#[path]`. The fonts layer owns the table format it reads (`crates/fonts/src/ttf.rs`), so the
skeleton lives beside its tests and neither consumer is turned into a published API or a dependency;
no Cargo entry changes. The glyph shapes (`ring`), the cmap ranges and the metrics each font records
stay at the caller: the render fixture keeps its two 128-point contours with the counter wound the
other way, its 1000-unit em and 700-unit cap height, and the PDF fixtures keep their three fonts.
The font files are byte-identical before and after the refactor: render 1704 bytes, sha256
83b9914cdf6e704df1ca5851ecefc98708c947b0d5be818cf5b6282761d31db0; PDF embeddable 484 bytes
2711cc7394b2057ba7e6bee22bb25a6c25edd4ecec0d35ba326759a04fcdefb9 and `fsType=2` restricted 484
bytes 3e6b534115429e8cbfdefd97e40ebdeb874222fcd7929f69b02d261cef622db4, one byte apart at OS/2
`fsType`; and the deliberately short `hmtx` 476 bytes
dbcc548f59a4d3e414deb959014b8548632a7fa66fe12201895cdcbe6e66a000, whose `hhea` still declares three
metrics while `hmtx` holds one.
The DXF LAYER cap test asserted `<= 1_000_000` and `> 900_000`, which lets up to 99,999 valid
records go missing unnoticed. It now asserts exactly the million layers the parser keeps, written as
a literal so a changed constant fails the test instead of following it, with a records-specific
message. Removing the guard reads 1000101 layers; a cap of 950,000 reads 950,000.
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.
Imported text with no alignment point, or with coincident points, no longer
takes the read-time measurement, so an edited height is saved as edited. An
Aligned ATTDEF with an empty default keeps its stored height when its points
move; its rotation still follows the points.
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.
Conflicts: dxf_read.rs (proxy tables next to the UCS names), render/blocks.rs
(proxy graphics inherit the proxy's own transparency without its locked-layer
fade, as block contents now do), roundtrip test (allow_in_process). Two tests
main added build an Unknown and get the graphics field.
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.
Leave fixed-property visual styles out of DWG 2007 saves and count them in the save report. Expose the same count to hosts and cover the affected and unaffected save paths with synthetic tests.
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.
The Model LAYOUT is written from a synthetic page setup without kept plot
flags, so its plot layout flags (AcDbPlotSettings group 70) were always
688 (512|128|32|16) and never had 1024, "ModelType", which the DXF
Reference (PLOTSETTINGS, group 70 "Plot layout flag") defines for the plot
settings of model space. Every saved DXF, and every DWG built from the same
DXF text, had a Model layout without it.
plot_layout_flags now sets 1024 for the Model layout and clears it for a
paper-space layout, also when a file's kept flags had it there, since it
would mark that layout as model space. The other bits stay as in #3227.
Test: layout_plot_flags::only_the_model_layout_carries_the_model_type_flag.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
MTextLayout only had `bounds`, one box over every column and the gutters
between them, so a background mask drawn from it (the MTEXT background
fill of PR #3240) paints the empty gutters too. Add `column_bounds`: one
box per column in the order the text flows through them, measured like
`bounds` (same corners, rotation and attachment) but each only as wide as
a column and as tall as that column's own height or its text, whichever
is taller. Columns the text leaves empty keep their place; reversed
columns are placed right to left like their text.
A layout with one column, columned or not, has `column_bounds` equal to
`bounds`, so a consumer that switches to it draws exactly what it drew
before. `bounds` itself is unchanged for every other consumer.
For issue #3319.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- 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.
The writer told the bridge from a DXF file by comparing the declared and the
target version, which are both R2000 for an R2000 DWG. Kept constraint groups
of a 2013+ drawing were then put in the old node order although the bridge
reads them as the version they came from, and kept proxies took the pre-2007
DXF layout. The bridge says so itself now. The render settings test module is
skipped where acadrust isn't built.
Since #2882 a DXF of 2010 or earlier leaves out solids whose geometry only
the data store holds, and the interactive QSAVE asks before it does. The
warning's hint still said DXF 2010 and earlier keep them, which is the
version that loses them. The hint now depends on the version the file is
saved in: 2013 and later keep such solids, and the proxies a DXF before
2007 leaves out as well. Also rustfmt of the merged finish signature.
Conflicts with #2882 resolved: a DXF's loss report counts both what #2882
leaves out (solids whose ACIS geometry the version has no place for, in
either direction of 2013) and what #3234 leaves out before 2007 (proxies
whose strings it can't hold, with what goes with them), each named with its
own reason, for SAVE/SAVEAS, document.bytes, EXPORT, -WBLOCK and the
interactive QSAVE question. dxf_raw::finish takes both flags.
Conflicts with main resolved: the source form is main's Foreign::version
(#2471), recorded at read time for the same reason, instead of the PR's own
Foreign::acadver. The conversion goes to the version the text is read as,
as #1728's constraint groups do: a DXF's own version, and for the DWG
bridge the version the kept objects came from, which craft-dwg's
encode_kept_noted declares, so there they stay as read. The DWG test opts
in to in-process DWG.
nextest runs each test in its own process, and the opt-in is process-wide,
so a DWG test calls it itself. acadrust is a dev-dependency only where
craft-dwg builds its native bridge (#2526), as the other DWG test files say.
A block with a name other than *D that an unedited dimension was read with
is written with the dimension blocks (#3302). Its BLOCK_RECORD lost its
insertion units and explodability there, and the BLOCK its description.
When that block is empty, the picture is regenerated in world coordinates,
so the block now goes at the origin rather than at the read base point,
which shifted the picture.
The new DWG-saving test of #3302 opts in to in-process DWG conversion.
All boxes share one text field, so Ctrl+Z in a new box could bring back
the text typed into the last one; its undo history is cleared when a box
opens.
The draft was keyed by the object's handle only, and handles repeat across
drawings; it is now also bound to the drawing's id, so it is never shown
or submitted for another drawing's object.
At a non-unit annotation scale an annotative TEXT, attribute definition or
dimension is drawn scaled; the editor box now takes its height, position
and extents from that scaled object, as the renderer and EXPLODE do.
TEXTEDIT on a TEXT now edits it in place, so the IME goes into that box
(tested in text_double_click.rs); the command line's own IME handling is
tested where it still collects the text: TEXT's Enter text prompt.
The one-line editor was narrower than the text it edits: an egui area
caps its width, and a centred or right-justified text's box started at
its insertion point. TEXTEDIT now gives the editor the drawn text's
extents (TextEditor::extents, from the renderer's text placement), and
the box starts at the drawn left edge, is at least as wide and as tall as
the drawn text, and still grows as more is typed.
Double-clicking an MTEXT opens the editor with its contents; what is typed
is kept with Ctrl+Enter. Carried from #1425.
Co-authored-by: simanov <[email protected]>
Double-clicking single-line text, an attribute definition or a dimension
(no command running) now opens a one-line text box over it on the canvas,
as AutoCAD does, instead of asking at the command line (#842). Enter or a
click outside keeps the text, Esc cancels, and an emptied box keeps the old
text. A dimension's box shows its text override, or <> for the measured
value, with the measured value beside it; emptying it or typing <> alone
gives the measurement back.
The box answers TEXTEDIT's prompt, so the edit is one undo step and
scripts, the command line and engine.execute behave as before. The engine
describes what to edit through Interactive::text_editor, TextEditor and
EditorKind (MText, Line, Dimension), following the design in #2320.
Co-authored-by: Luminati <[email protected]>
The macOS app code is not compiled by PR CI (Linux). The dispatch and its
tests do not need the Apple-event crate, so they now build everywhere and
check the opening and unsaved-changes paths against CadApp on each change.
OPEN followed by a file name, or the JSON form with only a path, typed
at the command line and entered with Enter now reads the file on the
background reader with the Opening card, instead of opening the file
picker and dropping the path (or, for the JSON form, reading it on the
UI thread). Programmatic calls (control channel, MCP, scripts, LISP)
still open synchronously and return their result.
The DWG decoder writes the start and end angles of an elliptic hatch edge in radians; DXF
keeps degrees and the DXF reader reads degrees. A circle stored as an elliptic edge (0 to
2π) became an arc of 6.28 degrees, and the hatch covered the hole it should leave open.
The decoded DXF is passed through dwg_hatch::elliptic_edge_degrees before it is read.
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]>
With the craft-libs bump a DWG is converted by a worker unless the process
opts in. The UCS round-trip test and the SETVAR save test write their own
drawings as DWG and now opt in themselves; the SETVAR one passed only when
another test in the same binary had opted in first.
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]>
The provider is asked per family; FIND shows matching drawing text in
the monospace family, the command line and palettes in the proportional
one. Thai typed at the command line (#2949) goes through the same path.
The in-place editor lays text out with the interface fonts, which have no
Thai, so a Thai MTEXT the canvas draws correctly showed as boxes while
editing (and in the command-line prompt, layout tabs and layer names).
An egui font provider now answers a character no interface font has with
the face drawing text takes for it (cadcraft_fonts::ttf::fallback_for),
sharing the font table's bytes. A face whose letters are small for its em
(Cordia New, Angsana New) is scaled up to the interface's x-height, and
its glyphs sit on the interface baseline. theme::install_fonts is not
changed.
Face::glyph_height measures a glyph in ems for that scale.
Other programs name a dimension's picture block as they like (DXF group 2
may name any block). dim_block_plan only reused blocks named *D, so such a
dimension was regenerated into a fresh *D block on save, its text changed,
and the read block stayed in the file unreferenced. The plan now reuses the
block an unedited dimension names, whatever its name, and leaves it out of
the ordinary blocks when nothing else uses it.
The two socket tests put their socket at <temp>\cadcraft-single-instance-<pid>-<test>\instance-test.sock,
about 58 bytes on top of %TEMP%. uds_windows allows 107 bytes, so a long %TEMP% made
UnixListener::bind(...).unwrap() panic and left launches_at_once_open_one_window with no window.
- Shorten the folder and socket names to cc-si-<pid>-<test>\t.sock (about 33 bytes).
- Skip a test with a note when no socket can be bound at its path, instead of panicking.
- Add a test that the test socket path stays within 40 bytes of %TEMP%.
Kept proxy records were written with the groups they were read with. The
DWG bridge brings them in the DWG's own version's layout, so a 2010
drawing saved as an R2000 DXF carried 161/162 groups that R2000 readers
reject (ODA, BricsCAD: Out of range), and a 2018 DXF carried 95 instead
of 71/97.
DXF output now rewrites each proxy's groups after its AcDbProxy subclass
marker into the target version's form: 95 or 71/97 for the drawing
format, 92/160 graphics size, 93/161 data size, 96/162 string stream
size (none before 2007). The DWG bridge is left as it was.
From 2007 a proxy keeps its strings in a separate stream (group 96, then
162). DXF before 2007 has no such group, so converting dropped the stream's
size while keeping its bytes, and readers took them as object data. Such a
proxy is now left out of an R2000 or R2004 DXF with its dictionary entry, as
proxies of unwritten classes are, and SAVEAS and document.bytes say so on the
command line and in notSaved.
loss_on_save now lists the proxies whose strings a DXF before 2007 can't hold,
so an interactive QSAVE asks before replacing the file; the warning points to
DXF 2007 and later when proxies are what would go. The proxy report test also
The pre-save hint checked for a .dxf extension, but a save picks the
format with Format::from_path, which treats a name without one as DXF.
Such a file got "DXF keeps them" instead of the version advice.
EXPORT writes a DXF at the drawing's own version too, so before 2007 it now reports
the proxies it leaves out (echo and notSaved), as a save does.
What a pre-2007 DXF loses is now counted by the writer itself
(cadcraft_io::proxies_lost, installed in the apps with set_proxies_lost): the
drawing is written as 2007 and as the target version and the two compared.
A proxy that no version writes (its class is not written, or no written block
holds it) is no longer reported with "save as 2007 or later", and the objects
that go with a dropped proxy (its extension dictionary and the XRECORDs in it)
are reported too. The DXF writer's finish returns the foreign objects it kept
for this.
The count reads the drawing the file is written from: the committed drawing
during a reference edit (the working copy is not counted again), the drawing
EXPORT writes while the Block Editor is open (for the SAT-text report too), and
the drawing -WBLOCK writes, which now reports a pre-2007 DXF's losses as well.
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]>
A layout read with a standard scale other than 1:1 (flags 176, group 75 = 25,
scale 0.02 for 1:50) lost plot layout flag 16 and its standard-scale choice on
save, because only scaled to fit and 1:1 counted as standard. The page now
keeps the file's group 75 with the scale it was read with; while the scale is
unchanged, saving writes that choice and keeps flag 16.
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]>
Every craft-libs git dependency and patch entry moves from be0b1e6552 to
craft-libs main at 453b0da782. Cargo.lock changes only the revision of
each craft-libs package.
Since main's craft-dwg cutover, cadcraft passes the drawing's original file
version to encode_kept_noted, which declares the bridge's R2000 text as that
version when it is newer. Kept constraint groups are in that version's form as
read, so for the bridge they stay as read; reordering them for R2000 put each
node's status where the newer reader doesn't look. A DXF of another version is
still reordered for its own version.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The DXF writer, which also feeds the DWG bridge, built the layout's plot
flags (AcDbPlotSettings group 70) from the bits CADCraft models and always
set 512 (plot paper space last) and 32 (plot with plot styles), plus 16
for a standard scale. A layout read with flags 0 came back as 560.
The page setup now keeps the flags as read; saving sets or clears only
the bits the page models (2, 4, 128, and 16 when the scale decides it).
Page setups made in CADCraft keep the old defaults.
crates/dwg is gone from main (the bridge is craft-dwg in storytold/craft-libs);
its part of this branch was #1725's, already in craft-dwg. sections.rs keeps
this PR's constraint_node_order after main's new finish() signature; the
dynblock_read test and io manifest are main's (#1725's test already landed).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every craft-libs git dependency moves from 3af2280ee3 to craft-libs main
at be0b1e655229e34f1ad263ef3d2170e46449c39b, which includes
storytold/craft-libs#1580: DWG fields from a drawing saved before DWG
2007 keep their format when it is saved as DWG 2007 or later.
Cargo.lock adds craft-dds, which craft-image-codecs now uses.
Moves the allow_in_process call below the local use items in ten tests, matching the order every other function body in these files uses. Behavior does not change.
Every craft-libs git dependency (Cargo.toml, its [patch.crates-io]
entries and apps/cadcraft-web/Cargo.toml) moves from eleven different
revisions to craft-libs main at 3af2280ee3434a2c860012df2f440652621c2c81.
Cargo.lock keeps one copy of each craft-libs crate and adds harfrust
0.13.3 and read-fonts 0.43.3, which craft-font-catalog now needs.
craft-dwg at this revision refuses to convert DWG when no worker process
is configured (storytold/craft-libs#1345). The app and the CLI configure
one at startup and are unaffected. The tests that read or write DWG in
their own process now call cadcraft_io::dwg_worker::allow_in_process(),
which cadcraft-io re-exports. dwg_worker.rs now checks that a worker
that cannot start is an error instead of a fallback to this process.
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.
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]>
Dimension Space, Dimension Style Override and Object Snap Tracking (with its
F11 variant) are also changed by #2580. Use one wording in both pull requests
so they merge in either order:
- Dimension Space: "Espacer les cotes" (menu labels keep the infinitive)
- Dimension Style Override: "Remplacement de style de cote"
- Object Snap Tracking: "Repérage d'accrochage aux objets", as #2102 already
uses for Object Snap Tracking Settings
Follow-up to the French catalog: harmonises rows already on main, without
touching the rows added by #2102.
- Command-line prompts use the imperative (Sélectionnez, Spécifiez, Entrez),
as the other prompts already did; menu and button labels keep the infinitive.
- A dimension object and its style are "cote" / "style de cote"; "Cotation"
stays for the Dimension menu and Quick Dimension.
- Model space is "espace objet", Array is "réseau", a layout is a
"présentation", tracking is "repérage" (object snap and polar).
Rebased on main after #2563: the prompts that lost their trailing "or" keep
the imperative wording on their new keys. The docs/localization-parity.md
row is left to the maintainers, as AGENTS.md asks.
Original wording written from CADCraft's English strings; no proprietary
localization resources were used.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01C4cGqxCFJD1m28x2aqwf7Q
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, 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.
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]>
main now draws, measures, picks and transforms OLE2FRAME records (#2587), which are Unknown
too. Keep that working next to the proxy graphics:
- select: `kept_as_read` leaves out every Unknown but an OLE2FRAME, for picks, windows, ALL,
Last, SELECT by handles and QSELECT;
- render and extents: one Unknown arm for a proxy's graphics and an OLE2FRAME's frame, in
`draw_unknown` and `unknown_bounds`, which also keeps both functions within the cognitive
complexity limit;
- new Unknown literals from main get `graphics: Vec::new()`.
The mirrored-objects test only had objects whose normal is 0,0,-1, so a
writer that flips the elevation and thickness of every object passed it.
It now reads the same nine objects with no normal and with 0,0,1 as
well: those keep +5 and +2 through a save, and their LINEs keep 39 = 2.0
with no 230.
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.
The report also covers data-store solids before 2013. The SAT text encoding
applies to every DXF before 2013, so say that in the comments.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
main's Properties palette tests (#2444) added a `painted_texts` helper next
to this PR's; this PR's helper, which also returns each text's top edge, is
now `painted_texts_at`. The layer list test checks that the combo above the
list shows "0" before comparing the list rows, instead of dropping repeated
names, so a missing "0" list row would fail it (CodeRabbit nitpick).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The test only checked that an `Other_App` record was there, so a second record for the same
application would have passed. It now asks for exactly one, and a second test has a line's xdata
name the application as `OTHER_APP` beside the registered `Other_App`: DXF and DWG, twice, keep
the xdata and one APPID record. With `add_appids` keyed by the name as written instead of
case-insensitively, that test fails (2 records).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H43qQA41CJLauqXnPgBQ7r
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.
The writer rebuilt the APPID table only from the applications whose xdata
the drawing still had, so every other registered application of the file
was dropped at each save. The reader now keeps the names of all of the
file's APPID records, and the writer adds them to the table with the ones
in use.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H43qQA41CJLauqXnPgBQ7r
The elevation and thickness flips are exact for a normal of 0,0,-1; a
tilted normal pointing partly down is flipped the same way, an
approximation. The comments now say so (CodeRabbit's note on #2905).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
Since #2665 the writer put groups 52, 41 and 77 (pattern angle, scale,
double flag) on solid fills too. AutoCAD 2024 writes none of them there
and refuses a DXF whose solid HATCH has any of them: "Error: expected
group code 98 / Invalid or incomplete DXF input -- drawing discarded".
So every DXF CADCraft saved with a solid or gradient hatch, including an
AutoCAD drawing passed through it, was discarded by AutoCAD. They are
written for pattern fills only again, as before #2665.
Measured in AutoCAD 2024: CADCraft's file with each of the three groups
dropped alone is still refused, with all three dropped it opens; with
this change AutoCAD opens CADCraft's solid, gradient and pattern hatches
and a 46-object drawing, DXF and DWG, with AUDIT reporting 0 errors.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reader keeps a mirrored object's normal (0,0,-1) but brings its points
into world coordinates; a polyline's or hatch's elevation stays along the
normal. The writer writes these objects with no normal, along +Z, so a
mirrored polyline or hatch at elevation 5 (world Z -5) came back at Z +5,
and a mirrored circle, arc, point, solid or text extruded up instead of
down. Their elevation and thickness are now written along +Z too: negated
when the normal points down Z. LINE writes its normal and keeps its
thickness as read.
Measured in AutoCAD 2024 (AutoCAD's objects, converted by CADCraft,
reopened in AutoCAD): every world point and thickness top now matches the
original.
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.
DXF before 2007 encodes SAT text (each character but a space is 159 minus it), so
an encoded 7.0 solid read as no version and a DWG before 2013 listed it as lost.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Trim read «حدود التشذيب» ("trim boundaries"), Stretch read «تمديد», the
same word as Extend, and Point read «تأشير», the word the catalog uses
for Dimension. Trim is now «تشذيب», and its two selection prompts match
it (they said «قص», which is also Cut). Stretch, its grip and vertex
items and its selection prompt use «مط». Point is «نقطة», as in Point
Style and Single Point. Written from the meaning of the English strings.
A 3DSOLID/REGION/BODY whose ACIS geometry is only in the data store (read from a
2013+ file) was written to DXF 2010 and earlier, and DWG 2004-2010, as an empty
2013-style record (290/2 groups, no SAT), silently: ZWCAD drops it from the DXF and
opens it as an empty body from the DWG. Such files have no data store, so the entity is
now left out there and the save says so (DXF note, notSaved, the save-loss question).
A DWG before 2013 was assumed to keep any SAT-text solid. ACIS 4.0 SAT (what ZWCAD
writes to DXF 2000) reaches the DWG through acadrust without usable geometry (ZWCAD
2025 opens it as a proxy), so it is now listed as not saved
(hakanaktt/acadrust#348).
Fixes#2334
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The palette's layer list and its current-layer combo showed layers in the order
they were made, so new layers piled up at the bottom. They now sort by name,
ignoring case, with the same key the Layer Properties Manager already uses.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- 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]>
Each polyline takes its hatch's elevation; a hatch outside the current space
is refused with a clear message; every selected hatch counts toward the
10,000-polyline limit, refused before anything is added.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A closed polyline around every boundary loop (outer and islands) of the
selected hatches, which stay as they are: an associative hatch keeps its own
boundary objects and is not linked to the new polylines. Runs at once on a
pickfirst selection, otherwise asks for objects; one undo step.
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]>
A proxy text takes the first style whose font file it names. The drawing's styles started with
CADCraft's Standard, which the file's Standard replaced in place, so a file listing ISO before
Standard (both on the same font) was saved with Standard first, and the reopened text took it.
Reading now keeps the STYLE table in the file's order as well. Test:
`a_proxy_text_keeps_its_style_after_a_save`.
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]>
Proxy graphics name layers and linetypes by their index in the file's tables, and saving writes
the proxy unchanged. The drawing's LAYER table started with CADCraft's 0 and Defpoints and took
the file's layers after them, so a file without Defpoints at index 1 was saved with its layers
shifted: reopened, the proxy's graphics went to Defpoints, which never plots. Reading now orders
the layer and linetype tables as the file lists them (ByBlock and ByLayer first), with what
CADCraft adds after them. The round-trip test checks that the reopened graphics stay on BALLOONS.
Last searches the store from the top down (`EntityStore::iter_rev`) and stops at the first
selectable object instead of scanning the whole space.
Last skipped only proxies, so with a proxy drawn last it could take an object on a layer turned
off or frozen before it. It now takes the last object a selection may take in
(`select::selectable`), at "Select objects" and in STRETCH. SELECT given handles outright leaves
proxies out as well; other named objects are kept as before. The test covers both.
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]>
A proxy's graphics are drawn, measured and snapped to, but no command can edit a proxy, and
saving writes its record as read: a MOVE that took it in left it behind, a COPY stacked a second
one on top. So no selection takes a proxy in: picks, windows, fences, polygons, ALL, Last,
SELECTALL, group members and QSELECT leave it out (`select::selectable`). A test moves a window
round a line and a proxy: the line moves, the proxy stays.
A circle centre or text point that a finite but huge pushed matrix moves past the largest float
is left out, as a polyline's points already were, so no infinity reaches the extents.
"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]>
Render settings store their AcDbRenderSettings class version in the
form of the file's version: a 2013+ file stores it one higher, and a
2013 file stores a rapid RT one one lower, as acadrust reads and writes
them. A kept RENDERSETTINGS, MENTALRAYRENDERSETTINGS or
RAPIDRTRENDERSETTINGS object carried the form of the file it was read
from into whatever file it was written to. The DWG bridge is an R2000
DXF for a 2018 DWG: a 2018 drawing's render settings went in with the
2018 form, the DWG writer raised it once more, and BricsCAD refused the
DWG for an object of class version 3 (#907, one of two causes; the
other is an empty constraint group written short, fixed in acadrust
0.6.6, hakanaktt/acadrust#146).
The form the kept objects are in is the $ACADVER the file declared,
recorded at read time in Foreign::acadver (the DWG bridge reads
through the DXF reader, so it is set there too). The drawing's own
$ACADVER is not used: SAVEAS changes it while the kept objects stay
as read, so a 2018 drawing saved as 2000 and then as 2018 wrote class
version 3 again. A file without $ACADVER records none, and its kept
objects are written as read.
Tests: the conversion is checked against acadrust itself (acadrust
writes the fixture in four versions, and CADCraft, reading any of them
and saving in any of them, stores what acadrust stores); SAVEAS 2000,
QSAVE, then SAVEAS 2018 through the engine; a file without $ACADVER.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
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]>
Unifont has no mark-to-mark positioning, so taking it ahead of GNU FreeSerif drew Thai and
Indic text with marks on top of each other; FreeSerif shapes those scripts properly.
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]>
An ACAD_PROXY_ENTITY carries the picture its application left for
programs without it (groups 92/160 and 310); AutoCAD draws it with
PROXYSHOW 1. CADCraft read these entities but drew nothing, so AutoCAD
Mechanical balloons, notes and the like were missing from screen, plots
and extents.
- doc: a decoder for the proxy graphics (ODA DWG specification, "Proxy
Entity Graphics") into read-only entities: circles, arcs, polylines,
filled polygons (solid hatch), TEXT/TEXT2 and their Unicode forms,
colour, layer, linetype, lineweight, ltscale, fill and model matrices.
Bounds-checked, with capped sizes and counts. TEXT2 draws the number
of characters its length field gives.
- io: Unknown gets `graphics`, filled for ACAD_PROXY_ENTITY while the
DXF (and so the DWG bridge) is read. The graphics index layers and
linetypes by the file's table order, which the reader keeps; CADCraft's
own tables are ordered differently. The raw tags are written back
unchanged.
- render, extents, prims: the graphics draw and measure like block
contents (layer 0 and ByBlock are the proxy's own), and can be picked.
osnap_all ranked paper-space snaps and snaps seen through viewports in
one list, so a farther Endpoint through a viewport could come before a
closer paper-space Nearest and take the click. The click's snap now
comes first as main picks it (a viewport's best replaces paper space's
only when it scores closer); the rest follow in Tab order.
Two snaps at one paper point from different viewports (overlapping
viewports showing different model points) are no longer merged: each
keeps its model point for DIST.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tab cycling offered the closest snap of each running mode: two endpoints
within the aperture, or a circle's tangent and perpendicular at the same
spot, could not both be reached. `snap::osnap_all` now returns every
object snap within the aperture, ranked as `osnap` picks: specific
snaps nearest first (Endpoint and Intersection favoured a little), then
deferred tangents and perpendiculars, then Nearest, without repeats;
`osnap` is its first entry, so the pick order is unchanged.
`pointmod::snap_candidates` cycles that list. Snaps seen through layout
viewports are included.
Split from #1582 as asked in review; the display settings (magnet,
aperture box, marker and tooltip switches) stay there.
Co-Authored-By: Claude Fable 5.1 <[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]>
Only walk_font_dirs uses it, and that function is not built on wasm32, where the
import was an unused-import warning.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AGENTS.md asks PRs not to edit the parity and gaps documents: the affected
rows are named in the PR description, and the maintainers update them in
batches. The two files are back to main's version.
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]>
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]>
A primary drag that moved the view is marked while it lasts; its release reaches no point prompt, also when Enter ended the transparent PAN or ZOOM mid-drag and handed the prompt back to the drawing command.
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]>
main's gate fails clippy -D warnings on the one Ui::id() call (#2113);
Ui::scope_id is its new name.
Co-Authored-By: Claude Opus 5.5 <[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]>
The length check couldn't see a rotation, and checking only after both modes
could miss one undone by the second.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A symlink back up the tree was read again at every hop until the kernel
gave up, about 40 hops; a large directory could use up the 20 000 entry
budget there before the other font directories were reached.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The cadcraft-dwg test builds its DXF with acadrust's writer; this one goes
through cadcraft_io::write (the bridge DXF, then acadrust) with a scale
action added to the synthetic Door fixture, and checks the DWG holds it
with its connections and reads back as the same action.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A kept 2D constraint group (ACDBASSOC2DCONSTRAINTGROUP) was written with its tags as read. From
AutoCAD 2013 on a node's status (70) comes after its connections, before that right after its id,
and acadrust reads it by the DXF's version. The DWG bridge's DXF declares R2000, so a 2013+
drawing's groups gave acadrust every node's status and connections from the wrong groups, and
AutoCAD refused the DWG ("Error Decrypting Data"), e.g. the dynamic blocks sample with
parametric blocks. The writer now puts each node's status where the written version has it; a
group whose nodes it can't all find is left as it is.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
0.6.6 keeps the scale action byte and the dimension flag mapping this branch
relies on, and writes only the active layout as *Paper_Space (others get
unique *Paper_SpaceN names; hakanaktt/acadrust#143), so ACadSharp opens a
DWG CADCraft saves with more than one layout.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AutoCAD's DWG scale action (BLOCKSCALEACTION) ends with one byte after its
three connections that DXF doesn't carry. acadrust 0.6.4 neither read nor
wrote it, so AutoCAD read past the object and refused every DWG CADCraft
wrote with a dynamic block that scales ("Error Decrypting Data"), even an
unchanged one. acadrust 0.6.5 keeps the byte (dwg_tail_byte).
0.6.5 also maps the dimension flags byte's bit 0 to text_user_positioned
both ways, so the bridge no longer inverts it (it would now double-invert);
it still sets bit 1, which acadrust keeps no DXF source for.
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]>
`installed()` consulted `installed_font_path` for every candidate even
when the file was already found at its absolute path, and that lookup's
first use walks every font directory on the machine; `install_fonts`
runs at start-up, so the walk happened just to open a file under
/usr/share/fonts that a few `fs::read` calls used to find. The absolute
candidates are now yielded first and the database is asked lazily, only
when a caller needs more than they hold.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
installed() handed its candidates to std::fs::read, the one uncapped
font read in theme.rs, while the CJK, Arabic, Korean and embedded faces
go through read_capped(path, MAX_UI_FONT_BYTES), so a system UI font
file of any size was read into memory. It now goes through read_capped
too; the first candidate that reads within the cap is still the one
used.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The tests in ttf/dirs.rs build configurations from POSIX paths such as
/usr/share/fonts, which Path::is_absolute rejects on Windows, so
`cargo test -p cadcraft-fonts` would fail there although the resolver
itself builds on every target and is only consulted on Linux and the
BSDs. The test module is gated on unix and says so; the non-test code is
unchanged.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The <dir> and <include> scanner split a start tag on whitespace and took
each token as a whole attribute, so legal XML such as
<dir prefix = "relative">extra-fonts</dir> or
<include prefix = "xdg">fontconfig/fonts.conf</include>, with spaces or
newlines around '=', was read as having no prefix: the relative directory
was dropped and the xdg include looked up under $FONTCONFIG_PATH instead
of $XDG_CONFIG_HOME. A start tag's attributes are now parsed as a name,
optional whitespace, '=', optional whitespace and a single- or
double-quoted value, in any order, within the same file, depth and
element bounds. Tests cover spaces and newlines around '=' on both
elements, attribute order, and malformed attributes.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Localization parity: drawing-text fallbacks and the system UI font now
work on NixOS, Guix and Flatpak. Gaps: P2 narrowed.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
install_fonts(), cjk_font(), arabic_font(), japanese_font() and
korean_font() named absolute /usr/share/fonts paths, so on NixOS, Guix and
in Flatpak sandboxes the interface kept egui's bundled font and a Chinese,
Japanese, Korean or Arabic interface showed boxes with the fonts installed
(#674). Each candidate list is now resolved through installed(): the
absolute paths first, unchanged for Debian, Arch and Fedora, then the same
file stems through the fonts crate's scan, which looks where fontconfig
does. No font names are added and nothing is bundled.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The missing-glyph search loads at most 24 files: the known wide-coverage
fonts first, then the rest alphabetically, which never reaches "u".
NixOS's default font set (DejaVu, FreeFont, TeX Gyre, Liberation, Unifont,
Noto Color Emoji) has Unifont as its only CJK-capable font, so even with
the fonts found Chinese text still drew boxes. Listed last, Unifont's
bitmap-like outlines serve only characters no listed font has.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
On Linux and the BSDs the font scan only walked /usr/share/fonts,
/usr/local/share/fonts, ~/.fonts and ~/.local/share/fonts. NixOS and Guix
keep every font package in its own store path and tell fontconfig about
them through <dir> entries (/etc/fonts/conf.d/00-nixos-cache.conf,
home-manager's ~/.config/fontconfig/conf.d) and $XDG_DATA_DIRS; a Flatpak
sandbox sees the host's fonts only under /run/host. On such systems the
scan found nothing, so CJK and Arabic characters in drawing text drew the
missing-glyph box although fonts with them were installed (#674).
A resolver in ttf/dirs.rs returns the directories fontconfig would use, in
priority order: $XDG_DATA_HOME/fonts and ~/.fonts, every $XDG_DATA_DIRS
entry + /fonts (plus /usr/share/fonts and /usr/local/share/fonts whether
listed or not), Flatpak's /run/host/{fonts,local-fonts,user-fonts}, then
the <dir> elements of $FONTCONFIG_FILE or /etc/fonts/fonts.conf, following
<include> files and conf.d directories with fontconfig's documented prefix
rules (~, xdg, relative). It is a pure function of injected env and file
lookups, so its tests run the same everywhere, and bounded in files,
nesting, bytes, elements and directories; a hand-written scanner reads the
two element names rather than adding an XML dependency to the fonts crate.
The scan canonicalizes the directories so a symlinked profile is not
walked twice, and keeps its entry cap. macOS and Windows are unchanged.
installed_font_path() exposes the scan's stem map, for the interface to
find its fonts by file stem.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The render `Options::on_screen` flag (off by default) applies the
LAYLOCKFADECTL fade; only the interactive canvas sets it, so plots and
SVG, PNG, PDF and CLI exports never fade objects on locked layers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Objects on a locked layer draw faded by LAYLOCKFADECTL percent (default 50;
0 or negative: no fade), whether or not transparency display is on. An object
keeps its own transparency when that is greater. Plots never fade. Layer 0
inside a block takes the reference's layer.
LAYLOCKFADECTL is a header variable (-90 to 90) available to GETVAR and SETVAR.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add the safe macOS event bridge adapted from #683 and six opening/quit regression tests. All six cargo xtask ci gates passed, with 2,014 tests, plus packaged LaunchServices smoke tests.
Co-authored-by: Isaac Levine <[email protected]>
Adapted from PR #683 to current main, retaining the existing accessibility dependency and async opening behavior. Validated together with the Apple-event module and regression tests.
Co-authored-by: Isaac Levine <[email protected]>
PAN (alias P, View > Pan > Realtime) is realtime: a left-button drag
moves the drawing with the cursor until Esc or Enter, and the session is
one Zoom Previous entry. -PAN takes a base point and a second point, or
a point then Enter as a displacement. The JSON form of pan is unchanged.
Fixes#1245.
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
601 changed files with 61943 additions and 4149 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).
@@ -19,7 +19,9 @@ Generated-in-code assets are original and have no file to list:
- the standard linetype and hatch-pattern libraries (`crates/doc/src/library.rs`; industry-common
names, our own dash/spacing values);
- the colour index palette, generated from its structure (`crates/color/src/lib.rs`);
- the sample drawings (`crates/engine/src/sample.rs`).
- the sample drawings (`crates/engine/src/sample.rs`);
- the synthetic two-hexagon hatch logo (`crates/io/tests/it/hatch_loop_flags.rs`, `logo`):
original contributor geometry, generated in code from invented points, under MIT OR Apache-2.0.
| Asset | Author | Source | Licence | Notes |
|---|---|---|---|---|
@@ -43,6 +45,12 @@ Generated-in-code assets are original and have no file to list:
| `assets/app-icon/cadcraft-256.png` | CADCraft contributors | generated | MIT OR Apache-2.0 | |
| `assets/app-icon/cadcraft-1024.png` | CADCraft contributors | generated | MIT OR Apache-2.0 | |
| `assets/app-icon/cadcraft-macos-512.png` | CADCraft contributors | generated (macOS margin variant) | MIT OR Apache-2.0 | |
| `assets/app-icon/README.md` | CADCraft contributors | original work for this repository | MIT OR Apache-2.0 | How each icon is generated and which mark each channel uses |
| `assets/app-icon/cadcraft-nightly.png` | CADCraft contributors | generated from `assets/app-icon/cadcraft-1024.png` | MIT OR Apache-2.0 | Nightly mark: same glyph, deeper background `#0c657b`; the Linux nightly tar's icon |
| `assets/app-icon/cadcraft-nightly-1024.png` | CADCraft contributors | generated from `assets/app-icon/cadcraft-1024.png` | MIT OR Apache-2.0 | 1024 master the nightly `.icns` is generated from |
| `assets/app-icon/cadcraft-nightly.ico` | CADCraft contributors | generated from `assets/app-icon/cadcraft-nightly-1024.png` | MIT OR Apache-2.0 | Windows nightly icon (16–256 px entries) for `build.rs` |
| `assets/app-icon/cadcraft-nightly.icns` | CADCraft contributors | generated from `assets/app-icon/cadcraft-nightly-1024.png` | MIT OR Apache-2.0 | macOS nightly bundle icon (`CFBundleIconFile cadcraft-nightly`) |
| `assets/app-icon/nightly-provenance.json` | CADCraft contributors | original work for this repository | MIT OR Apache-2.0 | The exact background transform that produced the nightly set |
| `packaging/macos/dmg/background.svg` | @XusBadia | original work for this repository (2026-10-08), "CADCraft macOS DMG window background"; derived from the CADCraft app icon (`assets/app-icon/`, referenced via `<image>`, not copied); text is outlined Inter / JetBrains Mono glyph paths (OFL fonts the project already uses); no third-party material modified | MIT OR Apache-2.0 (same as the code: `LICENSE-MIT`, `LICENSE-APACHE`) | Finder window background of the macOS DMG; `packaging/macos/dmg/generate.py` renders it to `background.tiff` (see `packaging/macos/dmg/README.md`) |
| `packaging/macos/dmg/background.tiff` | @XusBadia | Rendered from `packaging/macos/dmg/background.svg` by `packaging/macos/dmg/generate.py` | MIT OR Apache-2.0 (same as the code: `LICENSE-MIT`, `LICENSE-APACHE`) | 1x + 2x HiDPI TIFF for the macOS DMG window; includes the app icon (see its row) and LittleCMS's built-in sRGB profile ("No copyright, use freely") |
| `examples/apartment.dxf` | CADCraft contributors | sample drawing made with cadcraft-cli commands | MIT OR Apache-2.0 | Original |
@@ -70,7 +78,7 @@ Generated-in-code assets are original and have no file to list:
| `crates/ui-egui/src/i18n/bs.tsv` | Nine (@nine-codes) with Claude Code (AI-assisted) | Original Bosnian translations of CADCraft English strings, shared with storytold/craft-i18n `locales/bs/` | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied; not yet reviewed by a native speaker |
| `crates/ui-egui/src/i18n/cs.tsv` | @Losminek (AI-assisted) | Original Czech translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied |
| `crates/ui-egui/src/i18n/ru.tsv` | @pechnikov2026-star | Original Russian translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied |
| `crates/ui-egui/src/i18n/fr.tsv` | @pechnikov2026-star | Original French translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied |
| `crates/ui-egui/src/i18n/fr.tsv` | @pechnikov2026-star; terminology pass by @YannFR81 | Original French translations of CADCraft English strings; AI-assisted consistency pass (imperative prompts, cote/espace objet/réseau/présentation) | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied |
| `crates/ui-egui/src/i18n/zh.tsv` | @mayloglog | Original Simplified Chinese translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied |
| `crates/ui-egui/src/i18n/sv.tsv` | Erik Holmbom (@holmbom) with Claude Code (AI-assisted) | Original Swedish translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied; terminology and the running app reviewed by a native speaker |
| `crates/ui-egui/src/i18n/it.tsv` | Emanuele Bottelli (AI-assisted); terminology corrections: Andrea Brandi (@starise) with OpenAI Codex (AI-assisted) | Original Italian translations of CADCraft English strings | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | No proprietary localization resources copied; targeted Chamfer terminology review by a native speaker |
@@ -79,5 +87,41 @@ Generated-in-code assets are original and have no file to list:
| `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/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 for untitled
drawings; drawings with a file keep their 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 for untitled drawings; drawings with a file keep their 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-19 · **Change:** 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-11-25 · **Change:** 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
@@ -115,21 +115,23 @@ and the beta checklist are in [docs/roadmap.md](docs/roadmap.md).
- The open findings of the security audit (#1919–#1935): 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.
-Hostile-input fixes waiting in pull requests (#2820, #2821, #2765).
-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), 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 (#1596, then an automatic fallback renderer).
- It starts on common hardware: an automatic fallback renderer (`CADCRAFT_STENCIL=0` is the manual
switch since #3336).
- 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).
- Input feels like AutoCAD for Windows: clicks while the mouse moves (#1001, #2092), right-click and
Space as Enter (#1387), double-click to edit text (#842).
- The prompt options that still say "not available yet", and TRIM/EXTEND depth.
-Layouts print at scale on a system printer, and the menu bar and panels can always be restored
(#3216, #1240).
- 714 pull requests are open (2026-11-19). About 230 are mergeable, pass CI and are small; they are
- Input feels like AutoCAD for Windows: the fixes for clicks while the mouse moves, right-click and
Space as Enter, and double-click text editing landed (#3307, #3345); waiting for the reporters to
confirm, and table cells are left (#842).
-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.
- 602 pull requests are open (2026-11-25; 661 on 2026-11-20). 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.**
@@ -139,7 +141,11 @@ and the beta checklist are in [docs/roadmap.md](docs/roadmap.md).
but a file with 3D content must open safely (tier 1).
- Menu breadth against AutoCAD for Mac as a headline number.
Done since the last ranking: precision input (#379, #441, #60, #519), prompt options in TRIM/EXTEND,
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,
OFFSET, ROTATE, PLINE, SPLINE, MTEXT and MLEADER (#397, #408, #547), autosave, recovery, AUDIT and
RECOVER on the desktop (#406, #416), xrefs (#525), groups (#417), the Block Editor (#824, #833, #885),
REFEDIT (#818), XCLIP (#2354), dynamic block references (#838–#883), and the Dimension Style Manager
@@ -166,6 +172,8 @@ REFEDIT (#818), XCLIP (#2354), dynamic block references (#838–#883), and the D
| Date | Change | Summary |
|---|---|---|
| 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 |
| 2026-10-21 | trivial | Progress log: proxy objects keep their class through a save (#1812) |
/// 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.
"note":"The stable 1024 master, padded as its designer made it; the nightly files are derived from it, never upscaled from a smaller icon."
},
"transform":{
"summary":"The app mark (near-black strokes, cream highlights and their antialiasing) is copied unchanged; only the background square is deepened.",
"background":{
"from":"#14a3c7",
"to":"#0c657b",
"rule":"A pixel whose channel distance from the stable background is at most 180 is scaled by 0.62; fully transparent pixels and every other colour are left as they were."
}
},
"outputs":{
"cadcraft-nightly.png":"256 px PNG of the icon the Linux tar carries as cadcraft-nightly.png",
"cadcraft-nightly-1024.png":"the padded 1024 master the icns is generated from",
"cadcraft-nightly.ico":"16, 24, 32, 48, 64, 128 and 256 px PNG entries, the Windows executable and window icon",
"cadcraft-nightly.icns":"icp4 icp5 icp6 ic07 ic08 ic09 ic10 PNG entries for the macOS bundle (CFBundleIconFile cadcraft-nightly)"
},
"not_done_here":"No badge, crescent or N was added, and the stable cadcraft.png/.ico/.icns files are untouched."
.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("{name (a block, or \"*Model_Space\" for a drawing that is a dynamic block's own)} → {parameters, actions, other} | null (not a dynamic block)")
.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("{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)}")
.ok_or_else(||other("Degree must be a whole number from 1 to 10."))?;
self.degree=Some(dasusize);
}
self.asking_degree=false;
@@ -340,7 +342,7 @@ impl Interactive for SplineCvM {
s.add_entity(EntityKind::Spline(sp))?;
returnOk(Step::Done);
}
_=>s.echo(format!("{k}: use SPLINE for fit points.")),
_=>returnErr(other("Invalid option keyword.")),
}
Ok(Step::Continue)
}
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.