Skip to content

Feat/ai quantities measure - #5

Merged
chieund merged 14 commits into
masterfrom
feat/ai-quantities-measure
Nov 25, 2026
Merged

chieund merged 14 commits into
masterfrom
feat/ai-quantities-measure

Conversation

@chieund

@chieund chieund commented Nov 25, 2026

Copy link
Copy Markdown
Owner

No description provided.

chieund and others added 14 commits November 12, 2026 10:23
1.3.1 skipped TCVN3 decoding for R2007+ files as already Unicode. Text in
a .VnTime font still holds TCVN3 values there, and every DWG is converted
to an R2007 DXF, so Vietnamese notes came out as raw codes. Decode them
again, leave text that is already Unicode Vietnamese alone, and bump the
cache format so drawings cached by 1.3.1 are parsed again.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Counts and extents do not move when text is decoded wrongly, which is how
1.3.1 lost TCVN3 Vietnamese with the corpus matching. Record a hash of all
texts per drawing and report a change as a regression.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Checked against all 26 corpus drawings. Differences from 0.7.14, all read
as fixes: MTEXT keeps the space at a chunk boundary, a viewport's frozen
layers are reported so four annotations no longer show at the wrong
scale, fewer replacement characters in one drawing. Pinned exactly: the
package ships a release every few days. Cache format bumped because the
converter output changed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
dwg_quantities gives an agent the takeoff the Quantities panel shows:
blocks with counts and ids, per-layer length, area and hatch area, by
page, narrowed by block name, layer or region, with attribute values of
the matching blocks. The takeoff computation moves to src/shared so the
webview and the tools share it.

dwg_measure measures geometry where no dimension is drawn: an object's
size, the clear gap between two objects or points, the length and area
of a traced path, and the closed shapes around a point.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- The Unicode-Vietnamese guard applies to Unicode files only: in a
  windows-1258 file a TCVN3 byte reads as a Vietnamese letter and the
  guard left such text raw.
- A hatch around a point measures with the same even-odd rule as the
  Quantities panel, over all its loops.
- The gap between a small and a huge set keeps the small one whole.
- dwg_measure: ids are deduplicated, an object without bounds gets a
  plain error. dwg_quantities: attribute values are capped, anonymous
  blocks sort last, layer and block names are folded once per name.
- The measuring module reuses polygonArea and pathLength from src/dxf.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The lib/ and dist/ folders are never loaded; 0.8.8 doubled them with
source maps. 381 files become 14.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…irst

- Colours too close to the canvas (dark red, navy, black) are lightened
  until they stand out, keeping their hue; applied once when a drawing
  arrives so the canvas, the layer list and exports agree.
- Measure: click two points for the distance and its two legs, in the
  panel's unit. Clicks lock onto corners of visible linework.
- Ask AI on the toolbar opens Connect AI Agents, which was reachable only
  from the Command Palette.
- AutoCAD's own layers (names starting with *) list after the drafter's.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A whole MTEXT used to be left raw as soon as any letter in it was Unicode
Vietnamese. AutoCAD sets a Unicode letter the TCVN3 font lacks in a font
of its own, so headings like B{\fTimes;ƯỚC} 4: Thi c«ng stayed half
raw. Each font span is now judged on its own letters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two windows that both judged a crashed window's lock stale could each
delete it, the second deleting the first one's fresh lock, and both then
create a token. The lock now carries an id; a stale lock is moved aside
and restored if it turns out to be live, and a window removes only its
own lock. The test checks windows agree; the race itself did not show
in a single process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both read remote MCP servers from a JSON file in the home folder
(~/.cursor/mcp.json, ~/.kiro/settings/mcp.json) as url + headers.
Connect adds dwg-previewer there and keeps everything else; a file that
is not plain JSON is refused, never rewritten. A connected file is kept
up to date when the port or token changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clicks add corners; from three on the closed shape is shaded and its
area, perimeter and path length are shown in the panel's unit.
Backspace removes the last corner, Esc starts over and then leaves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dxf-parser drops ACAD_TABLE, MULTILEADER and LEADER, so schedules and
callouts vanished and the banner named them as unsupported.

- A table is drawn from its anonymous *T block at the table's insertion
  point; its cell texts are listed to dwg_find_text under the table.
- A multileader is drawn from its CONTEXT_DATA: leader lines, landing,
  dogleg, closed filled arrowheads and the note text, which its object
  carries so it can be found.
- A leader is a polyline; its arrow is DIMASZ x DIMSCALE of its dimension
  style, and none when the style is unknown or the leader has no arrow.
- Annotation lines are drawn but never added to a layer's length.

Corpus: +490 entities in each blocks_and_tables drawing, more in the
architectural and AEC samples and in the private set; nothing lost.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chieund
chieund merged commit eea1656 into master Nov 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant