-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I noticed that when using the flip options, offsets are applied before the flip. In my opinion this is unintuitive and I would propose either changing it (since the feature is relatively new, this hopefully wouldn't break too many workflows) or documenting the behavior in the readme.
Relevant code:
vpype-gcode/vpype_gcode/gwrite.py
Lines 133 to 145 in 1a74dec
document.translate(offset_x, offset_y) | |
invert_x = config.get("invert_x", False) | |
invert_y = config.get("invert_y", False) | |
flip_x = config.get("horizontal_flip", False) | |
flip_y = config.get("vertical_flip", False) | |
# transform the document according to inversion parameters | |
if invert_x or invert_y: | |
document = invert_axis(document, invert_x, invert_y) | |
if flip_x or flip_y: | |
document = invert_axis( | |
document, flip_x, flip_y, whole_page=True, unit_scale=unit_scale | |
) |
Example of current behavior (gcode)
SVG 175mm tall, with a line segment in the top left: ((10, 10), (30, 10))
profile toml:
offset_x = 45
offset_y = 45
When vertical_flip = false
, I get this gcode, as expected:
G0 X55 Y55
G0 X75 Y55
When vertical_flip = true
, I would expect:
G0 X55 Y210
G0 X75 Y210
but instead I get:
G0 X55 Y120
G0 X75 Y120
(The expected result can be achieved with offset_y = -45
.)
Metadata
Metadata
Assignees
Labels
No labels