feat(abut): 교대 형상·입력 패널과 교각 받침·솔플레이트 개편
- 교대 형상(src/core/abut, 3D 장면, 목록·카메라·맞춤)과 교대 입력 패널 추가 - 교각 받침 기준 카드 제거, 솔플레이트 규칙을 교각별 입력으로 변경 - 받침 ELEVATION·솔플레이트 TABLE을 모델값으로 연결 - 교대 입력값 카드: 형식 행에 시점·종점 표시, 제목을 "A1 입력값 [입력]"으로 변경 - 테스트 614건 통과, 타입 검사 통과 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b1b2ad1ddb
commit
1d31d2f3a9
44 files changed
+2571
-120
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import * as THREE from 'three';
|
||||
|
||||
/**
|
||||
* Camera that contains a sphere (2026-11-03): keeps the view direction of `position → target`, moves the target to the
|
||||
* sphere centre, and backs off until the sphere fits both the vertical and the horizontal field of view.
|
||||
*/
|
||||
export function fitCamera(
|
||||
position: THREE.Vector3,
|
||||
target: THREE.Vector3,
|
||||
sphere: THREE.Sphere,
|
||||
fovDeg: number,
|
||||
aspect: number,
|
||||
margin = 1.1,
|
||||
): { position: THREE.Vector3; target: THREE.Vector3 } {
|
||||
const halfV = THREE.MathUtils.degToRad(fovDeg / 2);
|
||||
// The narrower of the two half-angles decides how far back the camera must stand.
|
||||
const halfH = Math.atan(Math.tan(halfV) * aspect);
|
||||
const halfFov = Math.min(halfV, halfH);
|
||||
const fit = (sphere.radius / Math.sin(halfFov)) * margin;
|
||||
const dir = position.clone().sub(target);
|
||||
const current = dir.length();
|
||||
const dist = Math.max(current, fit);
|
||||
dir.normalize();
|
||||
return {
|
||||
position: sphere.center.clone().add(dir.multiplyScalar(dist)),
|
||||
target: sphere.center.clone(),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user