# NCプログラム ビューア

> .nc、.tap、.gcodeファイルをドロップすると、工具ごとに色分けした3Dの工具軌跡、ワークのサイズ、各工具の送り速度と回転数、加工時間の目安、行番号付きのわかりやすい警告を表示します。ブラウザ上で動作し、スマートフォンでも使えます。

Human page: https://unmakelabs.com/ja-jp/nc-viewer/. This is the version for AI agents.

## What it does

NCプログラム ビューアで、機械にかける前に何が削られるかを確認。 .nc、.tap、.gcodeファイルをドロップすると、工具ごとに色分けした3Dの工具軌跡、ワークのサイズ、各工具の送り速度と回転数、加工時間の目安、行番号付きのわかりやすい警告を表示します。ブラウザ上で動作し、スマートフォンでも使えます。

## NCプログラム ビューアでできること

NCプログラムは、CNC工作機械にどこへ動くかを指示する座標とコード（G0、G1、G2、X、Y、Z、F…）の長いリストです。1行ずつ読んでも形状はわかりません。ビューアはこれらの動きを工具軌跡（バックプロット）として描くので、形状、深さ、加工の順序がひと目でわかり、単位の間違い、工具交換の抜け、意図しない早送りなどを最初の切削の前に見つけられます。

## こんな方に

機械のそばやスマートフォンでプログラムを確認したいオペレーターや段取り担当者、ポストプロセッサの出力を確認したいCAMプログラマー、仕入先や顧客のプログラムを確認したい工場経営者や購買担当者、先生や学生、そして他の人からファイルをもらった趣味のCNCルーターやフライス盤のユーザーに。

## Facts

- **対応ファイル:** .nc .gcode .tap .ngc .cnc .txt、Heidenhain .h、Sinumerik .mpf（一部対応）、3Dプリンター用Gコード
- **描画:** 早送り、直線、円弧（I/J/KとR、全平面、ヘリカル）、穴あけサイクルG81～G89、サブプログラムM98/M99
- **表示内容:** ワークのサイズ、切削送り・早送りの移動距離、加工時間の目安、工具と送り速度・回転数、行番号付きの警告
- **ダウンロード:** PNG画像、1:1の平面図SVG、概要JSON、共有リンクと埋め込み

## How a person does it

1. **プログラムを開く.** ビューアにドロップするか、ファイルを選ぶか、公開リンクを貼り付けます。読み込みはお使いの端末上で行われ、4 MBのプログラムでも約1秒です。
2. **表示・再生する.** 工具軌跡を回転・ズームしたり、上面・正面・側面に切り替えたりできます。再生ボタンを押すと工具の動きを確認でき、現在の行がリスト内で強調表示されます。行、警告、工具、軌跡の一部をタップするとその箇所へ移動します。
3. **確認・共有する.** パネルでサイズ、時間、工具、警告を確認し、お使いの機械の早送り速度を設定します。画像や平面図をダウンロードしたり、同じ位置で開くリンクを共有したりできます。

## Open a file by link (works today)

The viewer runs in a browser. Any public file URL can be opened by adding `?src=` (URL-encoded): `https://unmakelabs.com/ja-jp/nc-viewer/?src=https://unmakelabs.com/apps/nc/samples/bracket.nc`. The host must allow cross-origin reads (GitHub raw, most object storage and CDNs do). A camera view can be added after `#`: `#t=0.5&v=px,py,pz,tx,ty,tz&r=0&u=mm&rr=10000` (t position in machining time 0 to 1, default 1 = whole program; v camera; r=0 hides rapids; u units when the file states none; rr rapid rate in mm/min for the time estimate).

Embed: `<iframe src="https://unmakelabs.com/embed/nc/?src=<url-encoded file URL>" width="100%" height="480" style="border:0"></iframe>`.

## Send your own file (live)

`POST https://y64b3d8qbc.execute-api.eu-central-1.amazonaws.com/v1/nc_inspect/jobs?wait=25` with the file as multipart `file` (or JSON `file_base64` + `filename`, or `file_url`), API tool `nc_inspect`: Inspect a CNC program (G-code, Heidenhain). The same engine code as this page. No sign-up; Free: 5 full results per IP per day without a key (resets at 00:00 UTC); POST /v1/keys gives an instant key with 25 more full results (one-time, not renewed); each accepted correction adds 1 free call (up to 20 a month). Options (JSON in `options`): `rapid_mm_min`: rapid feed for the time estimate in mm/min (default 10000); `tool_change_s`: seconds per tool change (default 6).

```bash
# NC program: tools, extents, run time
curl -s -F "file=@part.nc" "https://y64b3d8qbc.execute-api.eu-central-1.amazonaws.com/v1/nc_inspect/jobs?wait=25"
```

## Good to know

表示されるサイズはプログラム原点からの切削動作の範囲なので、素材やワーク座標系と照らし合わせてください。早送りは直線の破線で描かれますが、実際には早送りで1軸ずつ動く機械も多くあります。工具径補正（G41/G42）が有効な場合、描かれる線はプログラムされた輪郭で、工具中心ではありません。時間は「距離÷送り速度」に早送りと工具交換を加えたもので、コーナーで減速する機械ではより長くかかります。

## Not done by this tool

- 機械、バイス、素材との干渉チェックや、切削シミュレーション（材料除去）は行いません
- マクロ変数やループ（Fanuc Macro Bの#、HeidenhainのQパラメータ）は計算せず、該当行は警告として表示します
- ポケットやねじ切りなどの制御装置固有のサイクル（Heidenhain CYCL DEF、Sinumerik CYCLE6x）、傾斜面加工（G68.2、PLANE）、5軸の回転は描画しません
- プログラムの編集や変換はできません（制御装置間の変換は対応予定です）

## Value

Opens an NC program (G-code: Fanuc, Haas, Mach3, Grbl, LinuxCNC and CAM post-processor output; Siemens Sinumerik and Heidenhain Klartext in part; 3D-printer G-code) in the browser with nothing to install and draws the 3D toolpath: cuts coloured per tool, rapids dashed, play and scrub with the running line highlighted in the listing. Reports the extents of the cutting moves, cutting and rapid travel, an estimated machining time from the programmed feeds (rapid rate and tool-change time adjustable), the tools with feeds, speeds and cutting time, and warnings with line numbers (arcs whose end is off the circle, missing feeds, missing units, unsupported codes, cycles and macros not drawn). Downloads a PNG, a 1:1 plan-view SVG and a JSON summary. Free, no sign-up.

## When it fits

- A machinist or setter wants to see what an NC program will do before running it, on a phone or shop PC with no CAM seat: shape, depth, extents against the stock, tools and roughly how long it takes.
- A CAM programmer wants to check post-processor output (arc format, units, tool changes, drilling cycles, feeds) or find the line that makes a control alarm on an arc.
- Someone has a .nc, .tap, .gcode, .ngc or .cnc file from a customer, a forum or a hobby CNC router and wants to know what it cuts, how big and in which units.

### When not

- Collision checking against the machine, fixtures or the stock model, material removal simulation, or verified cycle times on a specific machine (acceleration is not modelled): use the CAM's or the control's own simulation.
- Programs built mostly from macro variables, loops or control-specific cycles (Fanuc Macro B, Heidenhain Q parameters and CYCL DEF, Sinumerik CYCLE pockets): these parts are listed as warnings, not drawn.

## Why use it instead of the alternatives

- Nothing to install: the page opens a public NC program from a link (?src=, with #t= for the point in the program and #v= for the camera) and an embed shows the toolpath in any page.
- NCViewer (ncviewer.com) draws G-code locally in the browser with an editor, line stepping, 5-axis and lathe modes; its side panels are the code editor, a position readout and machine options (checked Dec 2026), with no tool list with feeds, speeds and per-tool times and no list of problems with line numbers. CAMotics and desktop editors such as CIMCO Edit need installing (CIMCO is paid); controls and CAM systems simulate only for their own users.
- This viewer: free in any browser incl. phones, nothing uploaded, line-by-line playback, tool list with feeds/speeds/times, plain warnings with line numbers (arcs a control would reject, missing units or feeds, codes not drawn), Heidenhain and Sinumerik read in part, plan-view SVG at 1:1, share link and embed.

### What rebuilding it would take

- Write a reader that handles modal G-code state (motion, plane, absolute/incremental, units, feed modes), arcs by I/J/K and by R including >180° and full circles, helical arcs, drilling cycles G81-G89 with G98/G99, subprograms (M98/M99, M97) and Sinumerik/Heidenhain variants.
- Draw millions of segments smoothly on a phone, scrub by machining time, highlight the running line, and time every move from its feed.
- Explain every unsupported code or broken arc in plain words with its line number, and export a scale-true plan view.
- A set of hand-worked test programs with known lengths, extents and times to keep the reader honest as dialects are added.

## Quality

No score published; the limits above say what it does not do. Check results that matter before you rely on them.

## Risk for the user

- Free and unlimited; no sign-up, no ads.
- A viewer, not a machine simulation: it does not check collisions, and some codes are not drawn (listed as warnings). Prove out every program on the machine as usual.

_Status: the NC viewer page works; agents send their own file to POST https://y64b3d8qbc.execute-api.eu-central-1.amazonaws.com/v1/nc_inspect/jobs?wait=25._

## Privacy

- Files opened in the page are read on the user's device and not uploaded unless the user clicks Share.
- Files opened by link (?src=) are fetched from where they are stored.
- The page loads three.js from a public code server, which receives the visitor's IP address for that request.

## Data

ブラウザ内で開きます。共有しない限り、ファイルはお使いのデバイスから出ません。共有したファイルは30日間保管されます。

## FAQ

- **ここで正しく見えれば、そのまま加工しても安全ですか？** どんなビューアも、きちんとした試し加工の代わりにはなりません。このビューアはプログラムの内容を表示し、制御装置で弾かれそうな行を警告し、描画できなかった部分を一覧にしますが、お使いの機械のオフセット、治具、ストロークについては何も知りません。早めにミスを見つけるために使い、その後はいつもどおりドライランを行ってください。
- **対応している制御装置やCAMは？** ISO/Fanuc形式のGコードであれば対応しています。Fanuc、Haas、ISOモードのMazak、Gコードモードのオークマ、Mach3/Mach4、LinuxCNC、Grbl、さらにFusion、Mastercam、SolidCAM、HSMWorks、NX、Vectricなどの出力に対応します。Siemens SinumerikとHeidenhain Klartextのプログラムは一部（移動、円弧、工具、送り速度）を読み込み、その旨を明示します。
- **加工時間はどのくらい正確ですか？** 各切削動作の「距離÷指令送り速度」に、設定した速度（初期値10,000 mm/min）での早送りと工具交換時間（初期値6秒）を加えています。実際の機械はコーナーで減速し、動作間で加減速するため、細かい3D工具軌跡ではこれより長くかかるのが普通です。長い直線切削ではほぼ一致します。お使いの機械の早送り速度と工具交換時間は「前提条件」で設定してください。
- **機械では動く円弧が警告されるのはなぜですか？** 各円弧を制御装置と同じ方法でチェックしています。終点は中心（I/J/K）を基準とする円上に0.0127 mmまたは半径の0.1%以内で載っている必要があり、Rで指令した円弧は弦の長さの半分より短くできません。許容値は制御装置ごとに異なる（パラメータで設定される）ため、警告された円弧でも動く場合がありますが、ポストプロセッサの円弧で機械がアラームを出したときに最初に確認すべき箇所です。すべての円弧がインクリメンタルのI/Jでは合わず、絶対値の中心として合う場合は、ビューアが自動で切り替えてその旨を表示します。
- **本当に無料ですか？** はい。ファイル数の制限、広告、登録、有料プランはありません。200 MBまでのプログラムを開けます。
- **プログラムはアップロードされますか？** 共有した場合のみです。共有したファイルはリンクが使えるよう30日間保管され、いつでも削除できます。それ以外の場合、プログラムやお客様の部品の情報は外に出ません。
- **AIエージェントでNCプログラムを読めますか？** エージェントは公開されているプログラムをリンクでこのビューアーに開き（このページに?src=とファイルのアドレスを付けます）、「ダウンロード」＞「概要（JSON）」で概要を読み取れます。同じ概要をデータで返すAPIも予定しています。
- **運営者は？** Unmake Labsです。お問い合わせ：hello@unmakelabs.com

## Related pages

- [Gコード ビューア](https://unmakelabs.com/ja-jp/gcode-viewer/)
- [.tapファイル ビューア](https://unmakelabs.com/ja-jp/tap-file-viewer/)
