NC to PLY Converter: CNC Toolpath Mesh
Convert a CNC .nc program into a binary PLY mesh that wraps each cutting move in a thin tube, for MeshLab, CloudCompare or your own scripts. Vertices store positions only, so there are no colors to tell operations or tools apart.
Download Started!
How would you rate your experience with MiConvert?
Why convert NC to PLY
PLY, the Stanford polygon format, is common in scanning and mesh-processing tools such as MeshLab and CloudCompare, where people compare, measure and clean geometry. A .nc program from a mill, router or laser has nothing those tools can load; it is a sequence of G-code commands that only a controller or a simulator understands. Converting to PLY puts the toolpath into the same environment as your scans and meshes.
Server-side, the program is walked line by line by a Python parser that collects the feed moves: G1, G2, G3, and lines listing coordinates without a G word. Rapid G0 moves are dropped. If any line outside a comment contains an E value, the whole file is treated as 3D-printer G-code instead, and only extruding moves count. The collected path is marked in a voxel grid, a distance transform measures 0.2 mm out from it, and marching cubes extracts the surface, which trimesh saves as little-endian binary PLY.
The PLY keeps the program's coordinates without moving the origin, and its surface is closed. Much else is approximated. Arc moves are joined end to end with straight chords because arc centers are not read, so a full circle drawn as one G2 vanishes. Inch programs keep inch numbers. Motion modes are not remembered, so coordinate-only lines after a G0 get drawn as cuts, and a G1 with the laser off looks the same as a burn. Feeds, spindle speed and laser power leave no trace in the file.
That matters if you plan to compare the PLY against a scan of the machined part. The tube is centered on the tool centerline, not offset by the cutter radius, so deviations measured against a scan will include the tool radius. Resolution also drops on big jobs, since grid cells are the larger of 0.3 mm and one 250th of the longest side.
Good fits are quick visual checks of a program next to scan data, scripts that read PLY to study tool reach, and keeping a rough picture of a job with its records. For output colored by operation, or a model of the finished part, there is no route through this converter, because that information is never reconstructed.
How to convert NC to PLY
- Confirm the .nc file is a G-code program and not a DSTV steel-fabrication file; DSTV files start with an ST line and belong on the NC to DXF page.
- Check that cutting moves are written as G1, G2 or G3, and that no line contains an E word outside a comment.
- If the program runs in inches (G20), make a note of it, because the PLY will carry inch numbers.
- Upload the .nc or .cnc file; guests can send up to 50 MB per file.
- Download the PLY within roughly 4 hours and open it in MeshLab, CloudCompare or a script.
NC to PLY converter details
- Little-endian binary PLY with triangle faces and vertex positions, readable by MeshLab, CloudCompare and common Python mesh libraries
- Closed surface around every kept path, built with a distance transform and marching cubes
- Recognizes both .nc and .cnc as CNC program extensions
- Drops G0 rapids but keeps the plunge, so the vertical entry into the material stays visible
- Handles absolute (G90) and incremental (G91) programs and G92 position resets
- Returns an error for a program with no cutting moves rather than handing you an empty PLY
Video Tutorial
Need to convert NC to PLY? This quick tutorial shows you how to do it completely free! 🔗 Try it now: https://miconvert.com/en/nc-to-ply?utm_source=youtube&utm_medium=social&utm_campaign=nc-to-ply W
NC to PLY questions
Does the PLY have vertex colors for each operation?
No. The file is binary little-endian PLY with positions only, without colors or extra vertex properties, and all moves form one merged mesh. To color sections, select them by position in MeshLab or a script after import.
Why did I get a tiny lump instead of my toolpath?
If the .nc came from steel detailing software or a beam line, it is probably a DSTV file, which begins with an ST header and lists contours and holes instead of tool moves. On this page it is read as G-code and turns into a few meaningless vertices, yet the job still reports success. Run DSTV files through NC to DXF, which draws them as a real 2D plate drawing.
What causes 'No movement/extrusion commands found in G-Code file'?
The program gave the parser nothing to trace. Make sure you uploaded the posted program rather than a setup sheet or log, that cuts are written as G1, G2 or G3 instead of only G0, and that no E value appears outside a comment. A stray E switches the parser to 3D-printer mode, where non-extruding moves are thrown away.
Why do some rapid or laser-off moves show up as cuts?
Motion mode is not carried between lines, so a line holding only coordinates after a G0 is traced as a cut. Laser power and S values are ignored as well, so a G1 with the laser off looks identical to an engraving move. Having your post-processor write G0 on every rapid line avoids the first case.
Are drilling cycles like G81 shown?
G81 to G89 are not interpreted, so drilled holes do not appear as holes and the path around them cannot be trusted. If your post-processor can expand canned cycles into plain G0 and G1 moves, convert that version instead.
How large or long a program can I convert?
Per file, guests can upload 50 MB, free accounts 100 MB, Plus 200 MB and Pro 1 GB. Each conversion has a 10-minute limit, and very long programs can stop with 'GCODE conversion timed out (600s limit)'; splitting the program by operation keeps each piece within it. For files between 1 GB and 40 GB, a one-time paid conversion delivered by email is offered to signed-in users.
How long is my file stored?
Your .nc file is removed once the job's final attempt ends, whether it succeeded or not. The PLY can be downloaded for about 4 hours and is then deleted by an automatic cleanup. Downloads use an unguessable token over HTTPS, but the link is not single-use, so anyone you pass it to can fetch the file until it expires. We do log file names, sizes and outcomes.