Skip to content

Commit 830e209

Browse files
committed
Add index1 for layer index starting at 1
1 parent 50d0b51 commit 830e209

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

vpype_gcode/gwrite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def gwrite(document: vp.Document, output: typing.TextIO, profile: str):
8585
for layer_index, layer_id in enumerate(document.layers):
8686
layer = document.layers[layer_id]
8787
if layer_start is not None:
88-
output.write(layer_start.format(index=layer_index, layer_id=layer_id))
88+
output.write(layer_start.format(index=layer_index, index1=layer_index+1, layer_id=layer_id))
8989
lastlines_index = len(layer) - 1
9090
for lines_index, line in enumerate(layer):
9191
if line_start is not None:
@@ -131,7 +131,7 @@ def gwrite(document: vp.Document, output: typing.TextIO, profile: str):
131131
if line_join is not None and lines_index != lastlines_index:
132132
output.write(line_join)
133133
if layer_end is not None:
134-
output.write(layer_end.format(index=layer_index, layer_id=layer_id))
134+
output.write(layer_end.format(index=layer_index, index1=layer_index+1, layer_id=layer_id))
135135
if layer_join is not None and layer_index != lastlayer_index:
136136
output.write(layer_join)
137137
if document_end is not None:

0 commit comments

Comments
 (0)