CNC CODE LAB • TURNING • G-CODE VERIFICATION

CNC Code Lab.

Write, generate, verify and simulate CNC turning code in your browser. DXF 2D profiles, diameter/radius programming, turning operations and X/Z toolpath simulation are designed for learning and verification—not as a guarantee of safe machine operation.

01 DRAWING UPLOAD 02 SCAN / VERIFY 03 X DIAMETER / RADIUS 04 OPERATION + PARAMETERS 05 GENERATE / VERIFY 06 SIMULATE / EXPORT
TURNING SETUP

CNC Turning — X / Z only

Y AXIS NOT USED

Turning convention: X = diameter/width, Z = length/axis. Y is intentionally excluded. Default X programming is Diameter.

UPLOAD DRAWINGDXF • DWG • PDF • JPG / JPEG
OPEN LIVE DWG →
Loads a saved CNCVEYRA drawing JSON, or a DXF file, straight into CNC LAB — original X/Z values as-is, with an editable 2D profile drawn below.
Upload a technical drawing, then scan it. Image/PDF scanning reads dimensions and attempts to reconstruct the visible lathe contour into editable X,Z profile points.
SCAN REQUIRED FOR UPLOADED DRAWINGS

If DXF geometry is loaded, the detected connected profile is used first. For JPG/PNG/PDF, the scanner first reconstructs a dimension-driven editable contour when the drawing dimensions are recognized; otherwise it uses the visible contour as a fallback. Manual X,Z remains editable. In Diameter mode, DXF OD 50 mm becomes X50; it is not doubled.

TURNING OPERATIONS

Select operation

Roughing formula: DOC is radius-based. Every rough pass removes DOC from the radius, so the corresponding diameter step is 2 × DOC. The finish allowance is also radial. Rough feed and finish feed are applied separately to their respective toolpaths.
Ready. Load a DXF or use the sample profile, choose an operation, then generate.
X/Z TOOLPATH SIMULATION

Turning Toolpath — X / Z axes

DATUM: Z0 = front face (RIGHT) • negative Z runs RIGHT → LEFT • X0 = spindle centerline at the bottom. Program and simulation follow the same X/Z order.
Rapid / approachCutting moveArc/profileCurrent tool
Position: X0.000 Z0.000 • Line: —
Simulation shows the programmed X/Z path and basic checks. It does not account for every controller mode, tool geometry, chuck/workholding condition, offsets, collision, machine limit or cutting force.
MANUAL CNC CODE

Write / Verify / Simulate G-code

X/Z TURNING
Manual verifier checks basic X/Z turning syntax and common programming issues.
MANUAL CODE SIMULATION

Toolpath Simulation — X / Z

Rapid / approachCutting moveArc / profileG32 / G33 threadingCurrent tool
Position: X0.000 Z0.000 • Line: —
This simulation is generated from the manual CNC code after basic parsing. It is for learning and verification support only; it is not a guarantee of machine safety.
MANUAL PROGRAM EXPORT

Export NC / TXT

NCTXT
EXPORT CNC PROGRAM

Export after verification + simulation review

⚠️ Machine-ready template: generated programs use the configured CNCVEYRA header/footer. Independently verify controller, tooling, offsets, workholding, feeds, speeds and complete toolpath before machining.
NCTXT

DXF → CNC Turning workflow

DXF → Geometry Detection → X Diameter/Radius → Operation → Parameters → Generate → Verify → Simulation → Export.

Safety by design

The lab never claims that generated code is machine-ready or guaranteed safe. Real controller, tooling, offsets, workholding, machine limits and setup must be independently verified.