How to load gcode file form a pcb. not a 3dprinter gcode with layers

I want to load a gcode file with the loader gcode example but I can’t. Can somebody help me?

There is an example here on the . But this is a loader for 3D printer gcode files generated in slicers for printing in layers.

I want to display another gcode files generated in coppercam or eagle for PCB purpose. You can see the difference in the pictures.



So the THREE.GCodeLoader has to be modified but I have no experience with JavaScript.

This is a part of the gcode I want to display:

M05 T0 M06 S24000 ( 0.0079"/0.200mm Insulate Stub End Mill  {Z-0.0039"/-0.100mm}  )
G0 X-40.00500 Y29.81788 Z2.00000
G1 Z-0.10000 F599.4
G3 X-40.43484 Y29.63983 I0.000000 J-0.607900
G1 X-42.97484 Y27.09983
G3 X-43.15288 Y26.67000 I0.429800 J-0.429800
G1 X-43.15289 Y23.74679
X-46.78484 Y20.11483
G3 X-46.96288 Y19.68500 I0.429800 J-0.429800
G1 X-46.96289 Y-14.60500
G3 X-46.78484 Y-15.03484 I0.607900 J0.000000
G1 X-42.17228 Y-19.64740
G3 X-41.74244 Y-19.82545 I0.429800 J0.429800
G1 X-36.67125 Y-19.82545
G3 X-36.24142 Y-19.64740 I0.000000 J0.607900
G1 X-33.22517 Y-16.63115
G3 X-33.04712 Y-16.20132 I-0.429800 J0.429800
G1 X-33.04712 Y-7.39221
X-32.94897 Y-7.33287
G3 X-33.80482 Y-5.07618 I-0.706000 J1.022900
G1 X-33.80472 Y-5.07699
G3 X-34.26329 Y-7.39292 I0.149700 J-1.233000
G1 X-34.26289 Y-15.94953
X-36.92305 Y-18.60969
X-45.74712 Y-14.35321
X-27.16578 Y6.42816
G3 X-26.73594 Y6.25012 I0.429800 J0.429800
G1 X-20.82450 Y6.25011
X-11.15079 Y-3.42359
X-11.68104 Y-8.79700
G3 X-13.63423 Y-8.67885 I-1.022900 J-0.706000
G1 X-13.63367 Y-8.67934
G3 X-13.30825 Y-10.58825 I0.929800 J-0.823700
G1 X-13.30789 Y-10.82212

This is gcode and ngc extesion reader

To understand and maybe tweak the gcode file, the file format spec might come in handy.

1 Like