Skip to content

Commit 0ec5059

Browse files
committed
Add layer_index values to layer_start and layer_end for consistency
1 parent 0c21138 commit 0ec5059

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

vpype_gcode/gwrite.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ def gwrite(document: vp.Document, output: typing.TextIO, profile: str):
8787
if layer_start is not None:
8888
output.write(
8989
layer_start.format(
90-
index=layer_index, index1=layer_index + 1, layer_id=layer_id
90+
index=layer_index,
91+
index1=layer_index + 1,
92+
layer_index=layer_index,
93+
layer_index1=layer_index + 1,
94+
layer_id=layer_id
9195
)
9296
)
9397
lastlines_index = len(layer) - 1
@@ -161,7 +165,12 @@ def gwrite(document: vp.Document, output: typing.TextIO, profile: str):
161165
output.write(line_join)
162166
if layer_end is not None:
163167
output.write(
164-
layer_end.format(index=layer_index, index1=layer_index + 1, layer_id=layer_id)
168+
layer_end.format(
169+
index=layer_index,
170+
index1=layer_index + 1,
171+
layer_index=layer_index,
172+
layer_index1=layer_index + 1,
173+
layer_id=layer_id)
165174
)
166175
if layer_join is not None and layer_index != lastlayer_index:
167176
output.write(layer_join)

0 commit comments

Comments
 (0)