Project

General

Profile

Pstoedit with laos support » History » Version 8

jaap, 2013-01-16 12:23

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 8 jaap
Make sure you have the development libraries for libpng installed, otherwise the pstoedit laos-plugin will not compile.
50
51 1 jaap
@./configure
52
make
53
make install
54
@
55 4 axel
56
57
Usage: 
58
59
@pstoedit -f laos infile.ps outfile.lgc@
60
61 1 jaap
There are example .ps files in the subdirectory examples.
62
63 7 jaap
h4. Sending a .lgc file to the laser
64
65 4 axel
You can transfer a .lgc file with tftp in binary mode to the loas board.
66
@tftp ip_address_of_your_laos_board
67
status
68 5 axel
binary
69
mode
70 4 axel
put outfile.lgc
71
quit
72
@
73
74 1 jaap
But be careful! The laser might move beyond its limits! 
75
76 7 jaap
h4. Testing laser motion
77
78 6 axel
Peter described ( [[http://redmine.laoslaser.org/issues/17]] ) a way to test it
79
<pre>
80
In any case, (0,0) SHOULD BE "lower left corner". 
81
If you send this file:
82
0 0 0
83
1 10000 20000
84
You should end up with a diagonal line from the lower left corner, 
85
10mm in X direction (left to right) and 20mm in Y direction (bottom to top). As seen from the
86
Front of the laser. If the pstoedit driver or visicut thinks otherwise, it's config file should be altered.
87 1 jaap
There is info on the wiki how to change the pstoedit config. Look for the new "postscript" config file.
88
</pre>
89
90 7 jaap
h3. Installing CUPS
91
92
Once pstoedit creates proper .lgc files, you can install the CUPS printer driver to automatically print from any program.
93
94
[[LAOS_CUPS_driver]]