fix(com): hatch islands on a live seat — typed edges become temporary entities

hatch_add_boundary was refused on COM (hatch_edge_paths), so a transverse
section of any hollow part — a bushing, a flange bore — could not be drawn in
AutoCAD at all: draw_prims asked the capability map and refused up front.

ActiveX takes a loop as whole objects, which is not the same as "cannot take a
typed edge": each edge now becomes a real temporary LINE, true ARC or ELLIPSE
in the hatch's own space, appended with AppendInnerLoop, evaluated and
deleted. A loop that is only chained lines becomes one closed polyline — one
COM call instead of 180 for a flattened bore. The edge list is validated in
full first with the headless engine's messages; a loop AutoCAD refuses is
taken back out with its temporaries.

Measured on AutoCAD 2026 (25.1s), in scratch documents closed unsaved:
- a two-arc island leaves exactly 10000 - 100*pi (9685.8407) of a 100 x 100 hatch;
- the OD40/ID20 sleeve's transverse section B-B, drawn through the view engine
  and draw_prims, hatches 942.2864 mm2 — the engine's declared 180-gon;
- an open chain is refused (E_FAIL) and the entity count is unchanged.

hatch_edge_paths is now supported on both engines.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd
This commit is contained in:
Umut CAN
2026-09-23 13:51:35 +03:00
co-authored by Claude Opus 5.5
parent e6f685643d
commit 2bba18d0f7
6 changed files with 368 additions and 18 deletions
+15
View File
@@ -183,6 +183,21 @@ model and one view engine instead of a zoo of per-part generators, a new
### Fixed
- **Hatch islands on a live seat.** `hatch_add_boundary` was refused on COM
(`hatch_edge_paths`), so a transverse section of any hollow part - a
bushing, a flange bore - could not be drawn in AutoCAD. Each typed edge now
becomes a temporary LINE, true ARC or ELLIPSE appended with
`AppendInnerLoop` and deleted after `Evaluate`; a chain of lines is one
polyline. Measured on AutoCAD 2026: a two-arc island leaves exactly
10000 - 100*pi of a 100 x 100 hatch, the OD40/ID20 sleeve's section B-B hatches
942.2864 mm2 (the view engine's declared 180-gon), and an open loop is
refused with nothing left behind.
- **`block_find_references` found nothing on a live seat.** ActiveX names a
block reference `AcDbBlockReference`, so `entity_list(type_filter="INSERT")`
matched nothing. The COM type filter now lets the DXF name find it (`INSERT`,
`LWPOLYLINE`, and every `*DIMENSION` class for `DIMENSION`); the reported type
is unchanged.
- **Found by the tracks B + G evidence** (each with a test that fails on the
old code):
- `dimension_diameter` put its text beyond the *second* chord point