From 74fe2c4179e33754f767a1730ea2d654ebde6ae9 Mon Sep 17 00:00:00 2001 From: Maxim Dolgolyov Date: Tue, 14 Apr 2026 14:02:22 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B4=D1=83=D0=B3=D0=B8=20=D0=BE=D1=81=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B9=20=D0=BA=D0=BE=D0=BD=D1=83?= =?UTF-8?q?=D1=81=D0=B0/=D1=86=D0=B8=D0=BB=D0=B8=D0=BD=D0=B4=D1=80=D0=B0?= =?UTF-8?q?=20=D0=B2=20=5Fedges=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B8=20=D1=82=D0=BE=D1=87?= =?UTF-8?q?=D0=B5=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/js/labs/stereo.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/frontend/js/labs/stereo.js b/frontend/js/labs/stereo.js index 20d9585..b495f0d 100644 --- a/frontend/js/labs/stereo.js +++ b/frontend/js/labs/stereo.js @@ -769,7 +769,7 @@ class StereoSim { topRing.position.y = h; this._figGroup.add(topRing); - // edges: two vertical lines + center + // edges: vertical generators + center axis const n = 8; for (let i = 0; i < n; i++) { const angle = (i / n) * Math.PI * 2; @@ -780,6 +780,13 @@ class StereoSim { this._vertices.push({ pos: new THREE.Vector3(0, 0, 0), label: 'O₁' }); this._vertices.push({ pos: new THREE.Vector3(0, h, 0), label: 'O₂' }); this._edges.push({ from: new THREE.Vector3(0, 0, 0), to: new THREE.Vector3(0, h, 0) }); + // base/top circle arc segments (for point-picking) + const arcN = 32; + for (let i = 0; i < arcN; i++) { + const a1 = (i / arcN) * Math.PI * 2, a2 = ((i + 1) / arcN) * Math.PI * 2; + this._edges.push({ from: new THREE.Vector3(r * Math.cos(a1), 0, r * Math.sin(a1)), to: new THREE.Vector3(r * Math.cos(a2), 0, r * Math.sin(a2)) }); + this._edges.push({ from: new THREE.Vector3(r * Math.cos(a1), h, r * Math.sin(a1)), to: new THREE.Vector3(r * Math.cos(a2), h, r * Math.sin(a2)) }); + } this._addEdges(0.4); this._addVerticesAndLabels(); @@ -814,6 +821,15 @@ class StereoSim { this._edges.push({ from: new THREE.Vector3(x, 0, z), to: apex }); } this._edges.push({ from: new THREE.Vector3(0, 0, 0), to: apex }); + // base circle as arc segments (for point-picking) + const arcN = 32; + for (let i = 0; i < arcN; i++) { + const a1 = (i / arcN) * Math.PI * 2, a2 = ((i + 1) / arcN) * Math.PI * 2; + this._edges.push({ + from: new THREE.Vector3(r * Math.cos(a1), 0, r * Math.sin(a1)), + to: new THREE.Vector3(r * Math.cos(a2), 0, r * Math.sin(a2)), + }); + } this._addEdges(0.4); this._addVerticesAndLabels(); @@ -851,6 +867,13 @@ class StereoSim { to: new THREE.Vector3(r * Math.cos(angle), h, r * Math.sin(angle)), }); } + // circle arc segments for point-picking on both bases + const arcN = 32; + for (let i = 0; i < arcN; i++) { + const a1 = (i / arcN) * Math.PI * 2, a2 = ((i + 1) / arcN) * Math.PI * 2; + this._edges.push({ from: new THREE.Vector3(R * Math.cos(a1), 0, R * Math.sin(a1)), to: new THREE.Vector3(R * Math.cos(a2), 0, R * Math.sin(a2)) }); + this._edges.push({ from: new THREE.Vector3(r * Math.cos(a1), h, r * Math.sin(a1)), to: new THREE.Vector3(r * Math.cos(a2), h, r * Math.sin(a2)) }); + } this._addEdges(0.4); this._addVerticesAndLabels();