Grasshopper

algorithmic modeling for Rhino

how to change CNC-code into a sequence of coordinates

how to change CNC-code into a sequence of coordinates?

Views: 291

Replies to This Discussion

It should not be too difficult. CNC code is human readable and consists primarily of X, Y, and Z values. Depending on the type of machine for which the code was produced it may also have i, j, and k values that represent the unit normal vector at the X, Y, and Z point. There will also be other values such as feed rate, spindle RPM, or other values dependent on the machine type.

There are 2 types of X, Y, and Z values: incremental and absolute. Sometimes the CNC code will tell you which it is using, but sometimes not. Again, it depends on the machine type for which the CNC code is produced, and also on the software that produces the code.

Here is some code for my 3D printer.

G0 X54.010 Y-44.505 F7500
G0 F7200 E-3.5000
G1 X54.010 Y-11.884 E-2.5235 F6000
G1 X20.010 Y-11.884 E-1.5057
G1 X20.010 Y-45.884 E-0.4880
G1 X54.010 Y-45.884 E0.5298

G0 and G1 mean "goto" and tell the printer to move the printhead to the indicated X, Y position. The printhead stays at the zame Z-value until it moves to the next higher layer.  E tells the printer to extrude the length of filament following the E. F is the feedrate - the speed for moving the printhead.

Note that 3D printers are an especially simple type of CNC machine, so if you are dealing with code for, say, a 5-axis milling machine, the CNC code will be much more complex. Also, note that most CNC machines move only in straight lines, so if you are dealing with curved surfaces you will have lots of fairly close together goto points.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service