You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added `horizontal_flip` and `vertical_flip` config options. This improves handling of plotter which have inverted axis orientation over the previous `invert_y` + `offset_y` solution.
Copy file name to clipboardExpand all lines: README.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ Vpype plugin to generate gcode and other text output.
3
3
See: https://github.com/abey79/vpype
4
4
5
5
6
-
Gcode vpype plugin. Write gcode files for the vpype pipeline. The output format can be customized by the user heavily to an extent that you can also output non gcode ascii text files.
6
+
Gcode vpype plugin. Write gcode files for the vpype pipeline. The output format can be customized by the user heavily to an extent that you can also output non gcode ascii text files.
7
7
8
8
*`gwrite` write geometries as gcode to a file
9
9
@@ -41,7 +41,7 @@ The goal of this project is to allow all hobbyists needing gcode writing to have
41
41
Breaking changes are fine. Anything that will make this code more likely to end up in vpype properly and this particular library getting deprecated will be highly likely to be done.
42
42
43
43
# Profiles
44
-
This plugin supports different output profiles which configure the way the resulting output is formatted. Output profiles are flexible in a way that they can also be used to generate non gcode files, i.e. JSON or CSV files.
44
+
This plugin supports different output profiles which configure the way the resulting output is formatted. Output profiles are flexible in a way that they can also be used to generate non gcode files, i.e. JSON or CSV files.
45
45
46
46
## Predefined Profiles
47
47
There are several predefined output profiles as part of the release:
@@ -91,8 +91,10 @@ These parameters define the transformation between *vpype*'s and the target's co
91
91
-`scale_y`: Apply a scaling factor on the Y axis. Use `-1` to invert the direction.
92
92
-`offset_x`: Apply an offset to the X axis. This offset is expressed in the unit defined by `unit`.
93
93
-`offset_y`: Apply an offset to the Y axis. This offset is expressed in the unit defined by `unit`.
94
-
-`invert_x`: Invert or mirror all points right-to-left without changing the position within the document space.
95
-
-`invert_y`: Invert or mirror all points top-to-bottom without changing the position within the document space.
94
+
-`horizontal_flip`: Flip the document right-to-left. Requires the document page size to be set.
95
+
-`vertical_flip`: Flip the document to-to-bottom. Requires the document page size to be set. This will correctly transform the document from the standard SVG top-left origin to the standard gcode bottom-left origin.
96
+
-`invert_x`: Flip all points right-to-left without changing the position within the document.
97
+
-`invert_y`: Flip all points top-to-bottom without changing the position within the document.
96
98
97
99
### Output Format
98
100
All of the options below default to an empty text which means no output is generated. However, if `segment_first` or `segment_last` is omitted the code from `segment` is used. If there is only one segment, `segment_first` takes priority over `segment_last`.
@@ -113,7 +115,7 @@ All of the options below default to an empty text which means no output is gener
113
115
For example every element accepts the value of `index`. You would encode that in the text as `{index:d}` the d denotes an integer value. If you need to have a `{` value in your text you would encode that as `{{` likewise you would encode a `}` as `}}`.
114
116
115
117
-`document_start` and `document_end` accept the following:
116
-
-`filename` file name of the file being saved
118
+
-`filename` file name of the file being saved
117
119
118
120
-`layer_start`, `layer_end` and `layer_join` accept the following:
119
121
-`x` the last_x position before this layer, this is 0 for the first layer
@@ -135,12 +137,12 @@ For example every element accepts the value of `index`. You would encode that in
135
137
-`index` same as `lines_index`
136
138
-`index1` same as `lines_index1`
137
139
-`lines_index` the current line index within this layer starting from 0
138
-
-`lines_index1` the current line index within this layer number starting from 1
140
+
-`lines_index1` the current line index within this layer number starting from 1
139
141
-`layer_index` the current layer index starting from 0
140
142
-`layer_index1` the current layer number starting from 1
141
143
-`layer_id` values for the current vpype layer ID that contains this line
142
144
-`filename` file name of the file being saved
143
-
145
+
144
146
-`segment_first`, `segment`, `segment_last` accept the following:
145
147
*`index`: index of the particular coordinate pair. eg `{index:d}`
146
148
*`x` absolute position x in floating point number. eg `{x:.4f}`
@@ -160,7 +162,7 @@ For example every element accepts the value of `index`. You would encode that in
160
162
*`segment_index` the current segment within this line starting from 0
161
163
*`segment_index1` the current segment within this line starting from 1
162
164
*`lines_index` the current line index within this layer starting from 0
163
-
*`lines_index1` the current line index within this layer number starting from 1
165
+
*`lines_index1` the current line index within this layer number starting from 1
164
166
*`layer_index` the current layer index starting from 0
165
167
*`layer_index1` the current layer number starting from 1
166
168
*`layer_id` values for the current vpype layer ID that contains this line
@@ -207,7 +209,7 @@ line 8 segment count: 1
207
209
line 9 segment count: 1
208
210
line 10 segment count: 1
209
211
```
210
-
212
+
211
213
Alternatively, default values for string-based variable may be provided using the command line using the `--default` option:
212
214
213
215
```
@@ -289,7 +291,7 @@ default_profile = "gcode"
289
291
```
290
292
291
293
## Coordinate System
292
-
`Vpype-Gcode` uses the standard coordinate system of vpype which uses the SVG spec' system. The origin point is located in the upper-left hand corner. Positive y values are towards the bottom. If you wish to change the coordinate system you should use `invert_y` and `invert_x` equals `true` in your profile. This will mirror the work horizontally or vertically within the same euclidean space. For example the native Coordinate system of gcode is origin point in the bottom left. This requires that for gcode profiles be marked as `invert_y`.
294
+
`Vpype-Gcode` uses the standard coordinate system of vpype which uses the SVG spec' system. The origin point is located in the upper-left hand corner. Positive y values are towards the bottom. If you wish to change the coordinate system you should use `vertical_flip` and `horizontal_flip` equals `true` in your profile (or `invert_y` and `invert_x` in the uncommon situation where the document page size is not known). For example the native coordinate system of gcode is origin point in the bottom left with positive y values toward the top. This system requires gcode profiles be marked with `vertical_flip = true`.
info= "This gcode profile is correctly inverted across the y-axis"
303
305
```
304
306
@@ -410,7 +412,7 @@ New release should be created with the following workflow:
410
412
411
413
# Credits
412
414
413
-
*[tatarize](https://github.com/tatarize) - Wrote the bulk of the plug-in.
415
+
*[tatarize](https://github.com/tatarize) - Wrote the bulk of the plug-in.
414
416
*[abey79](https://github.com/abey79) - Helped with advice that largely pushes us towards the integration goals as well as his very solid suggestion to use .format() which greatly expands the expected formats.
415
417
*[theomega](https://github.com/theomega) - Basically rewrote the thing into the dapper codebase you see today. Rather than the 4 hours I figured I'd kill on this.
416
418
*[ithinkido](https://github.com/ithinkido) - For his many insightful comments and determination to make this project as good as it can be.
0 commit comments