# Datum Zone Audit Report — Missing Entities in Simplified DXF

**Date:** 2026-05-20
**Auditor:** Claude (project-auditor)
**Scope:** Compare full DXF vs simplified DXF near datum (A1 zone: 200K-230K x 95K-135K)

---

## Summary

The simplified DXF (104,176 entities) has good coverage of the main machine block (83,466 entities) but is missing several categories of geometry:

---

## Missing Entity Types

| Entity Type | In Full DXF | In Simplified | Status |
|-------------|-------------|---------------|--------|
| LINE | 55,478 (block) + 1,013 (direct) | 72,225 | PRESENT (includes other blocks) |
| ARC | 11,374 + 410 | 15,929 | PRESENT |
| LWPOLYLINE | 11,996 + 57 | 12,245 | PRESENT |
| CIRCLE | 4,296 + 57 | 5,136 | PRESENT |
| ELLIPSE | 250 | 300 | PRESENT |
| **SPLINE** | **58** | **0** | **MISSING** |
| **MTEXT** | **6 (block) + 53 (direct)** | **0** | **MISSING** |
| **HATCH** | **2** | **0** | **MISSING** |
| **DIMENSION** | **254 (direct)** | **0** | **MISSING** |
| **SOLID** | **1** | **0** | **MISSING** |
| **ATTDEF** | **6** | **0** | **MISSING** |

### Impact:
- **SPLINE (58):** Machine outline curves that aren't arcs — these are visible contour lines
- **DIMENSION (254):** All measurement annotations the user explicitly requested
- **MTEXT (59):** Multi-line text labels on machines
- **HATCH (2):** Fill patterns (minor)
- **SOLID (1):** Filled triangles for arrows (minor)

---

## Missing INSERT Blocks (Nesting Depth > 1)

7 INSERT blocks near datum have nesting depth 2-3. If the exec script only walks 1 level, sub-entities from deeper levels are lost:

| Block | Position | Depth | Primitives |
|-------|----------|-------|------------|
| A$C367f2d82 | (229178, 112659) | 3 | 1,809 |
| A$C3ec7f63e | (226289, 119555) | 3 | 1,789 |
| A$684852481581 | (224136, 116758) | 3 | 255 |
| MECHATis 20250527102129 | (217643, 124651) | 2 | 294 |
| MECHATis 20250527102129 | (217643, 113678) | 2 | 294 |
| SSH-20240222.17482 | (225767, 123660) | 2 | 303 |
| SSH-20240222.17482 | (225746, 114681) | 2 | 303 |

**Total potentially missing from shallow walk:** ~5,047 primitives

---

## Root Causes

1. **Entity type whitelist too narrow:** The script writes LINE, ARC, CIRCLE, LWPOLYLINE, ELLIPSE, TEXT — but skips SPLINE, MTEXT, DIMENSION, HATCH, SOLID, ATTDEF
2. **DIMENSION entities explicitly excluded:** Despite user requesting them, DIMENSION type may still be in an exclusion list or not handled by the copy logic
3. **INSERT nesting walk may be shallow:** Blocks with depth 3 (e.g., A$C367f2d82 with 1,809 primitives) need full recursive walking

---

## Required Fixes

1. **Add SPLINE support:** Copy SPLINE entities with all control points and knots. ezdxf can read/write SPLINE entities directly.
2. **Add DIMENSION support:** Copy DIMENSION entities. These are complex (defpoint, text position, style) — may need to use `virtual_entities()` to explode into LINE+TEXT primitives if direct copy fails.
3. **Add MTEXT support:** Copy MTEXT entities (multi-line text with formatting).
4. **Add HATCH, SOLID, ATTDEF support:** Minor but complete the coverage.
5. **Ensure full recursive INSERT walking:** Walk to depth 10+ for all INSERT blocks, not just 1-2 levels.

---

## Verification Protocol

After regeneration, exec must produce this comparison:

```
For each entity type in the full DXF (within motor zone):
  - Count in full DXF (direct + all block levels)
  - Count in simplified DXF
  - Delta (should be 0 or positive for each type)
```

Any negative delta = missing geometry = must investigate.
