From e1eb07ac4cba6a0197cf2cf700dd4ba59cd82275 Mon Sep 17 00:00:00 2001 From: xuans Date: Fri, 18 Sep 2026 22:41:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E7=83=AD=E7=AB=AF=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E8=A7=86=E8=A7=92=E6=93=8D=E4=BD=9C=E5=B9=B6=E4=BB=85?= =?UTF-8?q?=E5=81=9C=E6=AD=A2=E5=9C=86=E5=BD=A2=E9=83=A8=E4=BB=B6=E8=87=AA?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/verify-thermal.js | 11 ++++++----- src/views/Monitor/Scene.js | 10 +++------- src/views/Monitor/ThermalScene.js | 1 - 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/scripts/verify-thermal.js b/scripts/verify-thermal.js index 59a3464..78c2c21 100644 --- a/scripts/verify-thermal.js +++ b/scripts/verify-thermal.js @@ -48,7 +48,7 @@ try { const after = await pixels(); report.changedPixels = after.filter((v, i) => v !== before[i]).length; assert.ok(report.changedPixels > 50); - assert.notEqual((await signal()).fanAngle, start.fanAngle); + assert.equal((await signal()).fanAngle, start.fanAngle); assert.deepEqual((await signal()).cameraPosition, start.cameraPosition); assert.deepEqual((await signal()).cameraQuaternion, start.cameraQuaternion); const sceneBounds = await page.locator('#scene').boundingBox(); @@ -56,12 +56,13 @@ try { await page.mouse.down(); await page.mouse.move(sceneBounds.x + sceneBounds.width / 2 + 100, sceneBounds.y + sceneBounds.height / 2 + 60, { steps: 12 }); await page.mouse.up(); - await page.mouse.wheel(0, 300); await page.waitForTimeout(500); - assert.deepEqual((await signal()).cameraPosition, start.cameraPosition); - assert.deepEqual((await signal()).cameraQuaternion, start.cameraQuaternion); + assert.notDeepEqual((await signal()).cameraPosition, start.cameraPosition); + assert.notDeepEqual((await signal()).cameraQuaternion, start.cameraQuaternion); + assert.equal((await signal()).fanAngle, start.fanAngle); assert.ok((await signal()).travel > start.travel); - report.fixedSectionCamera = true; + report.fixedComponentRotation = true; + report.interactiveCamera = true; await page.screenshot({ path: "artifacts/thermal-animation.png" }); await page.locator("#fan-target").fill("0"); await page.waitForTimeout(300); diff --git a/src/views/Monitor/Scene.js b/src/views/Monitor/Scene.js index 8dfef23..f25194e 100644 --- a/src/views/Monitor/Scene.js +++ b/src/views/Monitor/Scene.js @@ -169,11 +169,6 @@ export class MonitorScene extends PrintScene { } setTechnology(mode) { - this.controls.autoRotate = false; - this.controls.enableDamping = false; - this.controls.update(); - this.controls.enableDamping = true; - this.controls.enabled = mode !== 'thermal'; this.mode = mode; this.releaseGroup.visible = mode === "nozzle"; this.nozzleScene.overlay.hidden = mode !== "nozzle"; @@ -183,11 +178,11 @@ export class MonitorScene extends PrintScene { if (mode === "nozzle") { this.nozzleScene.focus(); } else if (mode === "thermal") { - const direction = new THREE.Vector3(0, 28, 125); + const direction = new THREE.Vector3(25, 55, 125); direction.multiplyScalar(1 / Math.min(1, this.camera.aspect)); if (this.camera.aspect < 1) direction.multiplyScalar(1.25); + this.camera.position.copy(direction); this.controls.target.set(-9, 27, 0); - this.camera.position.copy(this.controls.target).add(direction); this.controls.update(); } else this.setView("perspective"); } @@ -201,6 +196,7 @@ export class MonitorScene extends PrintScene { this.workflow.group.visible = false; this.thermalScene.update(options.thermalSignal); this.controls.autoRotate = false; + this.controls.update(); this.renderer.render(this.scene, this.camera); return; } diff --git a/src/views/Monitor/ThermalScene.js b/src/views/Monitor/ThermalScene.js index 28c65eb..f110609 100644 --- a/src/views/Monitor/ThermalScene.js +++ b/src/views/Monitor/ThermalScene.js @@ -182,7 +182,6 @@ export class ThermalScene { if (!signal.paused) { this.time += delta; this.travel += (delta * 14 * signal.feed) / 100; - this.fan.rotation.z -= (delta * 16 * signal.fan) / 100; } const hot = THREE.MathUtils.clamp((signal.nozzle - 25) / 240, 0, 1); this.heater.material.color.setRGB(