Files
HHY 8cd3442508 fix: v2.17 3D 建模对齐样板图——门/纱扇/多扇语义修复
- kind 判定收敛: 仅 Slide=推拉; DoubleSash/DoubleKfcSash=对开门按平开(修门渲染成窗)
- 纱扇 Screen 同格不再单独渲染(消除 179 处双层玻璃叠放)
- 同格多扇沿宽度等分(forceRect): 31337 对开两扇对半+isDoor 合并, 31729 上排 6 滑扇等分
- 2D 图纸补纱扇网格纹理(官方画法)
- 验证: 31337/31729 3D 与官方图结构一致, validate3d 0 无效, ui-shots 6 页无报错
2026-09-23 11:23:18 -07:00

39 lines
1.8 KiB
JavaScript

// 门类 3D 建模验证: 切换样板 31337(对开门) 截图关/开: node verify-door.mjs <token>
import puppeteer from 'puppeteer-core'
const token = process.argv[2]
const sleep = ms => new Promise(r => setTimeout(r, ms))
const browser = await puppeteer.launch({
executablePath: 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe', 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 sleep(1500)
// 打开样板下拉并选择 31337
await page.click('.el-select__wrapper, .el-select')
await sleep(600)
const items = await page.$$('.el-select-dropdown__item')
for (const it of items) {
const txt = await it.evaluate(el => el.textContent.trim())
if (txt.includes('31337')) { await it.click(); break }
}
await sleep(2200)
const cv = await (await page.$('.threed-wrap canvas')).boundingBox()
await page.screenshot({ path: 'D:/Code/huamenchuang/shots/door-31337-closed.png', clip: cv })
// 拖滑杆到 55%
const handle = await page.$('.ctrl .el-slider__button')
const hr = await handle.boundingBox()
await page.mouse.move(hr.x + hr.width / 2, hr.y + hr.height / 2)
await page.mouse.down()
const rr = await (await page.$('.ctrl .el-slider__runway')).boundingBox()
for (let i = 1; i <= 10; i++) {
await page.mouse.move(rr.x + rr.width * 0.55, hr.y + hr.height / 2, { steps: 1 })
await sleep(40)
}
await page.mouse.up()
await sleep(1400)
await page.screenshot({ path: 'D:/Code/huamenchuang/shots/door-31337-open.png', clip: cv })
console.log('✓ 31337 对开门 3D 截图完成')
await browser.close()