detect_sheet_frames: wildcard axis-layer defaults (prefixed-layer institutes)

13号地块 prefixes every layer (A_DOTE/A_AXIS/A_WALL); the exact-token
axis defaults silently zeroed grid-correlation votes for all 44 frames.
Defaults now *AXIS*/*DOTE*; rowframe fixture gains a layer_prefix="A_"
variant asserting the grid still votes (no WEAK).

Logged open item: the tower sheets still vote 0 after the pattern fix —
axis stubs vs full-span grid lines or clip-window semantics, to debug next
round; plus the plot-13 storey table and the finding that per-floor
multi-clip stitching already works via repeated floor keys.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 21:36:01 +08:00
parent d1ea460042
commit 12ddc9488d
3 changed files with 47 additions and 7 deletions

View File

@@ -68,6 +68,23 @@
建筑为"整套建施一文件"形态(平面+立面混排,28-49 标题),配电房/门卫
是 2 框小体量。
10. **图层前缀习惯(A_DOTE/A_AXIS)令轴网匹配静默归零**(13号):检测器
默认 axis-layers 是精确 token(AXIS/DOTE),该院所有图层带 `A_` 前缀
→ votes 全 0 落 clip 角点兜底。修复:默认 pattern 加通配
(`*AXIS*,*DOTE*`),回归用例 rowframe 加 layer_prefix="A_" 变体。
**未决(下一轮)**:13号 塔楼修正后仍 0 票(仅 y=1)——A_AXIS 745 条
存在但不进投票,疑似轴号短引线(非跨图长线)或 wall-bbox 精修 clip
裁掉轴线区,需检查 segments_in 的窗口语义;当前 44 框全靠 clip 角点
兜底,标准层间 offset 有 9m 级差异,须按 DoD 用叠图逐层核验后才可建模。
13号 一号楼已完成的判读(供下一轮直接使用):办公 A/B 双塔 + 3 层裙房;
层高表(平面文件标高直方图 + "地上10层"说明):F1=0/6.0、F2=6.0/6.0、
F3=12.0/4.2、F4~F10=16.2 起步 4.2m 步进(标准层一框两翼,用重复 key 多
clip 合并——**该能力已存在**:floor_specs 为列表、buckets 按 key 聚合,
重复 key 自动并段,缺口 2 的"多 clip 拼接"实为文档缺失)、PH/RF=45.6、
机房顶 49.8、女儿墙 51.8、B1=-5.95、B2=-9.65;夹层框(F1M/F2M/B1M)与
分区地下框首版跳过;地下体量建议统一由 A-03 地库图集出,避免双份几何。
(待续)
3. **消毒步骤误删 XRECORD 的 999 数值行**(发现于苏州博物馆/test3d-8 首跑):

View File

@@ -88,7 +88,9 @@ def parse_args() -> argparse.Namespace:
help="Plan-frame title pattern; e.g. '(?i)(FLOOR )?PLAN$' for English sets")
parser.add_argument("--title-exclude-regex", default=r"(示意|疏散|分区|索引|定位|总平面|放大|详图|布置|大样)")
parser.add_argument("--title-exclude-layers", default="*图签*,*PUB_TAB*,*TK*,*图框*,*目录*")
parser.add_argument("--axis-layers", default="AXIS,DOTE,*轴线*,*轴网*,S-GRID,*GRID*",
# Wildcards matter: design institutes prefix layers (13号地块: A_DOTE/A_AXIS),
# and an exact "DOTE" token silently zeroes the grid-correlation votes.
parser.add_argument("--axis-layers", default="*AXIS*,*DOTE*,*轴线*,*轴网*,S-GRID,*GRID*",
help="TArch t3 exports draw plan grids on DOTE; AXIS often only holds detail-sheet stubs")
parser.add_argument("--wall-layers", default="WALL,*WALL*,*墙*")
parser.add_argument("--refine-fallback-layers",

View File

@@ -181,10 +181,16 @@ def make_blockgrid_dxf(path: Path) -> None:
doc.saveas(path)
def make_rowframe_dxf(path: Path) -> None:
"""Row layout (3#辅房 pattern): frames side by side, pitch on X, titles same row."""
def make_rowframe_dxf(path: Path, layer_prefix: str = "") -> None:
"""Row layout (3#辅房 pattern): frames side by side, pitch on X, titles same row.
layer_prefix simulates design institutes that prefix every layer
(13号地块: A_WALL/A_DOTE) — exact-token axis patterns then miss the grid.
"""
doc = ezdxf.new("R2010", setup=True)
for layer in ("WALL", "DOTE", "PUB_TEXT"):
wall_layer = f"{layer_prefix}WALL"
grid_layer = f"{layer_prefix}DOTE"
for layer in (wall_layer, grid_layer, "PUB_TEXT"):
doc.layers.add(layer)
msp = doc.modelspace()
pitch = 21000.0
@@ -196,13 +202,13 @@ def make_rowframe_dxf(path: Path) -> None:
interior += [((4000, 0), (4000, 16000)), ((2000, 4000), (6000, 4000)),
((2000, 12000), (6000, 12000))]
for (sx, sy), (ex, ey) in outline + interior:
msp.add_line((sx + ox, sy), (ex + ox, ey), dxfattribs={"layer": "WALL"})
msp.add_line((sx + ox, sy), (ex + ox, ey), dxfattribs={"layer": wall_layer})
for i in range(3):
x = i * 4000
msp.add_line((x + ox, -2500), (x + ox, 18500), dxfattribs={"layer": "DOTE"})
msp.add_line((x + ox, -2500), (x + ox, 18500), dxfattribs={"layer": grid_layer})
for j in range(4):
y = j * 5000
msp.add_line((-2500 + ox, y), (10500 + ox, y), dxfattribs={"layer": "DOTE"})
msp.add_line((-2500 + ox, y), (10500 + ox, y), dxfattribs={"layer": grid_layer})
msp.add_text(title, height=700, dxfattribs={"layer": "PUB_TEXT"}).set_placement((2500 + ox, -5200))
draw_frame(0.0, "一层平面图")
@@ -396,6 +402,21 @@ def main() -> int:
ok_row = "F2" in row_off and abs(row_off["F2"][0] + 21000.0) <= 120 and abs(row_off["F2"][1]) <= 120
check("row layout: x-pitch offset recovered", ok_row, str(row_off))
# prefixed layers (13号地块: A_WALL/A_DOTE) must still grid-align
make_rowframe_dxf(row_dir / "rowframes_prefixed.dxf", layer_prefix="A_")
proc = run([
sys.executable, "scripts/detect_sheet_frames.py",
"--dxf", str(row_dir / "rowframes_prefixed.dxf"), "--out-config", str(WORK / "frames_pref.json"),
"--out-report", str(WORK / "frames_pref.md"), "--vendor-dir", str(VENDOR),
])
check("detect handles prefixed layers", proc.returncode == 0, proc.stderr[-400:])
if proc.returncode == 0:
frames_pref = json.loads((WORK / "frames_pref.json").read_text(encoding="utf-8"))
pref_off = {f["key"]: f["offset"] for f in frames_pref["drawings"][0]["floors"]}
pref_md = (WORK / "frames_pref.md").read_text(encoding="utf-8")
ok_pref = "F2" in pref_off and abs(pref_off["F2"][0] + 21000.0) <= 120 and "WEAK" not in pref_md
check("prefixed A_DOTE grid still votes", ok_pref, f"{pref_off} weak={'WEAK' in pref_md}")
# --- merge_wall_solids: shapely union of wall segments (spec_to_glb) ---
sys.path.insert(0, str(ROOT / "scripts"))
import spec_to_glb # noqa: E402