<p>I´m currently writing my own firmware for a custom delta printer. Therefore I also need to read G-code from programs like Slic3r. Even with an small example like an cube I´m struggling to find out where the z-coordinate is hidden in the code. Here is a small example of the code.</p>

<pre><code>; generated by Slic3r 1.2.9 on 2017-02-13 at 15:08:01

; external perimeters extrusion width = 0.50mm
; perimeters extrusion width = 0.58mm
; infill extrusion width = 0.58mm
; solid infill extrusion width = 0.58mm
; top infill extrusion width = 0.58mm

M107
M104 S205 ; set temperature
G28 ; home all axes
G1 Z5 F5000 ; lift nozzle

M109 S205 ; wait for temperature to be reached
G21 ; set units to millimeters
G90 ; use absolute coordinates
M82 ; use absolute distances for extrusion
G92 E0
G1 Z0.500 F7800.000
G1 E-2.00000 F2400.00000
G92 E0
G1 X-31.893 Y0.000 F7800.000
G1 E2.00000 F2400.00000
G1 X-31.893 Y-25.001 E3.57871 F1800.000
G1 X-31.496 Y-27.307 E3.72646
G1 X-30.350 Y-29.347 E3.87420
G1 X-28.588 Y-30.886 E4.02194
G1 X-26.413 Y-31.748 E4.16968
G1 X-25.000 Y-31.894 E4.25936
G1 X25.000 Y-31.894 E7.41663
G1 X27.306 Y-31.497 E7.56437
G1 X29.346 Y-30.351 E7.71211 F1800.000
G1 X30.885 Y-28.589 E7.85985
G1 X31.746 Y-26.414 E8.00759
G1 X31.893 Y-25.001 E8.09727
G1 X31.893 Y25.001 E11.25470
G1 X31.496 Y27.307 E11.40244
G1 X30.350 Y29.347 E11.55019
G1 X28.588 Y30.886 E11.69793
G1 X26.413 Y31.748 E11.84567
G1 X25.000 Y31.894 E11.93535
G1 X-25.000 Y31.894 E15.09262
G1 X-27.306 Y31.497 E15.24036
G1 X-29.346 Y30.351 E15.38810
G1 X-30.885 Y28.589 E15.53584
G1 X-31.746 Y26.414 E15.68358
G1 X-31.893 Y25.001 E15.77326
G1 X-31.893 Y0.075 E17.34724
G1 E15.34724 F2400.00000
G92 E0
G1 X-22.715 Y-22.716 F7800.000
G1 E2.00000 F2400.00000
G1 X22.715 Y-22.716 E4.86865 F1800.000
G1 X22.715 Y22.716 E7.73745
G1 X-22.715 Y22.716 E10.60609
G1 X-22.715 Y-22.641 E13.47016
G1 X-23.607 Y-23.609 F7800.000
G1 X23.607 Y-23.609 E16.45155 F1800.000
G1 X23.607 Y23.608 E19.43309
G1 X-23.607 Y23.608 E22.41447
G1 X-23.607 Y-23.534 E25.39128
G1 X-24.500 Y-24.501 F7800.000
G1 X24.500 Y-24.501 E28.48541 F1800.000
G1 X24.500 Y24.501 E31.57969
G1 X-24.500 Y24.501 E34.67382
G1 X-24.500 Y-24.426 E37.76336
</code></pre>

<p>Here some configuration details:<br>
G-code flavor: RepRap<br>
Nozzle diameter: 0,5mm  </p>

<p>filament<br>
diameter: 3mm  </p>

<p>general:<br>
layer height: 0,4 mm<br>
perimeters: 3<br>
solid layers top:3 bottom :3  </p>

<p><a href="http://pastebin.com/YW05y3ze" rel="noreferrer">Here</a> is the full G-code</p>

[{'answer_id': 3583, 'author': 'Tom van der Zanden', 'author_id': 26, 'author_profile': 'https://3dprinting.stackexchange.com/users/26', 'pm_score': 2, 'selected': False, 'text': "<p>It isn't hidden at all. It's just that the Z-axis position only changes with each layer change, so the Z coordinate is only passed at layer change. On line 17 of your example G-code, it starts the first layer at Z=0.5mm:</p>\n\n<pre><code>G1 Z0.500 F7800.000\n</code></pre>\n\n<p>The next time you should expect Z to appear is on the next layer.</p>\n"}, {'answer_id': 3584, 'author': 'fred_dot_u', 'author_id': 854, 'author_profile': 'https://3dprinting.stackexchange.com/users/854', 'pm_score': 2, 'selected': False, 'text': "<p>Your included code has a line which reads:</p>\n\n<pre><code>G1 Z0.500\n</code></pre>\n\n<p>I checked a couple of my G-code files for some of the past prints and I was able to identify the bed movement relative to the layer being printed. My slicer (Simplify3D) provides for the bed to drop during certain movements. I found <code>G1 Z0.600</code> followed by <code>G1 Z0.850</code> for one of the layers. When that layer was finished the <code>0.600</code> changed to <code>0.900</code> and the <code>0.850</code> changed to <code>1.150</code>.</p>\n\n<p>This fit in with the model's layer height of 0.300 mm for that job.</p>\n\n<p>I did not find more <code>G1 Zx.xxx</code> codes in your sample, but a larger file would contain those lines.</p>\n"}]
['https://3dprinting.stackexchange.com/questions/3582', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/6008/']