G-code from a drawing: how to turn it into a CNC program
The manual way in five steps, and the faster way: a generator that reads your drawing and writes the program for your controller.
The short answer
To get G-code from a drawing you read the drawing, decide how to hold and cut the part, pick tools and cutting data, write the toolpath for your controller, and prove it before the first cut. You can do that by hand, with CAM software, or with a generator that reads the drawing for you. This page shows the manual steps and how the generator on this site does the same job.
Five steps by hand
- Read the drawing. Find the datums, the critical sizes and tolerances, the surface finish and the material.
- Plan the holding. Choose the stock size and how it is clamped. On a lathe the stock must be long enough for the jaws and for the cut.
- Split the work into setups. Decide what is machined in the first setup, what in the second, and where the zero is in each.
- Choose tools and order. Roughing, finishing, grooves, threads, holes, parting off. Rough first, finish last.
- Write and prove the program. Write the blocks, then check them in a simulator and with a dry run above the part.
How the generator does it
You upload the drawing and set the material, the stock and the machine. The AI reads the drawing and writes a plan: the setups, the operations, the tools. The program itself is not written freely by the AI. The site builds the G-code from that plan with fixed rules for the controller you chose, so the output follows the same structure every time.
Then the 3D simulator runs the program on a model of the stock. On a lathe it shows the chuck and the jaws and marks moves that hit them. A check report compares the result with the drawing and lists what to verify. Generating a part usually takes one to two minutes.
What it supports
| Machine | Controllers |
|---|---|
| CNC lathe | Fanuc, Haas, Sinumerik |
| CNC mill | Fanuc, Haas, Sinumerik, Heidenhain Klartext |
Metric and inch output are both available.
What it is not
A generated program is a draft from a machine reader, not a guarantee. Read the plan, run the simulator, do a dry run and make the first part under your own eyes. It does not replace CAM for complex surfaces.
Useful tools for the manual route
- Tolerance and fit calculator for ISO fits such as H7/g6.
- Metric thread calculator for depths and diameters.
- Speeds and feeds calculator for RPM and feed.
- Bolt circle calculator with ready G81 lines.
Frequently asked questions
Can AI really write G-code from a drawing?
AI can read a drawing and plan the operations. On this site the program is then built from that plan by fixed rules for your controller, and checked in a simulator. You still review it before it runs on a machine.
Which controllers does it write for?
Lathe programs for Fanuc, Haas and Sinumerik. Mill programs for Fanuc, Haas, Sinumerik and Heidenhain Klartext.
How long does it take?
Usually one to two minutes per part. On a threaded shaft we measured 2 minutes 14 seconds from the click to a finished program.
Is it free?
Yes, for now. The built-in example works with no sign-up, and a new account gets 2 free generations on your own drawings.
Can I trust the program without checking it?
No. Run it in the simulator, do a dry run above the part and check the first part. The generator also lists the points it could not confirm on the drawing.
Skip the typingUpload a drawing, get a program for your controller and check it in the 3D simulator before it goes near the machine. Try the example with no sign-up; a new account gets 2 free generations.
Open the generator