Track H's foundation, landed on main before its three groups branch. - engineering/understand/snapshot.py: one bulk read of a drawing into frozen WCS records (OCS translated through backends/ocs.py, text decoded, an INSERT boxed by its block geometry without its attribute texts). A DXF is read with ezdxf after the size check; the headless engine's document is read under its own lock; the live engine exports the active document with Document.Export(<tmp>/snap, "DXF", <set of all>) - never renamed, deleted afterwards - and a DWG is opened read-only, exported and closed. Measured on AutoCAD 2026: ".dxf" is refused with Invalid argument, the file lands as snap.DXF, model space, paper space and unused block definitions all reach it, and the selection set does not narrow a DXF export. - engineering/understand/labels.py: %%c, \U+2205, the U+2300 sign, o-stroke and MTEXT format runs all read as one diameter spelling; sizes are kept as drawn and never equated; Cyrillic look-alike capitals fold into Latin tags; panels, wiring callouts and electrical data (kW, phases, volts, N, VFD) in EN / TR / RU / NL / DE. A power that is not written stays None. - engineering/understand/vocab.py: layer classification with a confidence and the deciding keyword, supply / return words, room labels and block kinds in five languages. A CIP layer without a direction word is not guessed. - MAX_DXF_BYTES defaults to 512 MB (a real layout was 188 MB); the refusal names the size and the variable. New `office` extra (openpyxl), also in `full`; uv.lock regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd
58 lines
1.3 KiB
Python
58 lines
1.3 KiB
Python
"""Understanding drawings somebody else made (v1.6 track H).
|
|
|
|
One bulk read per drawing (:mod:`.snapshot`), multilingual vocabulary
|
|
(:mod:`.vocab`) and label parsers (:mod:`.labels`) are the foundation; the
|
|
readers built on them - the one-call report, the scale check, the line
|
|
networks and takeoffs, the diff and the topology checks - add their modules
|
|
here. Everything except the snapshot's live export is pure: records in,
|
|
results out, the drawing never modified.
|
|
"""
|
|
|
|
from engineering.understand.labels import (
|
|
normalize_panel,
|
|
parse_diameters,
|
|
parse_electrical,
|
|
parse_tag,
|
|
plain,
|
|
wiring_target,
|
|
)
|
|
from engineering.understand.snapshot import (
|
|
EntityRecord,
|
|
Pt,
|
|
Snapshot,
|
|
length_of,
|
|
read_snapshot,
|
|
records_from_doc,
|
|
take_snapshot,
|
|
)
|
|
from engineering.understand.vocab import (
|
|
DISCIPLINES,
|
|
SERVICES,
|
|
classify_layer,
|
|
equipment_kind,
|
|
room_label,
|
|
supply_return,
|
|
)
|
|
|
|
__all__ = [
|
|
"DISCIPLINES",
|
|
"SERVICES",
|
|
"EntityRecord",
|
|
"Pt",
|
|
"Snapshot",
|
|
"classify_layer",
|
|
"equipment_kind",
|
|
"length_of",
|
|
"normalize_panel",
|
|
"parse_diameters",
|
|
"parse_electrical",
|
|
"parse_tag",
|
|
"plain",
|
|
"read_snapshot",
|
|
"records_from_doc",
|
|
"room_label",
|
|
"supply_return",
|
|
"take_snapshot",
|
|
"wiring_target",
|
|
]
|