English
Point Cloud & Digital Twin

구축 방법 — Point Cloud & Digital Twin · v1.0 · 2026-10-27

■ 방법

  • 탭 4개: Point Clouds / Registration / Plane Fitting / Scan to BIM. 탭마다 체험 2~3개
  • 계산은 모두 브라우저에서: 직접 쓴 JavaScript(pc-core.js), 외부 라이브러리 없음. 3D 보기는 캔버스 2D에 깊이 버퍼를 직접 구현
  • 가상 스캔: 스캐너 위치(높이 1.5 m)에서 고도 −55°~+88°, 방위는 고도별로 같은 간격이 되게 각도 간격으로 광선을 쏘고, 방 벽·바닥·천장·기둥·탁자와의 첫 교차를 계산(문·창 구멍은 반환 없음). 거리 잡음 가우스 σ(기본 5 mm), 1% 무작위 빠짐
  • 복셀 내려 뽑기: 칸마다 무게중심
  • ICP: 점-점, 가장 가까운 점은 격자 해시(칸 0.4 m), 짝 거리 d_max 이하만, 강체 운동은 Horn(1987) 단위 쿼터니언(4×4 대칭 행렬 고유분해, 야코비). 기본 d_max 0.8 m, 25번째부터 0.2 m. 스캔 B는 (4.6, 1.2, 1.5) m에서 찍어 자기 좌표계(방위 30° 회전)로 줌. A는 5 cm, B는 10 cm 복셀
  • RANSAC: 점 3개로 평면, 문턱 τ 안의 점 수가 가장 많은 것, 최소제곱(공분산 최소 고유벡터)으로 두 번 다듬고 내점 빼고 되풀이. 필요 시도 수 N = log(1−p)/log(1−w³)
  • Scan to BIM: 찾은 평면 중 방 경계 0.3 m 안의 수직·수평 면을 벽·바닥·천장으로, 기둥은 보이는 면마다 점의 중앙값 위치(크기는 설계 0.40 m 가정), 설계 면에서 10 cm 넘는 점을 설계에 없는 것으로. 편차 지도는 점마다 가장 가까운 설계 면까지 거리
  • LLM 없음

■ 데이터

  • 가상 방(손으로 정함). 설계: 6.00 × 4.00 × 2.70 m, 기둥 중심 (4.00, 2.80) 한 변 0.40 m. 지어진 값: 동쪽 벽 x 6.04 m, 천장 2.68 m, 기둥 중심 y 2.87 m, 설계에 없는 탁자 1.5–2.7 × 2.6–3.4 × 0–0.75 m, 남쪽 벽 문(x 0.8–1.7, 높이 2.1), 동쪽 벽 창(y 1.2–2.8, 높이 0.9–2.0)
  • 성격: 합성. 실제 공개 스캔 데이터는 쓰지 않음

■ 검증

  • tests/point-cloud/core-test.mjs (Node 22.23):
  • 광선 손계산(동쪽 벽까지 5.040 m, 문 구멍 반환 없음, 기둥 면 2.800 m)
  • Horn 해로 알려진 변환 복원: 최대 오차 5.7e-9
  • ICP: 처음 10° · 37 cm 어긋남 → 회전 오차 0.14°, 위치 오차 0.8 cm. 같은 설정(d_max 0.8 → 0.2)으로 시작 회전 −40°~+20°에서 1° 안으로 맞음, 90°에서는 엉뚱한 곳에 수렴
  • RANSAC: 평면 9개, 동쪽 벽 x 6.040 m(지어진 6.04), 천장 2.680 m, 바닥 0.000 m (오차 5 mm 안)
  • 화면(헤드리스 Chromium): 동쪽 벽 +4.0 cm, 천장 −2.0 cm, 기둥 y +7.0 cm, 탁자 1.50–2.70 × 2.59–3.40 m를 찾아냄. 손으로 정한 값과 같음
  • 편차 거리 손계산(동쪽 벽 4 cm, 기둥 북쪽 면 7 cm), RANSAC 필요 시도 수(w 0.3, p 0.99 → 169)
  • 화면: Playwright로 375·1920px × 한·영 × 탭마다 콘솔 오류·넘침·빈 그림·남은 한글 검사

■ 범위

  • 가상 방 하나와 단순한 오차 모형. 실제 스캐너의 반사율·입사각 오차, 혼합 픽셀, 다중 스캔 전역 정합, 곡면은 다루지 않음

■ 출처

  • Besl, P.J., McKay, N.D. (1992). A method for registration of 3-D shapes. IEEE TPAMI 14(2)
  • Horn, B.K.P. (1987). Closed-form solution of absolute orientation using unit quaternions. JOSA A 4(4)
  • Fischler, M.A., Bolles, R.C. (1981). Random sample consensus. CACM 24(6)
  • Rusinkiewicz, S., Levoy, M. (2001). Efficient variants of the ICP algorithm. 3DIM
  • Tang, P. et al. (2010). Automatic reconstruction of as-built BIM from laser-scanned point clouds. Automation in Construction 19(7)
  • Bosché, F. (2010). Automated recognition of 3D CAD model objects in laser scans. Advanced Engineering Informatics 24(1)

■ 이력

  • 2026-10-27 · v1.0 · 공개

How it's built — Point Cloud & Digital Twin · v1.0 · 2026-10-27

■ Method

  • 4 tabs: Point Clouds / Registration / Plane Fitting / Scan to BIM, each with 2–3 hands-on parts
  • Everything is computed in the browser with hand-written JavaScript (pc-core.js), no external libraries. The 3-D views use a canvas with a hand-written depth buffer
  • Virtual scan: from the scanner position (1.5 m high), rays at elevations −55° to +88° and azimuths spaced evenly per elevation at the angular step; first intersection with walls, floor, ceiling, column and table (door and window openings give no return). Gaussian range noise σ (default 5 mm), 1% random dropouts
  • Voxel downsampling: one centroid per cell
  • ICP: point-to-point, nearest neighbours via a grid hash (0.4 m cells), pairs within d_max only, rigid motion by Horn (1987) unit quaternions (4×4 symmetric eigendecomposition, Jacobi). Default d_max 0.8 m, 0.2 m from iteration 25. Scan B is taken at (4.6, 1.2, 1.5) m and given in its own frame (rotated 30°). A at 5 cm voxels, B at 10 cm
  • RANSAC: plane through 3 points, keep the one with most points within τ, refine twice by least squares (smallest covariance eigenvector), remove inliers, repeat. Tries needed N = log(1−p)/log(1−w³)
  • Scan to BIM: fitted vertical and horizontal planes within 0.3 m of the room bounds become walls, floor and ceiling; the column from the median position of points on each visible face (size assumed at the design 0.40 m); points more than 10 cm from any design surface are flagged as not in the design. Deviation map: distance from each point to the nearest design surface
  • No LLM

■ Data

  • A virtual room set by hand. Design: 6.00 × 4.00 × 2.70 m, column centre (4.00, 2.80), 0.40 m square. As built: east wall x 6.04 m, ceiling 2.68 m, column centre y 2.87 m, a table not in the design 1.5–2.7 × 2.6–3.4 × 0–0.75 m, door in the south wall (x 0.8–1.7, 2.1 high), window in the east wall (y 1.2–2.8, 0.9–2.0 high)
  • Synthetic. No real public scan data used

■ Validation

  • tests/point-cloud/core-test.mjs (Node 22.23):
  • Ray hand checks (5.040 m to the east wall, no return through the door, 2.800 m to the column face)
  • Horn recovers a known transform: worst error 5.7e-9
  • ICP from 10° and 37 cm off → rotation error 0.14°, position error 0.8 cm. With the same schedule (d_max 0.8 → 0.2), starting rotations −40° to +20° end within 1°; from 90° it converges to the wrong place
  • RANSAC: 9 planes, east wall x 6.040 m (as built 6.04), ceiling 2.680 m, floor 0.000 m (within 5 mm)
  • Screen (headless Chromium): finds east wall +4.0 cm, ceiling −2.0 cm, column y +7.0 cm, table 1.50–2.70 × 2.59–3.40 m, matching the hand-set values
  • Deviation hand checks (east wall 4 cm, column north face 7 cm), RANSAC tries needed (w 0.3, p 0.99 → 169)
  • Screens: Playwright at 375 and 1920 px × Korean/English × every tab, checking console errors, overflow, blank plots and leftover Korean

■ Scope

  • One virtual room and a simple error model. Reflectance and incidence-angle errors, mixed pixels, global multi-scan registration and curved surfaces are not covered

■ Sources

  • Besl, P.J., McKay, N.D. (1992). A method for registration of 3-D shapes. IEEE TPAMI 14(2)
  • Horn, B.K.P. (1987). Closed-form solution of absolute orientation using unit quaternions. JOSA A 4(4)
  • Fischler, M.A., Bolles, R.C. (1981). Random sample consensus. CACM 24(6)
  • Rusinkiewicz, S., Levoy, M. (2001). Efficient variants of the ICP algorithm. 3DIM
  • Tang, P. et al. (2010). Automatic reconstruction of as-built BIM from laser-scanned point clouds. Automation in Construction 19(7)
  • Bosché, F. (2010). Automated recognition of 3D CAD model objects in laser scans. Advanced Engineering Informatics 24(1)

■ History

  • 2026-10-27 · v1.0 · Released