A browser-based G-code generation tool for 3D printing, powered by gcoordinator.
Live demo: https://e04.github.io/gcoordinator-web/
gcoordinator-web is an online editor and 3D preview tool for generating G-code using Python code — directly in your browser, with no installation required.
Write Python scripts that define 3D printing toolpaths using the gcoordinator library, and instantly see both the generated G-code and a real-time 3D visualization. When you're satisfied, download the G-code file ready for your printer.
- In-browser Python execution — Runs Python via Pyodide (WebAssembly), so nothing needs to be installed locally.
- Real-time preview — Code is automatically re-executed on changes, and the 3D toolpath visualization updates live.
- Monaco-based code editor — Syntax highlighting, autocompletion, and a familiar editing experience (the same editor that powers VS Code).
- G-code download — Export generated G-code directly from the browser.
gcoordinator is a Python library created by tomohiron907 for generating G-code for 3D printing through code.
gcoordinator-web is a browser-based frontend that brings the gcoordinator workflow to the web. Under the hood, it uses gcoordinator-lite — a lightweight fork optimized for running in the browser via Pyodide.
- Open the app at https://e04.github.io/gcoordinator-web/
- Write or edit Python code in the left-hand editor panel.
- View the results — the 3D visualization and G-code text update automatically.
- Download the G-code by clicking the download button in the toolbar when you're ready.
Import gcoordinator and numpy, then build your toolpaths by creating gc.Path objects and appending them to the global full_object list.
Important: You do not need to call gc.gui_export(full_object). The runtime automatically reads the global variable full_object after your script finishes and generates G-code from it. Simply define full_object as a list and append your paths to it.
import numpy as np
import gcoordinator as gc
full_object = []
for height in range(100):
arg = np.linspace(0, 2 * np.pi, 100)
x = 10 * np.cos(arg)
y = 10 * np.sin(arg)
z = np.full_like(arg, (height + 1) * 0.2)
wall = gc.Path(x, y, z)
full_object.append(wall)This creates a simple cylinder wall — 100 circular layers, each 0.2 mm apart.
- Define
full_objectas an empty list:full_object = [] - Create
gc.Path(x, y, z)objects, wherex,y, andzare NumPy arrays describing the toolpath coordinates. - Append each path to
full_object. - The runtime automatically detects
full_objectand generates G-code viagc.GCode(full_object).generate().
You can customize printer settings using gc.set_settings():
import gcoordinator as gc
settings = {
"Print": {
"nozzle": {"nozzle_diameter": 0.8, "filament_diameter": 1.75},
"layer": {"layer_height": 0.5},
"speed": {"print_speed": 1000, "travel_speed": 5000},
"origin": {"x": 90, "y": 90},
"fan_speed": {"fan_speed": 128},
"temperature": {"nozzle_temperature": 220, "bed_temperature": 50},
"travel_option": {
"retraction": False,
"retraction_distance": 2.0,
"unretraction_distance": 2.0,
"z_hop": False,
"z_hop_distance": 3,
},
"extrusion_option": {"extrusion_multiplier": 1.0},
},
"Hardware": {
"kinematics": "Cartesian",
"bed_size": {"bed_size_x": 180, "bed_size_y": 180, "bed_size_z": 180},
},
}
gc.set_settings(settings)
full_object = []
for height in range(100):
...