Skip to content

Commit 935ba62

Browse files
committed
linecollection -> line
1 parent fab6601 commit 935ba62

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="vpype-gcode",
9-
version="0.6.5",
9+
version="0.7.0",
1010
description="vpype gcode plugin",
1111
long_description=readme,
1212
long_description_content_type="text/markdown",

vpype_gcode/bundled_configs.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ segment_last = "Stop, {x:f}, {x:f}\n"
2828
[gwrite.json]
2929
document_start = "{{"
3030
document_end = "}}\n"
31-
linecollection_join = ","
31+
line_join = ","
3232
layer_join = ","
3333
layer_start = "\n\t\"Layer\": {{"
3434
layer_end = "\t}}\n"
35-
linecollection_start = "\n\t\t\"LineCollection{index:d}\": [\n"
36-
linecollection_end = "\n\t\t]"
35+
line_start = "\n\t\t\"Line{index:d}\": [\n"
36+
line_end = "\n\t\t]"
3737
segment = "\t\t{{\n\t\t\t\"X\": {ix:d},\n\t\t\t\"Y\": {iy:d}\n\t\t}},\n"
3838
segment_last = "\t\t{{\n\t\t\t\"X\": {ix:d},\n\t\t\t\"Y\": {iy:d}\n\t\t}}"
3939

@@ -43,8 +43,8 @@ document_start = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
4343
"""
4444
document_end = "</svg>"
4545
layer_start = '<g fill="none" stroke="black">'
46-
linecollection_start = '<path d="M '
46+
line_start = '<path d="M '
4747
segment_first = "{ix:d} {iy:d} l"
4848
segment = "{idx:d} {idy:d} "
49-
linecollection_end = '"/>'
49+
line_end = '"/>'
5050
layer_end = "</g>"

vpype_gcode/gwrite.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ def gwrite(document: vp.Document, output: typing.TextIO, profile: str):
8080
layer_start = config.get("layer_start", None)
8181
layer_end = config.get("layer_end", None)
8282
layer_join = config.get("layer_join", None)
83-
linecollection_start = config.get("linecollection_start", None)
84-
linecollection_end = config.get("linecollection_end", None)
85-
linecollection_join = config.get("linecollection_join", None)
83+
line_start = config.get("line_start", None)
84+
line_end = config.get("line_end", None)
85+
line_join = config.get("line_join", None)
8686
segment_first = config.get("segment_first", None)
8787
segment = config.get("segment", None)
8888
segment_last = config.get("segment_last", None)
@@ -109,8 +109,8 @@ def gwrite(document: vp.Document, output: typing.TextIO, profile: str):
109109
lastlines_index = len(layer) - 1
110110
for lines_index, lines in enumerate(layer):
111111
lines_scaled = lines * scale
112-
if linecollection_start is not None:
113-
output.write(linecollection_start.format(index=lines_index))
112+
if line_start is not None:
113+
output.write(line_start.format(index=lines_index))
114114
segment_last_index = len(lines_scaled) - 1
115115
for segment_index, seg in enumerate(lines_scaled):
116116
x = seg.real
@@ -147,10 +147,10 @@ def gwrite(document: vp.Document, output: typing.TextIO, profile: str):
147147
)
148148
last_x = x
149149
last_y = y
150-
if linecollection_end is not None:
151-
output.write(linecollection_end.format(index=lines_index))
152-
if linecollection_join is not None and lines_index != lastlines_index:
153-
output.write(linecollection_join)
150+
if line_end is not None:
151+
output.write(line_end.format(index=lines_index))
152+
if line_join is not None and lines_index != lastlines_index:
153+
output.write(line_join)
154154
if layer_end is not None:
155155
output.write(layer_end.format(index=layer_index))
156156
if layer_join is not None and layer_index != lastlayer_index:

0 commit comments

Comments
 (0)