File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ Inside the configuration file you can specify a new output profile using the fol
5151``` toml
5252[gwrite .my_own_plotter ]
5353unit = " mm"
54- invert_y = true
5554document_start = " M3 G21\n "
5655layer_start = " (Start Layer)\n "
5756line_start = " (Start Block)\n "
Original file line number Diff line number Diff line change 66
77setup (
88 name = "vpype-gcode" ,
9- version = "0.8.0 " ,
9+ version = "0.8.1 " ,
1010 description = "vpype gcode plugin" ,
1111 long_description = readme ,
1212 long_description_content_type = "text/markdown" ,
Original file line number Diff line number Diff line change 99vp .CONFIG_MANAGER .load_config_file (str (Path (__file__ ).parent / "bundled_configs.toml" ))
1010
1111
12- def invert_axis (document : vp .Document , invert_x : bool , invert_y : bool ):
13- """Inverts none, one or both axis of the document.
14-
15- This applies a relative scale operation with factors of 1 or -1
16- on the two axis to all layers. The inversion happens relative to
17- the center of the bounds.
18- """
19-
20- bounds = document .bounds ()
21- if not bounds :
22- raise ValueError ("no geometry available, cannot compute origin" )
23-
24- origin = (
25- 0.5 * (bounds [0 ] + bounds [2 ]),
26- 0.5 * (bounds [1 ] + bounds [3 ]),
27- )
28-
29- document .translate (- origin [0 ], - origin [1 ])
30- document .scale (- 1 if invert_x else 1 , - 1 if invert_y else 1 )
31- document .translate (origin [0 ], origin [1 ])
32-
33- return document
34-
35-
3612@click .command ()
3713@click .argument ("output" , type = click .File ("w" ))
3814@click .option (
You can’t perform that action at this time.
0 commit comments