Project

General

Profile

Pstoedit with laos support » History » Version 7

jaap, 2012-11-24 15:17

1 1 jaap
h1. Pstoedit with laos support
2
3 7 jaap
We wrote a plugin for *pstoedit*, called drvlaos.h/cpp, which converts a postscript file into printable data in our [[SimpleCode]] format. Thanks to Wolfgang Glunz, author of pstoedit, our driver code is now fairly simple. Most of the work is done by some new features added by Wolfgang in version 3.61 of pstoedit.
4 1 jaap
5
h2. How it works
6
7
*Pstoedit* simplifies the incoming postscript for us. With a user-definable filter, pstoedit creates a PNG image that containts all image data and all vectors that are going to be raster-engraved. What remains is the data that should either be cut or marked.
8 7 jaap
* engraving: bitmap based engraving, horizontal
9 1 jaap
* marking: low power vector lines
10
* cutting: high power vector lines
11
12
h3. User definable filter
13
14
What is to be cut/marked/engraved can be configured in a configuration file. The file is called laoscfg.ps and should be kept in the pstoedit configuration directory. On Linux, this is usually @/usr/share/pstoedit@ or @/usr/local/share/pstoedit@. The file is in postscript format. It's values can be overwritten in the postscript input file.
15
16
* Thin lines (used for marking/cutting): 1pt or thinner (pt = 0,353mm)
17
* Cutting lines: red thin lines
18
* Marking color: black thin lines
19
20
LaserCuttingSpeed 2
21
LaserCuttingPower 80%
22
LaserCuttingFrequency 10000
23
24
LaserMarkingSpeed 30
25
LaserMarkingPower 80%
26
LaserMarkingFrequency 10000
27
28
LaserEngravingPower 30
29
LaserEngravingSpeed 70
30
LaserEngravingPPI 120
31
LaserEngravingInvert False
32
LaserEngravingMode BW
33
34
LaserBoundaryBox True
35
36
The postscript file is automatically copied when pstoedit (with LaOS patch) is installed.
37
38
h3. Data flow
39
40
Postscript file + Postscript configuration file => ghostscript ==> intermediate output ==> pstoedit backend code ==> output file
41
42
h2. Installation
43
44
Download our latest stable pstoedit version from GitHub:
45 3 axel
@git clone -b laos https://github.com/LaosLaser/pstoedit.git@
46
47 1 jaap
Note the *-b laos*, this is the stable version.
48
 
49
@./configure
50
make
51
make install
52
@
53 4 axel
54
55
Usage: 
56
57
@pstoedit -f laos infile.ps outfile.lgc@
58
59 1 jaap
There are example .ps files in the subdirectory examples.
60
61 7 jaap
h4. Sending a .lgc file to the laser
62
63 4 axel
You can transfer a .lgc file with tftp in binary mode to the loas board.
64
@tftp ip_address_of_your_laos_board
65
status
66 5 axel
binary
67
mode
68 4 axel
put outfile.lgc
69
quit
70
@
71
72 1 jaap
But be careful! The laser might move beyond its limits! 
73
74 7 jaap
h4. Testing laser motion
75
76 6 axel
Peter described ( [[http://redmine.laoslaser.org/issues/17]] ) a way to test it
77
<pre>
78
In any case, (0,0) SHOULD BE "lower left corner". 
79
If you send this file:
80
0 0 0
81
1 10000 20000
82
You should end up with a diagonal line from the lower left corner, 
83
10mm in X direction (left to right) and 20mm in Y direction (bottom to top). As seen from the
84
Front of the laser. If the pstoedit driver or visicut thinks otherwise, it's config file should be altered.
85 1 jaap
There is info on the wiki how to change the pstoedit config. Look for the new "postscript" config file.
86
</pre>
87
88 7 jaap
h3. Installing CUPS
89
90
Once pstoedit creates proper .lgc files, you can install the CUPS printer driver to automatically print from any program.
91
92
[[LAOS_CUPS_driver]]