Graph paper script

Paint programs, vector editors, 3d modelers, animation editors, etc.
Post Reply
Message
Author
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

Graph paper script

#1 Post by don570 »

Here is a script that will create professional looking graph paper.

Edit:

To explain the GUI --->

Box Size 10
Horizontal Distance 100
Vertical distance 70

makes a document 1000 horizontal dots by 700vertical dots.

You must convert this to inches or the metric system when using a printer.



Edit: I switched to a pet package for convenience.
It is gettexted for anyone interested in translating.
Start Menu > Documents


Contributed by Vovchik, Seaside and Don White

The script runs in the usual way ./Graphpaper.sh
Follow the instructions and save your graph paper to disk as an SVG file.
Default name is <default>/root/Graphpaper.svg</default>
but that is easy to change by clicking file icon.


Image

Image
Attachments
Graphpaper.sh.gz
script to gettext - remove fake gz extension
(5.18 KiB) Downloaded 602 times
Graphpaper-1.1.pet
Application to make graph paper - gettext version
(4.19 KiB) Downloaded 630 times
Last edited by don570 on Tue 01 Oct 2019, 23:11, edited 3 times in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#2 Post by don570 »

version 1.0 - pet package

I switched to a pet package for convenience. It is gettexted
for anyone interested in translating.

Start Menu > Documents

____________________________________

User avatar
vicmz
Posts: 1262
Joined: Sun 15 Jan 2012, 22:47

#3 Post by vicmz »

Nice :D
Note: the 'save to disk' button isn't gettexted, I've done it myself before translating.
Attachments
Screenshot_2013-12-27_08_09_22.png
(18.26 KiB) Downloaded 760 times
Graphpaper.sh.gz
Same as 1.0 but 'save to disk' button gettexted, remove false .gz
(4.82 KiB) Downloaded 594 times
Graphpaper.desktop.gz
Translated menu entry, remove false .gz
(523 Bytes) Downloaded 595 times
MoManager-es-Graphpaper-1.0.tar.gz
(1.06 KiB) Downloaded 583 times
[url=http://murga-linux.com/puppy/viewtopic.php?t=76948]Puppy Linux en español[/url]

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#4 Post by don570 »

Thanks for looking at the script. I'll post a finished pet package.
I should try a French and German translation.

__________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

New version 1.1

#5 Post by don570 »

New version 1.1

I corrected a dumb mistake that prevented the SVG image from forming
if the 'Save to disk' button was clicked. I didn't realise that functions are
tricky to put in <action> directives if they have an ampersand &.

The function didn't work the way I thought it would and the exiting of the
GUI wasn't occuring when I thought it would occur.

___________________________________________________

Thanks to vicmz there is a Spanish tranlation. I was inspired to
try my hand at translating with the help of Google translate.

I attempted Russian, Portuguese ,French and German.

They are all inside the pet package. I have posted the script if
anyone is interested in translating with momanager.
Remember that momanager requires the devx file to be installed.

____________________________________________________

User avatar
icosahedron
Posts: 119
Joined: Mon 28 Nov 2011, 11:58
Location: UK

#6 Post by icosahedron »

Hi,

Can someone help me to use this application, please?
I'm neither an artist nor a mathematician, so I'm not familiar with the jargon and I can't figure out the formulas.

The Graphpaper application has 5 parameters:
Box Size, Horizontal Distance, Vertical Distance, Width, and Height.

After over an hour of trial-and-error, I've figured that Width and Height are the overall size of the graphpaper in pixels, and that Width needs to be a whole multiple of Horizontal, and Height needs to be a whole multiple of Vertical, but I don't really know what Horizontal and Vertical refer to.

They seem to alter the number of grid squares across the paper, but I'm not sure exactly how, and the Box Size parameter is a complete mystery. It seems to affect the visibility of the lines, and a value of 5 seems to be nor too obtrusive when zoomed out, yet still visible when zoomed to 800x for pixel work, but I can't see what the numbers refer to, or what is actually changing.

Can someone also tell me what the pixel size is on MT Paint? I want to create graph paper with squares of 0.2 / 1.0 cm on an A4 sheet, but I can't figure out what numbers to enter into the parameter boxes to obtain this output.

Thanks.
Computers: - I just ride 'em, I dunno what makes 'em work.
Console/Terminal? What's that?
I visit the Internet to OBTAIN information, not to PROVIDE it! (Increase Internet Privacy)

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#7 Post by don570 »

I've never printed in mtpaint. Apparently it uses pixels so a conversion is needed.

This website seems to do the conversion.

https://www.papersizes.org/a-sizes-in-pixels.htm

____________________________________________________


There are three numbers fill out,
but I've noticed that the script becomes confusing if the standard numbers aren't used. (see image)

The numbers to fill in fields are pixels.

__________________________________________
Attachments
Screenshot_2013-12-27_08_09_22.png
(18.26 KiB) Downloaded 341 times

wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

#8 Post by wjaguar »

icosahedron wrote:I want to create graph paper with squares of 0.2 / 1.0 cm on an A4 sheet, but I can't figure out what numbers to enter into the parameter boxes to obtain this output.
The attached Postscript file should produce the paper you want. Just unpack it (gunzip) and send it to printer: lpr graph.ps

If you want to change the parameters (margins, squares size, paper size) the file can be modified in a text editor.
Attachments
graph.ps.gz
(661 Bytes) Downloaded 236 times

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#9 Post by don570 »

I checked the old script on fatdog linux and it works properly
except the inkscape button launches a totally black document??
Perhaps it needs inkscape lite.

To explain the GUI --->

Code: Select all

Box Size  10
Horizontal  Distance   100
Vertical distance   70 
makes a document 1000 horizontal dots by 700 vertical dots.

You must convert this to inches or the metric system when using a printer.


_______________________________________________________
wjaguar wrote:The attached Postscript file should produce the paper you want. Just unpack it (gunzip) and send it to printer: lpr graph.ps
I"ll check using fatdog linux.
______________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#10 Post by don570 »

When I opened up the ps format file that wjaguar provided using
a recent windows gimp app I found that there is a fault in the graph paper.
Namely a column isn't wide enough. (see image)
The right column is slightly narrower than left column.
Attachments
GRAPH-OUTPUT.png
one column is too narrow
(551 Bytes) Downloaded 204 times

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#11 Post by rcrsn51 »

How about this?
Attachments
out.png
(136 Bytes) Downloaded 190 times

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#12 Post by don570 »

I used windows 10 GIMP program to open file.
There must be a bug in windows postscript???

wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

#13 Post by wjaguar »

don570 wrote:Namely a column isn't wide enough. (see image)
The right column is slightly narrower than left column.
Some rows & columns will inevitably differ by one pixel from the rest. For the simple reason that DPI means dots per inch. No real-life DPI value gives you a whole number of pixels per millimeter (printer DPI usually is some multiple of 300).

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#14 Post by don570 »

I checked graph.ps.gz in fatdog linux...

ps2pdf is builtin to fatdog linux and I was able to open the file as graphpaper
in 2 programs ---> gimp and document viewer 2.32

gimp had the same problem as I saw in the window 10 GIMP.

Document viewer 2.32 had the strange problem of two thick black lines
(see image)
Attachments
graph-document-viewer-2.32.png
two thick black lines
(17.12 KiB) Downloaded 172 times

wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

#15 Post by wjaguar »

don570 wrote:gimp had the same problem as I saw in the window 10 GIMP.
Which is inevitable, as explained above. Pixel grid is not metric.
don570 wrote:Document viewer 2.32 had the strange problem of two thick black lines (see image)
The thicker lines should be there every centimeter (i.e. after every 4 thinner ones). But, with DPI of mere 96, "Document viewer" was trying to compensate for linewidths it could not reproduce with any precision, by antialiasing the lines, and bungled the job badly (behold the consequences of not knowing what "gamma correction" is).

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

#16 Post by Moose On The Loose »

wjaguar wrote:
don570 wrote:gimp had the same problem as I saw in the window 10 GIMP.
Which is inevitable, as explained above. Pixel grid is not metric.
On the gimp I use, the import allows you to change the resolution to 254 which seems to comes out even.

I, however, am not using one that comes with legacy software from Washington State. Perhaps others may want to try this on a good OS like perhaps Puppy Linux.

The copy of "gv" on Puppy 528 produces a blank page. That looks like a different issue.

wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

#17 Post by wjaguar »

Moose On The Loose wrote:On the gimp I use, the import allows you to change the resolution to 254 which seems to comes out even.
As it should in that case. :) Still, real physical devices with DPI like that, or any multiple of that, are really rare.
The copy of "gv" on Puppy 528 produces a blank page. That looks like a different issue.
No such problem here on Slackware 14.2 (gv 3.7.4, GPL Ghostscript 9.26).

Post Reply