Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow negative values in x_range, y_range #269

Closed
mrwoodo opened this issue May 7, 2021 · 2 comments
Closed

Allow negative values in x_range, y_range #269

mrwoodo opened this issue May 7, 2021 · 2 comments

Comments

@mrwoodo
Copy link

mrwoodo commented May 7, 2021

I have an old Roland GRX-300AG plotter, which uses (0, 0) as the centre-coordinate of the page. For this plotter, (-5340,-3120) is the bottom left when using A4 paper in landscape mode.

The default hp7475a a4 config and rectangle....

vpype rect 0cm 0cm 10cm 10cm layout -l -m 2cm a4 write --device hp7475a out.hpgl

results in HPGL output of....

IN;DF;PS4;SP1;PU2150,7476;PD2150,643,8983,643,8983,7476,2150,7476;PU11040,7721;SP0;IN;

i.e., 4 pairs of {x},{y} for the PD command. But if I alter the config to try and suit the Roland to be say,

x_range = [-5000, 5000]
y_range = [-3000, 3000]

and rerun, the result is incorrect - only 2 coordinates in the PD, and no expected negative values.

IN;DF;PS4;SP1;PU2150,3000;PD2150,643,5000,643;PU11040,7721;SP0;IN;

As a workaround, I'm thinking of leaving the x_range/y_range config alone and instead subtract half my plotter's max width & max height from each coordinate in the HPGL output - This offsetting should fix it, but was wondering if there's another way, thanks.

@abey79
Copy link
Owner

abey79 commented May 7, 2021

Hey @mrwoodo,

Your use case should work, but a bit more work is needed on the configuration file, see the doc. The most important parameter is origin_location. You need to set it to the location on paper of the (0, 0) coordinates of your plotter (so that would half the paper size in your case, but it's not uncommon to have to compensate for some small offsets).

The x_range and y_range do not influence on the coordinates but just "crop" the result.

@mrwoodo
Copy link
Author

mrwoodo commented May 9, 2021

Thanks very much @abey79 - I was misunderstanding the correct usage of those params.

All sorted now cheers!

@mrwoodo mrwoodo closed this as completed May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants