1012 Commits
Author SHA1 Message Date
FredApps 8698649da1 Merge main into stack/e6
Conflict: crates/engine/tests/it/main.rs (both new test modules kept: legacy_sysvars and lisp_answer_by_frames).
2026-12-03 06:25:12 +01:00
FredApps 4610454c58 Merge pull request #3766 from storytold/stack/e5
Land 19 reviewed PRs (stack e5)
2026-12-03 06:21:36 +01:00
FredApps a6add77c5a Drop #3580 from this landing
Reverts the Merge #3580 commit (0d70d25f, first parent) and the landing fix that moved its
tests into tests/it (4ecd4aed). #3580 is not ready (changes still requested on 9bbe7b69) and lands
on its own. #3601, #3497 and #3503 stay.
2026-12-03 05:45:02 +01:00
FredApps e90f00dcf3 Merge pull request #3351 from storytold/stack/s11
Land #2825, #2347, #2350, #2103, #3164: PER, TAN and Center from anywhere on the object, Tab through every snap, CIRCLE tangents, viewport-frozen layers
2026-12-03 05:43:29 +01:00
FredApps 4f0abbefdf Merge main into stack/e5
Conflicts: crates/engine/src/session/cmdline.rs (lisp_answer keeps main's 3D point Z handling),
crates/ui-egui/src/i18n.rs (Hebrew registered next to Dutch and pt-PT; the legacy iw tag still
selects he through the new region-aware locale matching), crates/ui-egui/src/options.rs and
docs/localization.md (both language lists).
2026-12-03 05:31:06 +01:00
FredApps 7afe6b3b78 Merge origin/main into stack/s11: snaps keep main's Z sources through this branch's ranking
main's snap Z (#1511) records what each candidate lies on; collect_in, finish and finish_all
now carry those sources, so the hit chosen (or each Tab candidate) takes its object's Z:
gathered and intersection points from the gather, perpendiculars and tangents from the base
from their object, centers, deferred snaps and Nearest from their curve.
2026-12-03 05:15:35 +01:00
FredApps 616a7c0b52 Merge pull request #1243 from marcoarnulfo/fix/trim-fillet-chamfer-xline-ray
TRIM, FILLET and CHAMFER on rays and xlines: a finite piece becomes a line, an unbounded one a ray
2026-12-03 05:15:20 +01:00
FredApps 17e0c81967 Center snap test: the viewport takes main's new fields (UCS, extra data) from their defaults 2026-12-03 05:01:04 +01:00
FredAppsandyohanesyuen 1ba557615e Merge main into the ray and xline editing fix
The TRIM, EXTEND, FILLET and CHAMFER changes for rays and xlines now live in
the split modules (cmd/modify/trim.rs, cmd/modify/fillet.rs,
cmd/modify2/trimext.rs, cmd/trimextend.rs). The tests move to the integration
suite (tests/it) and the parity rows are carried over.

Based on the conflict resolution and the added tests in
marcoarnulfo/cadcraft#1 by yohanesyuen.

Co-authored-by: yohanesyuen <[email protected]>
2026-12-03 05:00:42 +01:00
FredApps 27b3e8727d Merge pull request #1511 from aldozar/feat/snap-z
Object snaps give points their Z; LINE and POINT keep it (OSNAPZ)
2026-12-03 04:47:17 +01:00
FredApps d049a1cf7f Merge remote-tracking branch 'origin/main' into s11
# Conflicts:
#	crates/engine/src/cmd/layout/tests.rs
2026-12-03 10:43:41 +07:00
midasmatterhorn adac927d7d Merge main into fix/properties-set-hatch-data-loss 2026-12-03 04:35:48 +03:00
Tanish Manku 60ac9ac001 Merge #3748 2026-12-02 14:47:12 -07:00
Tanish Manku bc6277da45 Merge #3749 2026-12-02 14:47:12 -07:00
Tanish Manku 96c348ff8e Merge #3750 2026-12-02 14:47:12 -07:00
Tanish Manku 336126a95c Merge #3757 2026-12-02 14:47:11 -07:00
Tanish Manku 2d351ff5a7 Merge #3726 2026-12-02 14:47:11 -07:00
Tanish Manku ce7b234161 Merge #3738 2026-12-02 14:47:05 -07:00
Tanish Manku 51ea12b976 Merge #3263 2026-12-02 14:47:03 -07:00
Tanish Manku c09ab353f0 Merge #3669 2026-12-02 14:47:02 -07:00
Tanish Manku 4ecd4aed42 Landing fix: #3580's tests join each crate's tests/it binary (rule 30) 2026-12-02 14:19:42 -07:00
Tanish Manku 636dd26f07 Merge #3503 2026-12-02 14:19:34 -07:00
Tanish Manku 0d70d25f07 Merge #3580 2026-12-02 14:19:23 -07:00
Tanish Manku 15c8926c97 Merge #3497 2026-12-02 14:19:16 -07:00
V1dalTheAbidal bc37092d35 A dragged window, an array edit and a named object come after an expression typed at a prompt (#3666) 2026-12-02 14:22:17 +02:00
FredApps 46ebd11c11 fix(ci): give each plotter test its own device name (#3758)
The in-memory plotter store is shared by the whole test process. On
FreeBSD the tests run as threads of one process (cargo test), so the
three tests that each create a "Banner Printer" collide and the later
one fails with "plotter `Banner Printer` already exists". Each test now
creates a device with its own name.
2026-12-02 11:54:15 +01:00
V1dalTheAbidal 0c18fdd8f8 What takes a command's place comes after an expression typed at its prompt (#3666) 2026-12-02 12:30:43 +02:00
V1dalTheAbidal 9ddc83e676 A new LEADER or QLEADER takes the drawing's dimension overrides, as a new dimension does (#3721) 2026-12-02 11:49:41 +02:00
FredApps 9bbe7b69a3 Merge remote-tracking branch 'origin/main' into yan-3580 2026-12-02 08:59:06 +01:00
2ez4gcxandClaude Opus 5.5 8e4bf3cd9f Window selection holds text by what it draws, turned or not (#3731)
A window or window polygon tested a TEXT, ATTDEF or MTEXT by the
document's box for it, an estimate from its number of characters (and
lines). On the side a justification or attachment point leaves open,
that box reaches past what the fonts draw, so a window that held all of
a text, turned or not, could miss it: a right-justified label turned by
90 degrees hung its box below the window's bottom edge.

A window still takes an object whose box it holds. A text whose box it
doesn't hold but reaches into is now also taken when the window holds
the strokes the text draws, placed as the renderer places them
(annotative scale, upright text, ATTDEF tag, mirrored and slanted text).
A window polygon does the same. Only text along the selection's edge is
shaped, so selection costs what it did. Crossing windows and polygons,
fences and picks are unchanged.

Fixes #3731.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-02 14:05:55 +07:00
FredApps 0a43052c1f Merge main and keep both dimension text visibility checks 2026-12-02 05:45:27 +01:00
code-compliant 15c3c9564a Answer two review findings: continue text with a usable height, name annotative rows
Enter at TEXT's start point does not continue with a height that neither the last text nor TEXTSIZE can give. An annotative style's row says so in its accessible name, which starts with the visible style name. The Escape test for another window now fails if any control of the dialog takes the focus.
2026-12-02 10:37:25 +08:00
V1dalTheAbidal ed7b601123 A leader's DSTYLE list is found after a loose name string, removed in one pass and refused as raw xdata (#3721) 2026-12-02 03:35:35 +02:00
FredApps f288082ff3 Merge main into ACADVER fix, keeping shared test registration 2026-12-02 02:35:24 +01:00
V1dalTheAbidal fb07eaab7e An expression typed at a prompt keeps its own value and its command's undo step (#3666)
A routine that ended in a later frame left its value behind, and the next
expression the frames carried on handed it to the prompt as its own: a
routine now starts with no value. A snapped click that came while the
frames worked out a point lent that point its viewport origin: the
expression's value now answers its prompt before the click's origin is in
place. The command an expression was typed in, when Esc or a failed
expression ended it, recorded what it had drawn in the expression's
routine, which dropped it: such a command keeps its own undo step, with
frames and without.
2026-12-02 02:26:07 +02:00
V1dalTheAbidal 865285ca46 getangle and getorient read text given as an input as the prompt reads it typed (#3398)
A string in inputs went straight to the angle parser, so empty text and
coordinates were refused and the call took the next input. Empty or blank
text is now Enter (initget bit 1 still decides), and coordinates are a
point in the current UCS in every form the prompt takes (1,1, @1,1, 1<45,
*1,1), the relative ones from the last point. Numbers, unit-bearing text
and keywords are read as before.
2026-12-02 02:25:58 +02:00
code-compliantandClaude Fable 5.2 5f751ee30d AutoLISP: entnext reaches an INSERT's ATTRIBs and SEQEND (#1660) (#3396)
* AutoLISP: entnext reaches an INSERT's ATTRIBs and SEQEND (#1660)

- lisp: name an INSERT's ATTRIB and SEQEND records; entnext walks them, then the next main
  entity, and entget lists a record with its owner in group -2 (#1660)
- lisp: entmod of an ATTRIB takes its value (group 1) only, as one undo step; another property,
  a SEQEND, entdel and entmake of one return nil and change nothing (#1660)
- doc: the handles LISP named, shared with the drawing's snapshots and never given out by
  new_handle; 65,536 names, 1,024 probes past taken handles (#1660)
- io: entity_sub_record, one record of an INSERT at a time, never its other records (#1660)
- engine: an optional host hook for that record, so EntityCodec is unchanged (#1660)
- cli, web, app: install the hook; CLI tests for the walk, the value edit, the name bounds and
  the refusals (#1660)
- docs: autolisp.md on the records, their names, when a name ends, and the value-only edit (#1660)
- reused from #1753 (closed), with thanks: the entity_list extraction with the -2 owner, the
  writer's record splitting, and the entnext_walks_an_inserts_attribs test skeleton

* Keep AutoLISP's attribute names within their drawing

- Hold an INSERT's attribute names in the session's LISP state, not in
  cadcraft_doc::Drawing: comparing drawings is plain data again and takes no
  lock. The session reserves the handles in the drawing before any change, so
  new_handle still never gives one out, also after a drawing swap.
- End the names when the Block Editor closes: its drawing starts from the
  host's handles, so a name given there must never resolve to a host record.
- End only the erased reference's names on ERASE. Erasing another object
  leaves an attribute name holding, and OOPS still revives none.
- Go on to the next entity when an INSERT has no record provider installed.
- Refuse an ATTRIB edit whose outer list ends in an atom.

* Keep issued attribute names out of the drawing.

A copied drawing could reuse a name, and storing the names in the drawing marked a saved drawing changed.

* Name an INSERT's ATTRIBs and SEQEND apart from drawing handles

An ATTRIB or SEQEND has no handle of its own in the drawing, so the
name AutoLISP gives it is now a value of its own (an entity name for
`type`), numbered from one count for the whole process that never
gives a number twice. No handle of any drawing, of a copy of one, of
another session or of another thread can be such a name, so nothing
is reserved in the handle space any more: cadcraft-doc, `new_handle`
and the copy-then-install paths are as on main, and naming or reading
a record changes neither the drawing nor its saved state.

What a name stands for (reference, place, tag) stays in the engine's
LISP state, by document. Names end on Undo, Redo, ATTSYNC,
-BLOCKREPLACE, on opening and closing the Block Editor, and when a
change is taken back; erasing a reference ends only its names, and
OOPS or `entdel` bringing it back revives none. `entupd` of a record
answers its name; selection sets and `command` take no record.

Tests cover other sessions, documents and threads giving out handles
in a drawing copy, the copy paths (INSERT from a file, XATTACH, AUDIT,
REFCLOSE), and the AutoLISP behaviour of the names.

* Keep one ATTDEF index per state of a block's entities

EntityStore gets a content token: a clone has its store's, and every
edit gives the store one that no store has had. The DXF writer keys
its ATTDEF index on that token and keeps the indexes of several
blocks, up to a fixed number of tags in all. Two copies edited apart,
or a different edit after Undo, never read each other's definition
properties, in AutoLISP reads or in a saved file, and reads that
alternate between references of different blocks examine each
definition once.

* End record names when a command puts an earlier drawing back.

MOCORO Undo restored its history drawing, handle seed included, so the next Copy could reuse the removed reference's handle. That restore now advances the name epoch. An ATTDEF index that would pass the tag budget is not stored.

* Match an oversized ATTDEF definition in full and remember it is too large to index

* Count record names with try_update, not the deprecated fetch_update

Rust 1.100 deprecates fetch_update and names try_update in its place, so
clippy with -D warnings stopped the gate at RecordName::fresh. It is the
same operation: the checked increment and the None once the count runs
out are unchanged. try_update compiles on Rust 1.95, the workspace's
minimum.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Record tests check the objects they rely on

Five tests could pass without the state they are about.

The two ATTDEF index tests changed only a layer, so both states of the
block gave T the same handle, and an index kept for the wrong state
still read the right layer. One state now keeps T on the first ATTDEF
and the other passes T to the second, on another layer. With one index
shared by every store, the old tests passed and these fail.

The MOCORO and grip Copy tests did not check that a copy was made, or
that the copy after the Undo took the removed copy's handle. They now
check both, and that the name read the first copy before the Undo.

The walk at the top of the handle range compared two values that are
both nil when the line at FFFFFFFFFFFFFFFF is not in the drawing. It
now reads that line first.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Test that entdel preserves unrelated ATTRIB names

* Fix AutoLISP record lifetime and REFEDIT edits

* Run attribute name cases in engine integration suite

* Fix text fixtures after main merge

---------

Co-authored-by: Claude Fable 5.2 <[email protected]>
2026-12-02 00:34:42 +01:00
kc8a 6cf44e32ff trim/extend: ignore the live Shift for script and LISP input 2026-12-01 21:21:35 +00:00
V1dalTheAbidal c6402fa9a5 Esc stops an AutoLISP expression typed at a prompt (#3666)
An expression typed at a command's prompt ran to its end inside one call
on the interface thread, so no frame was drawn and Esc was not read until
it was over. In the window it now runs a slice per frame, as a routine at
Command: does, and Esc stops it. Every other input first waits for its
value, as before. Hosts without frames (the CLI, MCP, scripts) are
unchanged.
2026-12-01 21:20:19 +02:00
V1dalTheAbidal 9e8b027f7b A LEADER reads, draws and writes its dimension style overrides (#3721)
A leader's overrides of its dimension style (the DSTYLE list in its ACAD
xdata) were kept as raw xdata and not used, so an overridden arrow size,
scale, arrowhead or line colour did not show. They are now read into the
leader, used when it is drawn, and written back as one DSTYLE list; the
rest of the leader's ACAD xdata is kept as before.
2026-12-01 20:09:30 +02:00
FredApps 0f7940a986 test: count attribute tag matching work instead of timing it (#3723) 2026-12-01 17:37:27 +01:00
code-compliant 13aa3a5cc6 test(acadver): move the ACADVER tests into the engine's shared integration binary
The five cases move from tests/acadver.rs to tests/it/acadver.rs unchanged, apart from the I/O
setup: the save case installs the suite's real file hooks (refedit_xref::hooks) in place of its
own copy, and uses a folder under Cargo's temporary directory for integration tests.
2026-12-01 23:47:22 +08:00
code-compliant 3fe6d7e954 test(sysvars): make the TEXTEVAL session check able to fail; put the $ names note on its list 2026-12-01 23:47:07 +08:00
V1dalTheAbidal 8028efba49 getangle and getorient return radians for answers given as inputs (#3398)
An answer given up front to the lisp command (inputs) was handed to
getangle and getorient as their value, so 45 came back as 45. They now
read such an answer as the same answer at their prompt: a number or text
in the angular units, a point as a picked point, null as Enter. Answers
typed at the prompt already came back in radians.
2026-12-01 17:29:46 +02:00
Aldo ZarateandClaude Opus 5.5 04dc8bc2b0 Merge upstream/main into feat/snap-z
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 09:07:42 -06:00
moandClaude Opus 5.5 b837e9c1e4 LISP: textbox (part of #3676)
`(textbox elist)` returns the smallest box around a TEXT as the renderer shapes it, relative to
the insertion point and unrotated: the drawn glyphs' box, so its first corner is the insertion
point unless letters reach below the baseline. Groups the list leaves out take the current
text style, its height (or TEXTSIZE), width factor and obliquing. A list that is not a TEXT
gives nil.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-12-01 12:36:53 +00:00
code-compliant 20e2efebf7 fix(sysvars): refuse text from programs and routines, read unknown DIMASSOC as off, save REGENMODE
DIMASO, TEXTEVAL and REGENMODE now take only a number from a program or a routine: numeric text
and booleans are refused. Digits typed at the SETVAR prompt, by hand or through (command), still
work.

DIMASO reads 1 only for DIMASSOC 1 or 2. For any other stored mode it reads 0, and DIMASO 1 turns
associativity on from it too.

A new drawing now has REGENMODE 1 in its header, so a save writes $REGENMODE.
2026-12-01 20:32:12 +08:00
code-compliant a193f64e04 style(tests): keep the module list in order after the merge 2026-12-01 20:32:11 +08:00
a79b9feca9 feat(doc,io,render): support MTEXT background mask (DXF 90/63/421/45) (#3240)
* feat(mtext): support MTEXT background mask (DXF 90/63/421/45) in doc, io, and render

* fix(mtext): write background mask before column tags and use Autodesk border offset factor

* fix(render): resolve ByLayer/ByBlock for MTEXT background mask and guard non-finite rotation

* fix(render/mtext): cover overflowing glyphs, MLeader text opt, and attrib ByBlock bg

* fix(io/dxf): omit inactive MTEXT background mask conditional tags

* Fix MTEXT background test for current Text fields

Signed-off-by: FredApps <[email protected]>

---------

Signed-off-by: FredApps <[email protected]>
Co-authored-by: vantruong-dang <[email protected]>
Co-authored-by: FredApps <[email protected]>
2026-12-01 12:50:47 +01:00
b778851b48 Viewports keep their own UCS and their other settings through save and copy (part of #1316) (#1484)
* Viewports keep their own UCS and their other settings through save and copy (part of #1316)

A layout viewport's own UCS and every setting CADCraft doesn't model
were dropped on read, so saving a sheet set lost them for good.

- Viewport::ucs (origin, X/Y axes, elevation, orthographic type, named
  and base UCS by name) and ucs_per_viewport (UCSVP), read from and
  written as VIEWPORT groups 110-112, 146, 79, 345/346 and 71.
- Viewport::extra: the viewport's other groups as read (snap, grid,
  lens and clipping, render mode, plot style sheet, shade plot, visual
  style, background, lighting). They belong to the entity, so COPY and
  MIRROR carry them; dxf_raw::finish writes them before the xdata and
  points their references at what they named (ForeignExtra::tail).
- Not carried raw: the view twist, direction and target (51, 16, 17),
  which say where the view centre is measured from; writing them back
  while the centre is in drawing coordinates would move the view.
- DWG: the bridge drops 345/346, the plot style sheet, shade plot and
  lighting groups, so CADCraft xdata keeps a copy (VPUCS, VPEXTRA) that
  the reader falls back on. The visual style, background and shade plot
  references are still lost through DWG (file-format-parity.md).
- A UCS with unreadable or zero-length axes is no UCS; a named UCS
  that's no longer in the table isn't pointed at.

Tests: another program's viewport read; DXF save and reread; two DWG
round trips; a copied viewport; a deleted named UCS; a viewport without
a UCS written as before; hostile groups (5000 extras, NaN axes, bad
handles); COPY and MIRROR through the engine.

* Viewports: VPEXTRA keeps only a viewport's own groups; a base UCS handle alone is kept

- CADCraft's VPEXTRA xdata copy of a viewport's unmodelled groups is
  merged only for groups that can stand inside the AcDbViewport subclass:
  a record start (0), handles (5, 105), a subclass (100), a group brace
  (102) or xdata (1000 on) from a crafted file are dropped, so a save
  can't write records or handles the user didn't draw.
- A VIEWPORT whose only UCS group is its base UCS handle (346) now reads a
  UCS, so the base UCS is resolved and written back.

* Viewports: drop structural groups from a record's own extras; index UCS names for the xdata fallback

- A VIEWPORT's own AcDbViewport groups are kept raw only when they can
  stand in the subclass, as CADCraft's VPEXTRA copy already was: a second
  handle (5, 105) or a group brace (102) written back would give the
  record two handles. The record's own pointer groups stay, to be
  remapped with it.
- The named and base UCS that CADCraft's xdata names are looked up in a
  case-insensitive index built once with the UCS table, not by scanning
  every UCS for each viewport.

* Parity checklist: regenerated after merging main

* Parity checklist: regenerated after merging main

* Parity checklist: regenerated after merging main

* xtask: take main's stats.rs (the merge kept a test import Linux clippy rejects)

* Viewport tests built on main set the UCS fields

* WIP row 74: Codex's test edits kept; production normalisation (identity UCS -> None, default-valued extras dropped in dxf_read viewport_ucs/viewport_extra) still to do

* Viewports: a default viewport reads back with no UCS or extra groups (#1484)

A DWG save writes an identity UCS and the default snap, grid, lens, clip,
render and shade groups for every viewport, so a viewport nobody gave a UCS
came back with one and a dozen extras. The DXF reader now reads an unnamed
identity UCS (UCSVP 0) as none, and keeps a group in extra only when it
differs from the defaults, listed in one table. Tests: a_default_viewport_reads_back_without_ucs_or_extras,
a_viewport_with_non_default_snap_keeps_it; layouts_and_paperspace passes.

* Viewports: clippy range patterns; raster_image test builds with the viewport's UCS fields

* Tests: move the viewport UCS suites into the it entry points (#1316)

viewport_ucs_roundtrip.rs and viewport_ucs_copy.rs were separate test
binaries; AGENTS section 30 wants the existing entry points. All 12 DXF/DWG
persistence tests and the COPY/MIRROR tests are kept.

* Tests: move the viewport UCS suites into the it entry points (#1316)

viewport_ucs_roundtrip.rs and viewport_ucs_copy.rs were separate test
binaries; AGENTS section 30 wants the existing entry points. All 12 DXF/DWG
persistence tests and the COPY/MIRROR tests are kept.

---------

Signed-off-by: FredApps <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: SBaksa <[email protected]>
Co-authored-by: FredApps <[email protected]>
2026-12-01 12:16:30 +01:00