G-code
G-code (Geometric Code) is the standardized computer numerical control (CNC) programming language used to command 3D printer hardware. It tells stepper motors where to move (X, Y, Z coordinates), how fast to travel (F feedrate), and how much plastic to extrude (E axis).
Common G-code Commands in 3D Printing
Standard commands include G0 / G1 (coordinated linear travel and extrusion), G28 (home all axes), M104 / M109 (set and wait for hotend temperature), M140 / M190 (set and wait for bed temperature), and M106 / M107 (part cooling fan control).
Generating G-code from 3D Files
3D models in STL or 3MF format cannot be read directly by printers. A slicer slices the model into horizontal layers and generates thousands of sequential G-code lines optimized for specific printer kinematics.
Parsing Print Metadata from G-code
Modern slicers embed comment headers at the top of G-code files detailing exact filament consumption (grams and meters), total layer count, and print time predictions in seconds, which quoting calculators read directly.
Calculate 3D Print Costs in Real Time
Estimate exact filament gram rates, machine hours, and profit margins for any MakerWorld design or 3MF/STL upload.
Calculate Now