Page 1 of 1

vector postscript output

Posted: Tue Jul 22, 2008 10:43 am
by Fuetterer
I need postscript output but qcad 2.0.4.0 does not give vector output! How can I get real postscript as for example xfig is producing?
Thanks a lot!

Posted: Tue Jul 22, 2008 11:03 am
by andrew
Under Linux: Print to a file.

Under Windows: Install a PostScript printer driver (included with Windows) and then print to a file with that driver.

If you let me know what you need the PostScript output for and what operating system you are using, I might be able to provide more detailed help for your problem.

Posted: Tue Jul 22, 2008 2:05 pm
by Fuetterer
Thanks! :-) I am using Linux (SUSE 10.2) and the suggested printer solution produces indeed Postscript but it's not vector but bitmap Postscript. If you zoom you may see the artefacts. If you draw a circle with xfig-Postscript outputs you can go as deep as you want (as far as the precision of the floating point numbers permit). As I am drawing and printing extremely small features I would need a good resolution.

Cheers!


andrew wrote:Under Linux: Print to a file.

Under Windows: Install a PostScript printer driver (included with Windows) and then print to a file with that driver.

If you let me know what you need the PostScript output for and what operating system you are using, I might be able to provide more detailed help for your problem.
:D

Posted: Tue Jul 22, 2008 2:10 pm
by andrew
I cannot reproduce this. Of course QCad should output vectors to PS, everything else hardly makes sense. Are you using a QCad package that was downloaded from our web site or something that came with a Linux distribution?

Posted: Tue Jul 22, 2008 2:13 pm
by andrew
You also might want to give a more recent version of QCad a try (2.2.1.0 is the latest).

Posted: Tue Jul 22, 2008 2:35 pm
by Fuetterer
andrew wrote:I cannot reproduce this. Of course QCad should output vectors to PS, everything else hardly makes sense. Are you using a QCad package that was downloaded from our web site or something that came with a Linux distribution?
Do you have the postscript viewer "gv"? Draw a circle with qcad and xfig, save it as a ps file. Magnify at maximum (10x) and use the magnifying glass (center mouse button) to magnify another 64 times and you may see the difference.

In xfig the ps-output consists mainly of following lines:

% here starts figure with depth 50
% Ellipse
7.500 slw
n 3870 3465 910 910 0 360 DrawEllipse gs col0 s gr
% here ends figure;
$F2psEnd
rs
showpage

This is what I would call "vector graphics" as there is a command for a circle (ellipse is a more general circle :-) )

In the qcad output a circle seems to be represented as a polygone (LT stands probably for "line to"):

1632 5600 MT
1632 5598 LT
1632 5596 LT
1632 5594 LT
1632 5592 LT
1632 5590 LT
1632 5588 LT
1632 5586 LT
1632 5584 LT
...

Why do they do that? It is weird to draw thousand lines if there is a special compact and practical command for circles...

Posted: Tue Jul 22, 2008 3:06 pm
by andrew
Your observation is correct: QCad uses indeed lines and not the PostScript ellipse commands. This is because the PostScript engine of Qt has problems with the precision of arcs with a large radius (angles, center and radius are rounded to integers).

In other words, with the ellipse or arc commands of PostScript, your arcs would look nice and smooth but they would be slightly displaced and the endpoints of arcs would not exactly connect for example to a line that starts at the same position.

QCad 2.2.1.0 exports at a higher resolution which makes arcs and circles both smooth and precise.

BTW: Line graphics are also a vector graphics. The alternative to vector graphics are raster graphics (a large number of small squares or dots).

Posted: Tue Jul 22, 2008 3:46 pm
by Fuetterer
andrew wrote:Your observation is correct: QCad uses indeed lines and not the PostScript ellipse commands. This is because the PostScript engine of Qt has problems with the precision of arcs with a large radius (angles, center and radius are rounded to integers).

In other words, with the ellipse or arc commands of PostScript, your arcs would look nice and smooth but they would be slightly displaced and the endpoints of arcs would not exactly connect for example to a line that starts at the same position.

QCad 2.2.1.0 exports at a higher resolution which makes arcs and circles both smooth and precise.

BTW: Line graphics are also a vector graphics. The alternative to vector graphics are raster graphics (a large number of small squares or dots).

Dear Andrew
Thank you very much!

Cheers, Claus