Example models작성 예
Six models in examples/. Each has a principle sheet (sheet.md), the model (model.json), the simulation input (sim.json) and a picture; the sixth is based on a public photo. They are design examples: sizes, times and speeds are assumed values (or scaled from the photo), not catalogue data, and no model is stated to match a real machine.
examples/에 모델 6개가 있습니다. 각 모델은 원리 시트(sheet.md), 모델(model.json), 시뮬레이션 입력(sim.json), 그림으로 구성되며 6번째 모델은 공개 사진을 근거로 작성했습니다. 모두 설계 예시이므로 치수, 시간, 속도는 가정값이거나 사진에서 비례로 산출한 값이고 카탈로그 값이 아닙니다. 실제 설비와의 일치는 보장하지 않습니다.
-

Pneumatic pick and place공압 픽앤플레이스
Gantry with a rodless X cylinder, a guided Z cylinder and a vacuum pad; infeed conveyor, nest, valve terminal. 14 devices.
로드리스 X 실린더, 가이드 Z 실린더, 흡착 패드로 구성된 갠트리와 공급 컨베이어, 지그, 밸브 매니폴드. 장치 14개.
Sim: pick 960 ms, place 2600 ms, return 3740 ms
시뮬레이션: 픽 960 ms, 플레이스 2600 ms, 복귀 3740 ms
examples/pick-and-place -

Ball-screw servo axis볼나사 서보 축
Servo motor, coupling, ball screw with 10 mm lead, carriage on two rails, cable chain, home and limit switches. 5 devices.
서보 모터, 커플링, 리드 10 mm 볼나사, LM 레일 2열 위의 캐리지, 케이블 체인, 원점·리밋 스위치. 장치 5개.
Sim: targets 300, 150, 0 mm; busy OFF at 1500, 2600, 3600 ms
시뮬레이션: 목표 300, 150, 0 mm, busy OFF 1500, 2600, 3600 ms
examples/ball-screw-axis -

Eight-station index table8스테이션 인덱스 테이블
Dial on a cam indexer with a geared motor, eight nests with parts, press cylinder on a column, part sensor. 8 devices.
기어드 모터 구동 캠 인덱서 위의 다이얼, 부품을 실은 지그 8개, 기둥에 고정한 압입 실린더, 부품 감지 센서. 장치 8개.
Sim: in-position at 640, 2340, 4040 ms; press down at 1050, 2750, 4450 ms
시뮬레이션: 인포지션 640, 2340, 4040 ms, 압입 1050, 2750, 4450 ms
examples/index-table -

Robot cell로봇 셀
Six-axis arm (preset
robot_6r) on a pedestal, vacuum tool, fixture table, outfeed belt, fence. 11 devices.받침대 위 6축 로봇(프리셋
robot_6r), 흡착 툴, 지그 테이블, 배출 벨트, 펜스. 장치 11개.Sim: pick 2900 ms, place on the belt 4950 ms, home 6400 ms
시뮬레이션: 픽 2900 ms, 벨트 플레이스 4950 ms, 원점 복귀 6400 ms
examples/robot-arm -

Cam lifter캠 리프터
Pear cam with a roller follower (27-point lift table), guided lift plate, geared motor, up, down and home switches. 4 devices.
롤러 종동절을 가진 서양배형 캠(27점 변위표), 가이드 승강판, 기어드 모터, 상승·하강·원점 스위치. 장치 4개.
Sim: up switch ON 1540 to 1670 ms, back home at 3090 ms
시뮬레이션: 상승 스위치 ON 1540~1670 ms, 원점 복귀 3090 ms
examples/cam-lifter -

XYZ vial dispenser (photo-based)XYZ 바이알 분주기 (사진 기반)
Cartesian robot modelled from one public photo: gantry, carriage, z column with the nozzle, peristaltic pump, two vial boxes. 11 devices.
공개 사진 한 장을 근거로 작성한 직교 로봇: 갠트리, 캐리지, 노즐이 달린 Z 기둥, 연동 펌프, 바이알 상자 2개. 장치 11개.
Sim: pump ON 2650 to 3150 ms and 4900 to 5400 ms (two vials)
시뮬레이션: 펌프 ON 2650~3150 ms, 4900~5400 ms(바이알 2개)
examples/xyz-dispenser
3D cycle replay3D 사이클 재생
One recorded simulation cycle, drawn by the same renderer as the program's 3D page. Drag to rotate the view; pinch or scroll to zoom. The renderer code and the data load only when you press the button.
기록된 시뮬레이션 1사이클을 프로그램의 3D 화면과 같은 렌더러로 재생합니다. 드래그하면 시점이 회전하고 두 손가락이나 마우스 휠로 확대·축소합니다. 렌더러 코드와 데이터는 버튼을 누를 때 내려받습니다.

Machine kinds in the catalog카탈로그의 기계 종류
The 27 kinds and 4 presets that model_catalog returns, in groups. A machine that no kind fits is built from primitives.
model_catalog가 반환하는 종류 27개와 프리셋 4개를 분류했습니다. 해당하는 종류가 없는 기계는 기본 요소(관절, 연동, 구동기, 센서)로 구성합니다.
namekind종류namepreset (expands to joints, couplings, drivers and sensors)프리셋(관절·연동·구동기·센서로 전개)Cylinders and rotary actuators실린더와 로터리 액추에이터
cylinder_doublecylinder_singlerotary_actuatorConveyors, motors and pumps컨베이어, 모터, 펌프
conveyormotorpumpServo axis서보 축
servo_axisservo_screwIndex table인덱스 테이블
index_tableindex_tableRobot arm로봇 팔
robot_armrobot_6rCams and other mechanisms from primitives캠 등 기타 기구(기본 요소로 구성)
machinesolidwheeled_baseA cam or a linkage is a coupling
table; a screw, a rack or gears is a couplingratio.캠과 링크는 연동
table, 나사·랙·기어는 연동ratio로 표현합니다.Grippers and vacuum pads그리퍼와 흡착 패드
grippervacuum_padSensors센서
photo_sensorprox_sensorreed_sensorzone_sensorlevel_sensorLamps, buttons and switches램프, 버튼, 스위치
lamptower_lightbuzzerbuttonselectorestopParts and tanks공작물과 탱크
part_sourcepart_sinktank
Uses활용
3D model from a description설명으로 3D 모델 작성
Describe the machine in words or attach a photo. The AI client writes the model by the skill's procedure; the server checks it and draws it on the 3D page.
기계를 글로 설명하거나 사진을 제공하면 AI 클라이언트가 스킬 절차에 따라 모델을 작성하고 서버가 이를 검사한 뒤 3D 화면에 표시합니다.
One-cycle simulation1사이클 시뮬레이션
Put events on pins and run them with
model_sim. The result gives the ON time of each sensor, the motion interval of each joint and the events of each part.핀에 이벤트를 입력하고
model_sim으로 실행합니다. 결과에서 센서별 ON 시각, 관절별 이동 구간, 부품별 이벤트를 확인할 수 있습니다.Motion review before build제작 전 동작 검토
Review the motion and the sequence in 3D before you order or make parts. Sizes and times are assumed values until they are measured.
부품 발주나 제작 전에 동작과 시퀀스를 3D로 검토합니다. 치수와 시간은 실측 전까지 가정값입니다.
Explanation and training설명과 교육
Replay the run on the 3D page during an explanation, or let the client get images from six views with
model_render.3D 화면에서 실행 결과를 재생하며 설명하거나 클라이언트가
model_render로 6방향 그림을 받아 활용합니다.
The simulation is a kinematic model with constant speeds. It computes no dynamics and no collision, and a pass does not replace a test on real equipment.
시뮬레이션은 등속 운동학 모델입니다. 동역학과 충돌은 계산하지 않으며 시뮬레이션 통과가 실제 장비 시험을 대신하지는 않습니다.
How it works동작 원리
Model structure모델 구성
A twin model is one JSON object with a list of devices. Each device has a kind from the catalog; motion that no kind covers is defined in its mech.
트윈 모델은 장치 목록을 담은 JSON 객체 하나입니다. 각 장치는 카탈로그의 종류(kind)를 가지며 종류로 표현할 수 없는 동작은 해당 장치의 mech에 직접 정의합니다.
- Frames프레임
- Each device sits on a parent frame (
on,mount,posein mm and degrees), so all frames form one tree.모든 장치는 부모 프레임 위에 배치됩니다(on,mount, mm·도 단위의pose). 따라서 전체 프레임은 하나의 트리를 이룹니다. - Joints관절
fixed,prismatic(a slide),revolute(a turn),planar(a base on the floor).fixed,prismatic(직선 이동),revolute(회전),planar(바닥 위 주행 베이스)가 있습니다.- Couplings연동
- One joint moves another:
ratio(screw, rack, gears),table(a cam or a linkage curve),diff_drive(two wheels).한 관절의 값으로 다른 관절을 구동합니다.ratio(나사, 랙, 기어),table(캠·링크의 변위 곡선),diff_drive(2륜 차동 구동)가 있습니다. - Drivers구동기
- Pins move a joint:
coils(valve coils),follow(a commanded position),step(one step per pulse),playback(poses picked by a program number).핀 신호로 관절을 구동합니다.coils(밸브 코일),follow(위치 지령 추종),step(펄스당 1스텝),playback(프로그램 번호로 선택한 자세)가 있습니다. - Sensors센서
- A
windowat a joint value (an end, a home or an in-position switch), or a sensor kind that sees parts.관절 값이 지정 구간에 있을 때 ON 되는window(끝단, 원점, 인포지션 스위치) 또는 부품을 감지하는 센서 종류입니다. - Skin외형
- The look only: groups of
boxandcylitems on a frame, each with a tone. It does not change the motion.외관만 정의합니다. 프레임 위의box·cyl요소를 그룹으로 묶고 요소마다 색조를 지정하며 동작에는 영향을 주지 않습니다. - Pins핀
- Named signals
<id>.<slot>. Events go in on pins, and sensors answer on pins.이름이 붙은 신호<id>.<slot>입니다. 이벤트는 핀으로 입력되고 센서 상태도 핀으로 출력됩니다.
Processing order in each ticktick당 처리 순서
model_sim advances time in fixed ticks (scan_ms, default 10 ms, range 1 to 100). Each tick runs these steps in this order:
model_sim은 고정 주기(scan_ms, 기본 10 ms, 범위 1~100)로 시간을 진행합니다. 매 tick 아래 단계를 순서대로 실행합니다.
- Pin events whose time has come set their pins. Part events of the run put, move or remove parts.해당 시각의 핀 이벤트가 핀 값을 바꿉니다. 실행에 정의한 부품 이벤트가 부품을 배치, 이동, 제거합니다.twin-engine/src/model.rs · sim
- Cylinders, conveyors and motors read their coils or run pins. After the lag they move at their set speed, and their end sensors turn on inside the sensor window.실린더, 컨베이어, 모터가 코일 또는 운전 핀을 읽습니다. 지연 시간 뒤 설정 속도로 이동하고 끝단 센서는 센서 구간 안에서 ON 됩니다.twin-engine/src/plant.rs · Plant::tick
- Devices with
mech, in the order of their id: drivers move their joints, couplings move the joints that follow, limits clip the values, window sensors are checked, thenbusyanddoneare set.mech가 있는 장치를 id 순서로 처리합니다. 구동기가 관절을 움직이면 연동이 종속 관절을 움직이고 한계를 넘는 값은 제한한 뒤 window 센서를 판정하고busy와done을 설정합니다.twin-engine/src/mech.rs · Machine::tick - The workpiece rules R1 to R9 run in a fixed order: parts follow their points, pads release and pick, rods push, belts carry, magazines drop, part sensors are set.공작물 규칙 R1~R9를 고정 순서로 실행합니다. 부품의 기준점 추종, 패드의 해제와 흡착, 로드의 밀기, 벨트 이송, 매거진 낙하를 처리한 뒤 부품 센서 값을 설정합니다.twin-engine/src/work.rs · Rt::tick
- Lamps and tank levels follow their pins.램프와 탱크 수위가 핀 값을 따릅니다.twin-engine/src/plant.rs · Plant::tick
The engine has no clock and no random number, and the order is fixed, so the same input always gives the same result.
엔진은 시스템 시계와 난수를 쓰지 않고 처리 순서가 고정되어 있으므로 입력이 같으면 결과도 항상 같습니다(결정론적 실행).
Skill procedure스킬 절차
The steps of the bundled skill skills/twin-modeling.
동봉된 스킬 skills/twin-modeling의 절차입니다.
In the AI clientAI 클라이언트에서
- Identify the machine.기계를 식별합니다.
- Find the working principle.동작 원리를 파악합니다.
- Write the principle sheet (8 parts).원리 시트(8개 항목)를 작성합니다.
- Map each part to kinds, presets or primitives.각 부분을 종류, 프리셋, 기본 요소에 대응시킵니다.
- Write the twin model JSON. Signals are named pins.트윈 모델 JSON을 작성합니다. 신호는 이름이 붙은 핀으로 표현합니다.
- Check it yourself.자체 검사를 수행합니다.
With the server서버와 함께
- Draft: send it with
model_draftand read thefacts.초안:model_draft로 전송하고facts를 확인합니다. - Simulate with
model_sim.model_sim으로 시뮬레이션합니다. - Draw with
model_renderand the 3D page.model_render와 3D 화면으로 표시합니다. - The person confirms the draft.사람이 초안을 확정합니다.
Example: from words to a model예시: 설명에서 모델까지
It is a pneumatic pick-and-place station on an aluminium base plate. Two 45 mm profile posts carry a 45 x 90 cross beam. On the front of the beam a guided rodless cylinder moves the head 200 mm in X; on its carriage a guided cylinder with a 100 mm stroke lowers a vacuum pad. A small inline ejector and a vacuum switch sit on the carriage bracket. Parts (orange plastic housings, about 40 x 40 x 25) come in on a short belt conveyor and stop against an end stop, where a diffuse photo sensor sees them. The head picks a part and puts it into a nest on the right, which has an inductive sensor. All cylinders have two air tubes and a reed switch at each end; the valves sit on a terminal at the back of the plate. There is a tower light on the beam and a box with a start button and an emergency stop at the front. Make a twin model of one cycle.
(알루미늄 베이스판 위의 공압 픽앤플레이스 스테이션입니다. 45 mm 프로파일 기둥 두 개가 45 x 90 크로스빔을 받치고 빔 앞면의 가이드 로드리스 실린더가 헤드를 X로 200 mm 옮깁니다. 캐리지에 붙은 행정 100 mm 가이드 실린더가 흡착 패드를 내리고 캐리지 브래킷에는 소형 이젝터와 진공 스위치가 있습니다. 부품(주황색 플라스틱 하우징, 약 40 x 40 x 25)은 짧은 벨트 컨베이어로 들어와 엔드 스톱에 멈추고 확산형 광센서가 이를 감지합니다. 헤드는 부품을 집어 오른쪽 지그에 놓고 지그에는 근접 센서가 있습니다. 실린더마다 에어 튜브가 두 개이고 양 끝에 리드 스위치가 달렸으며 밸브는 판 뒤쪽 매니폴드에 모여 있습니다. 빔 위에 타워 램프가, 앞쪽에 시작 버튼과 비상 정지가 든 박스가 있습니다. 한 사이클의 트윈 모델을 만들어 주세요.)
One cycle in model_simmodel_sim 1사이클 결과
Main entries of changes and part_log from the run of the example. The run ends at 4200 ms with no alarm.
예시 실행 결과(changes, part_log)의 주요 항목입니다. 실행은 4200 ms에 알람 없이 종료됩니다.
| t (ms) | Pin핀 | Meaning뜻 | 04200 ms |
|---|---|---|---|
| 300 | pick_sen.output | part at the end stop부품 엔드 스톱 도달 | |
| 960 | pick | pad takes part 1패드 부품 1 흡착 | |
| 970 | vac_sw.output | vacuum reached진공 도달 | |
| 1380 | z_cyl.sensor_back | pad up패드 상승 완료 | |
| 2090 | x_cyl.sensor_fwd | over the nest지그 상부 도달 | |
| 2520 | nest_sen.output | part in the nest부품 지그 안착 | |
| 2600 | release | part 1 left at place부품 1 place에 해제 | |
| 3740 | x_cyl.sensor_back | back over the conveyor컨베이어 상부 복귀 |
part_logpart_log의 부품 이벤트
Sheet, model and simulation input of this example이 예시의 원리 시트, 모델, 시뮬레이션 입력
Modelling from a photo사진 기반 모델 작성
A photo of the machine can replace the description, with the same procedure. The photo stays a file of the user; the model file does not contain it.
글 대신 기계 사진으로도 같은 절차에 따라 모델을 작성합니다. 사진은 사용자 파일로 남고 모델 파일에는 포함되지 않습니다.
The person gives a photo of the machine and, if they have it, one length measured with a tape between two things that the photo shows.
사용자: 기계 사진을 제공하고 가능하면 사진에 보이는 두 지점 사이의 실측 길이 하나를 함께 제공합니다.
The skill names the machine with a certainty word (
sure,likely,unsure) and lists every actuator and sensor in the photo: two air tubes read as a double-acting cylinder, switches in the body slots as end sensors. It tags every numberguess,ref(scaled from a known length in the photo),measured,labeloruser, and asks in one message for what the photo does not show.스킬: 기계를 식별해 확실성(
sure,likely,unsure)을 기록하고 사진에 보이는 구동기와 센서를 모두 목록화합니다. 에어 튜브 2개는 복동 실린더로, 바디 슬롯의 스위치는 끝단 센서로 판독합니다. 모든 수치에guess,ref(사진 속 기준 길이로 비례 산출),measured,label,user중 하나를 표시하고 사진으로 확인할 수 없는 항목은 한 번에 질의합니다.The server returns
askwith the draft: for each device, the sizes with no source or aguess, and one line for a measured reference size until the model'srefshold one.서버: 초안 응답에
ask를 반환합니다. 근거가 없거나guess인 치수를 장치별로 모으고 모델의refs에 실측 길이가 들어올 때까지 기준 치수 1개를 요청하는 항목을 유지합니다.The check: the person confirms the draft on the 3D page, and
model_renderdraws the model from the side of the photo to compare the two.확인: 사용자가 3D 화면에서 초안을 확정하고
model_render로 사진과 같은 방향의 그림을 받아 사진과 대조합니다.
Example: from one public photo to a model예시: 공개 사진 한 장에서 모델까지
model_render, view: "iso", cropped to the modelmodel_render 결과(view: "iso", 모델 영역만 잘라 사용)Photo: Matthew T. Wayland and Matthias Landgraf, Figure 3 of “A Cartesian Coordinate Robot for Dispensing Fruit Fly Food” (Journal of Open Hardware, 2018, DOI 10.5334/joh.9), CC BY 4.0, via Wikimedia Commons. Cropped to the robot; the inset pictures and their arrows are removed. The model uses only this photo and the Commons description.
사진: Matthew T. Wayland, Matthias Landgraf, “A Cartesian Coordinate Robot for Dispensing Fruit Fly Food”의 Figure 3(Journal of Open Hardware, 2018, DOI 10.5334/joh.9). 라이선스는 CC BY 4.0이며 출처는 위키미디어 공용입니다. 로봇 영역만 잘라 사용했으며(cropped) 삽입 그림과 화살표는 지웠습니다. 모델은 이 사진과 공용의 설명 글만을 근거로 작성했습니다.
What the skill read from the photo스킬의 사진 판독 결과
- A cartesian robot that fills vials with fly food; certainty
likely. - 바이알에 초파리 먹이를 분주하는 직교 로봇으로 식별했습니다(확실성
likely). - Reference part: the stepper motor on the z column, taken as a NEMA 17 (42.3 mm face), about 2.1 mm per pixel there. The 20 mm profiles, the 80 mm end rail and the 24 mm vials are scaled from it (
ref); the long base is aguess. - 기준 부품: Z 기둥 상단의 스테핑 모터를 NEMA 17(플랜지 42.3 mm)로 가정하고 해당 깊이에서 약 2.1 mm/px로 환산했습니다. 20 mm 프로파일, 80 mm 끝단 레일, 지름 24 mm 바이알은 이 비율로 산출했으며(
ref) 긴 베이스는guess로 두었습니다. - Three axes (gantry y, carriage x, moving z column) as
servo_axisthat follow a position word; 13 pins withpump.run. - 3축(갠트리 y, 캐리지 x, 승강 z 기둥)은 위치 지령을 따르는
servo_axis로 정의했습니다. 핀은pump.run을 포함해 13개입니다.
The model_draft reply (0 warnings, excerpt)model_draft 응답(경고 0건, 발췌)
"facts": {
"basis_counts": {"guess": 34, "ref": 2},
"devices": [{"id": "z_axis", "axis_word": "down",
"axis": {"range": [0, 150]}}]
},
"ask": [
{"device": "y_axis", "names": ["stroke_mm"]},
{"device": "z_axis", "names": ["lead_mm", "speed"]},
{"what": "one reference dimension measured
on the real rig"}
]
ask has 7 items. model_sim fills two vials ("ran": "scene", no alarm, 6.4 s).
ask는 7건입니다. model_sim은 바이알 2개를 분주하고 알람 없이 6.4 s에 종료됩니다("ran": "scene").
Architecture구조
- Program프로그램One executable, one process. The AI client starts it, and it ends when its input ends.실행 파일 1개, 프로세스 1개입니다. AI 클라이언트가 실행하고 표준 입력이 닫히면 종료됩니다.
- MCPA stdio server with five tools:표준 입출력(stdio) 서버이며 도구는 5개입니다.
- model_catalog
- model_draft
- model_get
- model_sim
- model_render
- 3D page3D 화면Listens on
127.0.0.1only and draws with three.js. The person confirms drafts there.127.0.0.1에서만 접속을 받고 three.js로 렌더링합니다. 사용자는 이 화면에서 초안을 확정합니다. - Language언어Rust. The only dependency is
serde_json.Rust입니다. 외부 크레이트는serde_json1개뿐입니다. - Crates크레이트
twin-engine: model and simulation.twin-page: store and page.twin-modeling-mcp: the server.twin-engine은 모델과 시뮬레이션,twin-page는 저장소와 화면,twin-modeling-mcp는 서버를 담당합니다. - Skill스킬The folder
skills/twin-modeling.model_catalogreturns the same text asguide.modeling.skills/twin-modeling폴더입니다.model_catalog도 같은 글을guide.modeling으로 반환합니다. - Cloud service클라우드 서비스None없음
Install설치
-
Get the server서버 내려받기
Download
twin-modeling-mcp.exe(Windows x86-64) from the latest release, or build it from source:최신 릴리스에서
twin-modeling-mcp.exe(Windows x86-64)를 내려받거나 소스에서 빌드합니다.cargo build --release -p twin-modeling-mcp -
Register it in the MCP clientMCP 클라이언트에 등록
twin-modeling-mcp --dir <models-folder> --port 18770twin-modeling-mcp --dir <모델-폴더> --port 18770Claude Code:Claude Code에서:
claude mcp add twin-modeling -- <path-to>/twin-modeling-mcp --dir <models-folder> --port 18770claude mcp add twin-modeling -- <실행파일-경로>/twin-modeling-mcp --dir <모델-폴더> --port 18770 -
Install the skill스킬 설치
Copy the folder
skills/twin-modelinginto the skills folder of the client.skills/twin-modeling폴더를 클라이언트의 스킬 폴더에 복사합니다.
Limits한계
- Kinematic model only: no dynamics, no collision, no inverse kinematics.운동학 모델만 제공합니다. 동역학, 충돌, 역기구학은 계산하지 않습니다.
- A simulation pass does not replace a test on real equipment.시뮬레이션 통과가 실제 장비 시험을 대신하지는 않습니다.
- Every number is an assumed value until it is measured.모든 수치는 실측 전까지 가정값입니다.
- The Windows x86-64 binary is the tested one. Linux and macOS build from source and are not tested.시험한 환경은 Windows x86-64 실행 파일입니다. Linux와 macOS는 소스 빌드는 가능하지만 시험하지 않았습니다.
- The page has English and Korean only.화면 언어는 영어와 한국어만 지원합니다.