Back
JavaScript to HAAS G-code Converter
Material:
Aluminum
Low Carbon Steel
Stainless Steel
Brass
Bronze
Cast Iron
Tool Steel
Copper
Work Offset:
G54
G55
G56
Coolant Mode:
Flood (M8)
Mist (M7)
Off (M9)
Convert to G-code
Copy G-code
Download G-code
View Documentation
JavaScript Machining Code
// Define your part parameters const partWidth = 4.0; const partLength = 6.0; const holeDiameter = 0.5; function generateGCode() { const haas = new HaasGCodeGenerator('0020', 'Sample Part'); haas.programStart(); haas.toolChange(1); haas.startPosition(1.0, 1.0); haas.faceMill(0, 0, partWidth, partLength, -0.1, 0.05); haas.toolChange(2); haas.plungeIntoPart(0.1, 'drill'); const holes = [ {x: 0.5, y: 0.5}, {x: partWidth-0.5, y: 0.5}, {x: partWidth-0.5, y: partLength-0.5}, {x: 0.5, y: partLength-0.5} ]; holes.forEach(hole => haas.drillHole(hole.x, hole.y, 0.1, -0.6, 0.1, 0.5)); return haas.programEnd(); }
Generated G-code
(G-code will appear here)
Tool Library
Tool #
Type
Material
Diameter
Teeth
Description
Add Tool
×
Add New Tool
Tool Number:
Tool Type:
End Mill
Face Mill
Drill
Tap
Thread Mill
Tool Material:
HSS
Carbide
Diameter (inches):
Number of Teeth:
Tap Pitch (TPI):
Thread Direction:
Right Hand
Left Hand
Save Tool