digital-twin
Enables natural language control of a digital twin simulation pipeline for phone drop tests, converting LS-DYNA .k meshes to solid .k files with hand grip poses using 7 MCP tools.
README
DigitalTwinSimulation
LS-DYNA .k 메쉬 → 외곽 STL 추출 → 절차적 손 그립 포즈 → 폰 외곽 모핑(내부 스무싱) → 재해석 가능한 솔리드 .k. LLM이 자연어로 지시하는 MCP 서버로 노출.
스마트폰 드롭테스트의 "손이 폰을 쥔 상태" 시뮬레이션 입력을 자동 생성한다.
파이프라인
DYNA .k →[extract]→ 외곽 STL →[load_hand→grip]→ 손이 폰 쥠 + 편집외곽
│
재해석 가능 .k ←[export]← [morph] 편집외곽을 체적메쉬에 전파
설치 (포터블 — 로컬 venv)
python3.13 -m venv .venv
.venv/bin/pip install -e . # numpy/scipy
.venv/bin/pip install -e ".[mcp]" # MCP 서버까지
모든 의존성은 프로젝트 .venv 안에 설치된다. Blender 4.5 LTS(/snap/bin/blender)가 손 생성/그립에 필요(환경변수 DTS_BLENDER_BIN으로 경로 지정 가능). 모핑/추출은 Blender 없이 numpy/scipy만으로 동작.
CLI
# 외곽 STL만 추출
.venv/bin/dyna2stl phone.k phone_outer.stl
# 전체 파이프라인 1커맨드
.venv/bin/dts-pipeline phone.k phone_morphed.k --style natural
MCP 서버 (LLM 자연어 지시)
.venv/bin/dts-mcp # stdio MCP 서버 기동
Claude Desktop 등 MCP 클라이언트 설정 예:
{
"mcpServers": {
"digital-twin": {
"command": "/home/koopark/claude/DigitalTwinSimulation/.venv/bin/dts-mcp"
}
}
}
도구 (7개, flat 인자)
| 도구 | 설명 |
|---|---|
extract_surface(k_file, session_id?, parts?, merge_shells?) |
.k → 외곽 STL + 원본 보존 |
inspect_k(k_file) |
PART 목록·요소타입 조사(자가수정용) |
load_hand(session_id?, handedness?) |
절차적 리깅 손 생성 |
grip_phone(session_id?, style?) |
손이 폰 쥠 → 편집외곽 산출 |
morph_phone(session_id?, method?, scale?) |
편집외곽을 체적메쉬에 전파 |
export_solid_k(session_id?, out_path?) |
모핑된 .k 내보냄 |
자연어 시나리오
"이 폰 .k 오른손으로 쥐고 솔리드 .k 뽑아줘"
extract_surface(k_file="phone.k") → session "default", phone_stage=extracted
load_hand(handedness="right") → hand_stage=loaded
grip_phone(style="natural") → hand_stage=gripped, phone_edited_outer 생성
morph_phone(method="laplacian") → phone_stage=morphed (min_jacobian>0)
export_solid_k(out_path="phone_grip.k") → 완료
요소가 뒤집히면(과한 변형) morph_phone이 실패하며 scale을 줄이라는 hint를 준다 — LLM이 자가수정 가능.
아키텍처 (DESIGN.md 참조)
dyna_io/— .k 파싱(degenerate-tet 처리), 자유면/외부경계 추출, STL, .k 재작성. 순수 numpy.morph/— 변위장 조화확장(Laplacian), Jacobian 품질게이트, 거부 우선 드라이버. numpy/scipy.blender_core/— 절차적 손, 그립 포즈. bpy 전용(headless).app/— 세션 상태(폰/손 병렬트랙), 파이프라인, Blender 경계.mcp_server/— FastMCP 도구 표면. 코어는 mcp를 모른다.
설계 원칙: 최소 코드, 패턴은 두 번째 구현이 실재할 때만. 채택 패턴 = Strategy(morph), Adapter(blender).
테스트
.venv/bin/pytest -q # 62 passed (Blender 없으면 일부 skip)
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.