- Blender discovery adds the Windows versioned install dir (Program Files/
Blender Foundation/Blender */blender.exe); ODA adds Program Files/ODA
(both still env > PATH first; shutil.which resolves .exe via PATHEXT)
- README cross-platform section: pathlib + explicit UTF-8 I/O + bytes-decoded
subprocesses throughout; Windows advice (PYTHONUTF8=1, LongPathsEnabled,
ODA as the primary DWG path since libredwg is rare there)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mechanical pattern tools WILL miss new dialects; these gates are
ledger/cross-evidence INVARIANTS that hold for conventions never seen:
- frame_ledger (audit --frames <detect out-config>): every detected plan
frame must be used by the config or listed in discarded_frames with a
reason — silently ignored frames are where wings vanish
- area_declared (config declared_areas_m2): model footprint area vs
经济技术指标表 within ±15% — 1#B lost half the building and only the
site plan exposed it
- storey_count (config expected_storeys_above_ground): above-ground F<n>
count vs 总图 labels / elevation ladder
- unknown_layer_dialect (read report): plan file with no *WALL*/*墙* layer
= unfamiliar institute convention, map layers consciously
All three gates SKIP when unarmed (zero impact on existing projects);
regression suite +8 checks, all green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- detect_sheet_frames: auxiliary-titled frames (非机动坡道/无障碍改造…) never
become the alignment reference; wall-profile correlation fallback when a
frame has no axis geometry (coverage+peak-ratio gated); bogus x-pitch from
stray same-row titles distrusted (pitch_x < 0.7*pitch_y); plan titles inside
cached-xref blocks scanned too
- cad_dxf_report: cached_xref_content warning (msp INSERT stubs + in-file
block cache -> expand_blocks ≈ bind, not a re-export ask)
- derive_showcase_spec: floor_order gaps warn loudly in both directions
- assemble_campus: per-building rotation_deg overrides the global one
- SKILL.md updated; regression suite +14 checks (auxref/nogrid/mixedrow/
blocktitle/cachedxref/floor_order/rotation scenarios)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Conversion/encoding chain (libredwg on Chinese TArch DWGs):
- run_dwg2dxf: capture bytes, decode leniently (GBK console output crashed
the batch under subprocess text=True)
- sanitize_dxf_comments: byte-level, code/value pair walk — the UTF-8
errors="ignore" round-trip mangled every GBK CJK string ("一层平面图"
-> "一平图") and eating XRECORD "999" VALUE lines corrupted files
- read_doc: recover fallback also on ValueError; scrub_surrogates keeps one
corrupt drawing from killing the whole report
- decode_mif in report + frame detector: \M+5XXXX escapes (whole 黄桥 set)
restored so plan-title detection works at all
- ODA auto-fallback: reconvert DWGs whose libredwg DXF fails inspection or
reads an empty modelspace (黄桥 plans: 0 entities via dwg2dxf, 21k via
ODA); env ODA_CONVERTER override, fake-converter regression test
Frame detection:
- detect_sheet_frames expands INSERTs (memoized, depth<=3) when collecting
axis/wall lines — 黄桥 wraps each frame's grid in anonymous A$C... blocks
(msp had 8 DOTE lines, blocks held 700); all 7 frames went from WEAK
clip-corner fallback to grid-aligned votes x=14
Extraction judgment rules (both loud, both default-on, both switchable):
- drop_isolated_clusters: tiny segment clusters far from the main mass are
sheet-legend content drawn on real layers (title-block window symbols made
every floor's footprint grow a sliver fin)
- drop_unsupported_roof_lines: roof outlines with no footprint/cap plate
within 2m beneath are hatch-only-support canopies that extrude into
floating ribbons (F3 SW 坡屋面, B1 ground canopy at -5.85m)
Tests: 64 -> 75 checks, incl. GBK/MIF synthetic DXFs, block-wrapped grid
alignment (non-uniform bays — uniform grids make subset correlation
ambiguous), legend-cluster and unsupported-roof fixtures.
references/generalization_test_log.md tracks the test protocol, per-project
gate table, and every gap with its regression coverage.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Agent-led CAD-drawing → 3D web showcase pipeline. Inspects CAD reports,
maps layers/floors, extracts a normalized building spec (with block-probed
glazing and audit gates), builds Blender/trimesh GLB variants, and assembles
a Three.js web viewer. Includes XREF-shell detection and a regression test.
Large inputs/outputs (work/, outputs/, source_cad/, renders) are gitignored.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>