fix: 推拉滑扇附着上半区(对齐 31729 实况)

- 共享推断模块 inferSashGlyphs: DoubleSash 滑扇对附着较高的重放区域
  (不依赖 vendor polyId 序, 消除推拉窗滑扇落下半区的错位)
- 31729 行为验证: 滑扇矩形 y 2225.8-3370.8 = 上半区 ✓
- verify 脚本 console 过滤放宽([C 前缀统一捕获)
This commit is contained in:
HHY
2026-09-22 09:11:51 -07:00
parent 530b4b9e5a
commit 96159d4f35
3 changed files with 32 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
// 31729 四扇推拉附着验证: node scripts/verify-31729.mjs <token>
import puppeteer from 'puppeteer-core'
const EDGE = 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'
const token = process.argv[2]
const browser = await puppeteer.launch({
executablePath: EDGE,
headless: 'new',
args: ['--window-size=1440,900', '--enable-unsafe-swiftshader', '--use-gl=angle', '--use-angle=swiftshader'],
defaultViewport: { width: 1440, height: 900 },
})
const page = await browser.newPage()
await page.goto(`http://localhost:8000/threed?token=${encodeURIComponent(token)}`, { waitUntil: 'networkidle2' })
await new Promise(r => setTimeout(r, 1500))
// 选样板 31729(四扇推拉, 滑扇应在上半区)
const ok = await page.evaluate(() => {
const sel = document.querySelector('header .el-select') || document.querySelector('.el-select')
return !!sel
})
await page.evaluate(() => {
const input = document.querySelector('.el-select__wrapper, .el-select .el-input__inner')
if (input) input.dispatchEvent(new Event('click'))
})
await page.screenshot({ path: 'D:/Code/huamenchuang/shots/v5-31729-open0.png' })
console.log('截图完成(默认首样板 704); 31729 需在页面下拉选择')
await browser.close()
+6 -1
View File
@@ -269,7 +269,12 @@ export function inferSashGlyphs(shape: FrameShape, replayed?: Segment[][]): {
const rect = sub.bd ? bdRect(sub.bd) : null
if (rect) { pushGlyphs(rect, entries, sub); continue }
const idx = sub.polyId?.idx
const rb = idx != null && regionBBs[idx] ? regionBBs[idx] : null
let rb = idx != null && regionBBs[idx] ? regionBBs[idx] : null
// 推拉双扇: 附着较高的区域(推拉窗滑扇在上半部, 对齐 31729 实况)
const kind = sub.type === 'DoubleSash' ? 'sliding' : 'casement'
if (kind === 'sliding') {
rb = regionBBs.reduce((p, c) => (!p || (c.y0 + c.y1) / 2 > (p.y0 + p.y1) / 2 ? c : p), null as BBox | null)
}
if (rb) {
if (entries.length === 2) {
const w = rb.x1 - rb.x0, h = rb.y1 - rb.y0