固定热端熔融区剖面视角并保留工艺动画
This commit is contained in:
parent
bac023c047
commit
a44559dcda
@ -27,7 +27,7 @@ try {
|
||||
await page.goto(url);
|
||||
await page.waitForSelector("#loading[hidden]", {
|
||||
state: "attached",
|
||||
timeout: 60000,
|
||||
timeout: 180000,
|
||||
});
|
||||
await page.locator('[data-technology="thermal"]').click();
|
||||
const signal = () =>
|
||||
@ -49,6 +49,19 @@ try {
|
||||
report.changedPixels = after.filter((v, i) => v !== before[i]).length;
|
||||
assert.ok(report.changedPixels > 50);
|
||||
assert.notEqual((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();
|
||||
await page.mouse.move(sceneBounds.x + sceneBounds.width / 2, sceneBounds.y + sceneBounds.height / 2);
|
||||
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.ok((await signal()).travel > start.travel);
|
||||
report.fixedSectionCamera = true;
|
||||
await page.screenshot({ path: "artifacts/thermal-animation.png" });
|
||||
await page.locator("#fan-target").fill("0");
|
||||
await page.waitForTimeout(300);
|
||||
|
||||
@ -169,6 +169,11 @@ 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";
|
||||
@ -178,11 +183,11 @@ export class MonitorScene extends PrintScene {
|
||||
if (mode === "nozzle") {
|
||||
this.nozzleScene.focus();
|
||||
} else if (mode === "thermal") {
|
||||
const direction = new THREE.Vector3(25, 55, 125);
|
||||
const direction = new THREE.Vector3(0, 28, 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");
|
||||
}
|
||||
@ -196,7 +201,6 @@ 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;
|
||||
}
|
||||
|
||||
@ -237,6 +237,8 @@ export class ThermalScene {
|
||||
});
|
||||
this.filament.position.y = 52 + Math.sin(this.time * 5) * 0.7;
|
||||
this.host.container.dataset.thermal = JSON.stringify({
|
||||
cameraPosition: this.host.camera.position.toArray(),
|
||||
cameraQuaternion: this.host.camera.quaternion.toArray(),
|
||||
fanAngle: this.fan.rotation.z,
|
||||
travel: this.travel,
|
||||
power: signal.power,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user