Nikolay-Kha / PyCNC

Python CNC machine controller for Raspberry Pi and other ARM Linux boards

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Convert gcode to x,y,z coordinates

ivandrodri opened this issue · comments

Hi,

I wanted to know how to convert gcode lines to x,y,z coordinates in order to implement them in a 3d simulation.

Given a g-code "line" I parse it with

g = GCode.parse_line(line)

but I don't know how to get the x,y,z coordinates from the g.params .

thanks for any help!

Hi.
g.params is a simple dict with capitalized string parameters. I.e. to get X from the line, just call g.get('X')