- 신규 팝업 cad-editor-app.html + cad-editor-view.js: Three.js 3D 뷰포트(원점 그리드+축), 워크스페이스 STL 로드/측정, 변환(이동·회전·배율·뒤집기·거울·중앙정렬), 구멍(표면 클릭 픽), 박스 컷, 두 STL 합/차/교집합, 새 파일로 저장. - 좌표계: 모델 원본 프레임 유지(슬라이서처럼 베드 중앙정렬 안 함). STL Z-up↔three Y-up 매핑 = rotateX(-90°), 역매핑 STL=(threeX,-threeZ,threeY). 변환은 클라이언트 bake, boolean은 bake→서버 OpenSCAD→결과 바이트 재로드(변환 리셋). - stl-cad-core: applyBooleanOp(op∈hole/cut/union/difference/intersection) 추가, addHoleToStl를 그 위의 얇은 래퍼로 리팩터(채팅도구 하위호환 유지). - routes-cad: GET /api/cad/file(원본 다운로드, dotfiles:allow), POST /api/cad/save(bake된 STL 저장), POST /api/cad/apply(바디=primary 바이트, ?op=¶ms, ?second=) 추가. 기존 list/info/render/ add-hole은 건드리지 않음. - k2-app: "🔧 STL 확인" 버튼 → "🔧 STL 편집" 팝업(openCadEditorPopup). 옛 PNG 모달 마크업·JS·CSS 제거. Co-Authored-By: Claude Code <noreply@anthropic.com>
26 lines
1.2 KiB
HTML
26 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>🔧 STL 편집기</title>
|
|
<link rel="icon" type="image/png" sizes="64x64" href="/homeclaw_logo.png">
|
|
<link rel="stylesheet" href="../css/styles.css">
|
|
<script>try{var _t=localStorage.getItem('homeclaw_theme')||'dark';document.documentElement.setAttribute('data-theme',_t);}catch(e){}</script>
|
|
<style>
|
|
html,body{height:100%;margin:0;padding:0;overflow:hidden;background:var(--bg,#1a1a1a);}
|
|
/* #cad-root 가 풀뷰포트 — cad-editor-view.js 가 .ce-shell 을 이 안에 빌드.
|
|
position:fixed;inset:0 이라 페이지 로드 직후부터 크기가 잡혀 initScene 시점에
|
|
뷰포트 clientWidth/Height 가 0 이 되는 블랙스크린 문제가 안 생김(slicer-app 동일 패턴). */
|
|
#cad-root{position:fixed;inset:0;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="cad-root"></div>
|
|
<!-- Three.js r128 UMD + 로더 — /vendor/three/ 정적 서빙(전역 THREE 부착). 슬라이서와 동일 벤더. -->
|
|
<script src="/vendor/three/three.min.js"></script>
|
|
<script src="/vendor/three/STLLoader.js"></script>
|
|
<script src="/vendor/three/OrbitControls.js"></script>
|
|
<script type="module" src="/js/k2/cad-editor-view.js"></script>
|
|
</body>
|
|
</html> |